This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch kylin-on-parquet-v2
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 9679252db3dbe36746e80d449791e9c53c47b15d
Author: XiaoxiangYu <x...@apache.org>
AuthorDate: Tue Oct 27 03:37:35 2020 +0800

    KYLIN-4778 Package and release in docker container
---
 build/CI/run-ci.sh                                 |  71 ++++++----
 build/CI/testing/features/specs/generic_test.spec  |  15 ---
 build/CI/testing/kylin_utils/kylin.py              |   2 +-
 dev-support/build-release/packaging.sh             |  19 ++-
 dev-support/build-release/script/build_release.sh  | 148 ++++++++++-----------
 docker/dockerfile/cluster/client/run_cli.sh        |   9 +-
 .../{setup_cluster.sh => setup_hadoop_cluster.sh}  |  12 +-
 .../packaging.sh => docker/setup_service.sh        |  43 +++---
 docker/stop_cluster.sh                             |   6 +-
 9 files changed, 148 insertions(+), 177 deletions(-)

diff --git a/build/CI/run-ci.sh b/build/CI/run-ci.sh
index 574f892..28110b4 100644
--- a/build/CI/run-ci.sh
+++ b/build/CI/run-ci.sh
@@ -17,54 +17,59 @@
 # limitations under the License.
 #
 
+# This is a sample script for packaging & running system testing by docker 
container.
+
 # 1. Packaging for Kylin binary
 # 2. Deploy hadoop cluster
 # 3. Delpoy kylin cluster
 # 4. Run system testing
 # 5. Clean up
 
-INIT_HADOOP=1
+INIT_HADOOP=${INIT_HADOOP:-1}
 
 ###########################################
 ###########################################
 # 0. Prepare
-export JAVA_HOME=/usr/local/java
-export PATH=$JAVA_HOME/bin:$PATH
-export PATH=/root/xiaoxiang.yu/INSTALL/anaconda/bin:$PATH
-binary_file=/root/xiaoxiang.yu/BINARY/apache-kylin-3.1.2-SNAPSHOT-bin.tar.gz
-source ~/.bashrc
+AWAIT_SECOND=${AWAIT_SECOND:-240}
 pwd
 
 ###########################################
 ###########################################
 # 1. Package kylin
+if [[ -z $binary_file ]]; then
+  cd dev-support/build-release
+  bash -x package.sh
+  cd -
+fi
+
+binary_file=${binary_file:-apache-kylin-bin.tar.gz}
 
-#TODO
+# 1.1 Prepare Kylin conf
+cp $binary_file docker/docker-compose/others/kylin
 cd docker/docker-compose/others/kylin
-cp $binary_file .
-tar zxf apache-kylin-3.1.2-SNAPSHOT-bin.tar.gz
+tar zxf apache-kylin-bin.tar.gz
 
 mkdir kylin-all
 mkdir kylin-query
 mkdir kylin-job
 
-cp -r apache-kylin-3.1.2-SNAPSHOT-bin/* kylin-all
+cp -r apache-kylin-bin/* kylin-all
 cat > kylin-all/conf/kylin.properties <<EOL
 kylin.job.scheduler.default=100
 kylin.server.self-discovery-enabled=true
 EOL
 
-cp -r apache-kylin-3.1.2-SNAPSHOT-bin/* kylin-query
-cat > kylin-query/conf/kylin.properties <<EOL
-kylin.job.scheduler.default=100
-kylin.server.self-discovery-enabled=true
-EOL
-
-cp -r apache-kylin-3.1.2-SNAPSHOT-bin/* kylin-job
-cat > kylin-job/conf/kylin.properties <<EOL
-kylin.job.scheduler.default=100
-kylin.server.self-discovery-enabled=true
-EOL
+#cp -r apache-kylin-bin/* kylin-query
+#cat > kylin-query/conf/kylin.properties <<EOL
+#kylin.job.scheduler.default=100
+#kylin.server.self-discovery-enabled=true
+#EOL
+#
+#cp -r apache-kylin-bin/* kylin-job
+#cat > kylin-job/conf/kylin.properties <<EOL
+#kylin.job.scheduler.default=100
+#kylin.server.self-discovery-enabled=true
+#EOL
 
 cd -
 
@@ -72,41 +77,49 @@ cd -
 ###########################################
 # 2. Deploy Hadoop
 
-if [ "$INIT_HADOOP" = "1" ];
+if [ "$INIT_HADOOP" == "1" ];
 then
     echo "Restart Hadoop cluster."
     cd docker
 
     bash stop_cluster.sh
 
-    bash setup_cluster.sh --cluster_mode write --hadoop_version 2.8.5 
--hive_version 1.2.2 \
+    bash setup_hadoop_cluster.sh --cluster_mode write --hadoop_version 2.8.5 
--hive_version 1.2.2 \
       --enable_hbase yes --hbase_version 1.1.2  --enable_ldap nosh 
setup_cluster.sh \
       --cluster_mode write --hadoop_version 2.8.5 --hive_version 1.2.2 
--enable_hbase yes \
       --hbase_version 1.1.2  --enable_ldap no
     cd ..
+    sleep 100
 else
     echo "Do NOT restart Hadoop cluster."
 fi;
 
-docker ps
-
 ###########################################
 ###########################################
 # 3. Deploy Kylin
 
-# TODO
+echo "Restart Kylin cluster."
+
+cd docker
+bash setup_service.sh --cluster_mode write --hadoop_version 2.8.5 
--hive_version 1.2.2 \
+      --enable_hbase yes --hbase_version 1.1.2  --enable_ldap nosh 
setup_cluster.sh \
+      --cluster_mode write --hadoop_version 2.8.5 --hive_version 1.2.2 
--enable_hbase yes \
+      --hbase_version 1.1.2  --enable_ldap no
+docker ps
+cd ..
 
 ###########################################
 ###########################################
 # 4. Run test
 
-echo "Wait about 6 minutes ..."
-sleep 360
+echo "Wait about 4 minutes ..."
+sleep ${AWAIT_SECOND}
 
 cd build/CI/testing
 pip install -r requirements.txt
 gauge run --tags 3.x
-cd ..
+cd -
+echo "Please check build/CI/testing/reports/html-report/index.html for 
reports."
 
 ###########################################
 ###########################################
diff --git a/build/CI/testing/features/specs/generic_test.spec 
b/build/CI/testing/features/specs/generic_test.spec
index 95e68fa..c2f6b5e 100644
--- a/build/CI/testing/features/specs/generic_test.spec
+++ b/build/CI/testing/features/specs/generic_test.spec
@@ -32,31 +32,16 @@ Tags:3.x
 * Merge cube "kylin_spark_cube" segment from "1325347200000" to "1391011200000"
 
 
-## FLINK engine
-
-* Clone cube "release_test_0001_cube" and name it "kylin_flink_cube" in 
"release_test_0001_project", modify build engine to "FLINK"
-
-* Build segment from "1325347200000" to "1356969600000" in "kylin_flink_cube"
-
-* Build segment from "1356969600000" to "1391011200000" in "kylin_flink_cube"
-
-* Merge cube "kylin_flink_cube" segment from "1325347200000" to "1391011200000"
-
-
 ## Query cube and pushdown
 
 * Query SQL "select count(*) from kylin_sales" and specify 
"release_test_0001_cube" cube to query in "release_test_0001_project", compare 
result with "10000"
 
 * Query SQL "select count(*) from kylin_sales" and specify "kylin_spark_cube" 
cube to query in "release_test_0001_project", compare result with "10000"
 
-* Query SQL "select count(*) from kylin_sales" and specify "kylin_flink_cube" 
cube to query in "release_test_0001_project", compare result with "10000"
-
 * Disable cube "release_test_0001_cube"
 
 * Disable cube "kylin_spark_cube"
 
-* Disable cube "kylin_flink_cube"
-
 * Query SQL "select count(*) from kylin_sales" in "release_test_0001_project" 
and pushdown, compare result with "10000"
 
 
diff --git a/build/CI/testing/kylin_utils/kylin.py 
b/build/CI/testing/kylin_utils/kylin.py
index 164f2ca..1cb9a46 100644
--- a/build/CI/testing/kylin_utils/kylin.py
+++ b/build/CI/testing/kylin_utils/kylin.py
@@ -259,7 +259,7 @@ class KylinHttpClient(BasicHttpClient):  # pylint: 
disable=too-many-public-metho
         return resp
 
     def update_cube_engine(self, cube_name, engine_type):
-        url = '/cubes/{cube}/{engine}'.format(cube=cube_name, 
engine=engine_type)
+        url = '/cubes/{cube}/engine/{engine}'.format(cube=cube_name, 
engine=engine_type)
         resp = self._request('PUT', url)
         return resp
 
diff --git a/dev-support/build-release/packaging.sh 
b/dev-support/build-release/packaging.sh
index 7997095..9084642 100644
--- a/dev-support/build-release/packaging.sh
+++ b/dev-support/build-release/packaging.sh
@@ -17,33 +17,32 @@
 # limitations under the License.
 #
 
-### Thank you for 
https://github.com/apache/spark/tree/master/dev/create-release .
-
+## Refer to https://github.com/apache/spark/tree/master/dev/create-release
 # docker build -f Dockerfile -t apachekylin/release-machine:jdk8-slim .
-# docker run --name machine apachekylin/release-machine:jdk8-slim
 
+ENVFILE="env.list"
 cat > $ENVFILE <<EOF
 DRY_RUN=$DRY_RUN
-SKIP_TAG=$SKIP_TAG
-RUNNING_IN_DOCKER=1
+RUNNING_CI=$RUNNING_CI
 GIT_BRANCH=$GIT_BRANCH
-NEXT_VERSION=$NEXT_VERSION
+GIT_BRANCH_HADOOP3=$GIT_BRANCH_HADOOP3
+NEXT_RELEASE_VERSION=$NEXT_RELEASE_VERSION
 RELEASE_VERSION=$RELEASE_VERSION
 RELEASE_TAG=$RELEASE_TAG
 GIT_REF=$GIT_REF
-ASF_USERNAME=$ASF_USERNAME
+GIT_REPO_URL=$GIT_REPO_URL
 GIT_NAME=$GIT_NAME
 GIT_EMAIL=$GIT_EMAIL
 GPG_KEY=$GPG_KEY
+ASF_USERNAME=$ASF_USERNAME
 ASF_PASSWORD=$ASF_PASSWORD
 GPG_PASSPHRASE=$GPG_PASSPHRASE
-RELEASE_STEP=$RELEASE_STEP
 USER=$USER
 EOF
 
-
 docker run -ti \
   --env-file "$ENVFILE" \
+  --name kylin-release-machine \
   apachekylin/release-machine:jdk8-slim
 
-docker cp machine:/root/kylin/dist/apache-kylin-*-SNAPSHOT-bin.tar.gz .
\ No newline at end of file
+docker cp kylin-release-machine:/root/ci/apache-kylin-bin.tar.gz 
../../apache-kylin-bin.tar.gz
\ No newline at end of file
diff --git a/dev-support/build-release/script/build_release.sh 
b/dev-support/build-release/script/build_release.sh
index 4e02d28..0f2aa68 100644
--- a/dev-support/build-release/script/build_release.sh
+++ b/dev-support/build-release/script/build_release.sh
@@ -17,8 +17,11 @@
 # limitations under the License.
 #
 
-PACKAGE_ENABLE=false
-RELEASE_ENABLE=false
+export LC_ALL=C.UTF-8
+export LANG=C.UTF-8
+set -e
+PACKAGE_ENABLE=1
+RELEASE_ENABLE=0
 
 function exit_with_usage {
   cat << EOF
@@ -26,14 +29,13 @@ usage: release-build.sh <package|publish-rc>
 Creates build deliverables from a Kylin commit.
 
 Top level targets are
-  package: Create binary packages and commit them to 
dist.apache.org/repos/dist/dev/spark/
+  package: Create binary packages and commit them to 
dist.apache.org/repos/dist/dev/kylin/
   publish-rc: Publish snapshot release to Apache snapshots
 
 All other inputs are environment variables
 
 GIT_REF - Release tag or commit to build from
-SPARK_PACKAGE_VERSION - Release identifier in top level package directory 
(e.g. 2.1.2-rc1)
-SPARK_VERSION - (optional) Version of Spark being built (e.g. 2.1.2)
+RELEASE_VERSION - Release identifier in top level package directory (e.g. 
3.1.2)
 
 ASF_USERNAME - Username of ASF committer account
 ASF_PASSWORD - Password of ASF committer account
@@ -53,104 +55,95 @@ if [[ $@ == *"help"* ]]; then
 fi
 
 if [[ "$1" == "package" ]]; then
-    PACKAGE_ENABLE=true
+    PACKAGE_ENABLE=1
 fi
 
 if [[ "$1" == "publish-rc" ]]; then
-    PACKAGE_ENABLE=true
-    RELEASE_ENABLE=true
+    PACKAGE_ENABLE=1
+    RELEASE_ENABLE=1
 fi
 
-set -e
-export LC_ALL=C.UTF-8
-export LANG=C.UTF-8
-
-####################################################
-####################################################
 ####################################################
 ####################################################
 #### Configuration
 
-KYLIN_PACKAGE_BRANCH=master
-KYLIN_PACKAGE_BRANCH_HADOOP3=master-hadoop3
-KYLIN_PACKAGE_VERSION=3.1.1
-KYLIN_PACKAGE_VERSION_RC=3.1.1-rc1
-NEXT_RELEASE_VERSION=3.1.2-SNAPSHOT
-ASF_USERNAME=xxyu
-ASF_PASSWORD=123
-GPG_KEY=123
-GPG_PASSPHRASE=123
+KYLIN_PACKAGE_BRANCH=${GIT_BRANCH:-master}
+KYLIN_PACKAGE_BRANCH_HADOOP3=${GIT_BRANCH_HADOOP3:-master-hadoop3}
+ASF_USERNAME=${ASF_USERNAME:-xxyu}
+RELEASE_VERSION=${RELEASE_VERSION:-3.1.2}
+NEXT_RELEASE_VERSION=${NEXT_RELEASE_VERSION:-3.1.3}
+RUNNING_CI=${RUNNING_CI:1}
+GIT_REPO_URL=${GIT_REPO_URL:-https://github.com/apache/kylin.git}
 
 export source_release_folder=/root/kylin-release-folder/
 export binary_release_folder=/root/kylin-release-folder/kylin_bin
 export svn_release_folder=/root/dist/dev/kylin
+export ci_package_folder=/root/ci
 
 RELEASE_STAGING_LOCATION="https://dist.apache.org/repos/dist/dev/kylin";
 
 ####################################################
 ####################################################
-####################################################
-####################################################
 #### Prepare source code
 
+mkdir -p $source_release_folder
+mkdir -p $binary_release_folder
+mkdir -p $svn_release_folder
+mkdir -p $ci_package_folder
 
 cd $source_release_folder
-git clone https://github.com/apache/kylin.git
+git clone $GIT_REPO_URL
 cd kylin
 git checkout ${KYLIN_PACKAGE_BRANCH}
 git pull --rebase
-git checkout ${KYLIN_PACKAGE_BRANCH}
 
 cp /root/apache-tomcat-7.0.100.tar.gz $source_release_folder/kylin/build
 
 
-####################################################
-####################################################
-####################################################
-####################################################
-#### Prepare tag & source tarball & upload maven artifact
-
-# Use release-plugin to check license & build source package & build and 
upload maven artifact
-#mvn -DskipTests -DreleaseVersion=${KYLIN_PACKAGE_VERSION} 
-DdevelopmentVersion=${NEXT_RELEASE_VERSION}-SNAPSHOT -Papache-release 
-Darguments="-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests" release:prepare
-#mvn -DskipTests -Papache-release 
-Darguments="-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests" release:perform
-
+if [[ "$RELEASE_ENABLE" == "1" ]]; then
+  echo "Build with maven-release-plugin ..."
+  ## Prepare tag & source tarball & upload maven artifact
 
-####################################################
-####################################################
-####################################################
-####################################################
-####
-
-# Create a directory for this release candidate
-#mkdir ${svn_release_folder}/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}
-#rm -rf target/apache-kylin-*ource-release.zip.asc.sha256
+  # Use release-plugin to check license & build source package & build and 
upload maven artifact
+  #mvn -DskipTests -DreleaseVersion=${KYLIN_PACKAGE_VERSION} 
-DdevelopmentVersion=${NEXT_RELEASE_VERSION}-SNAPSHOT -Papache-release 
-Darguments="-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests" release:prepare
+  #mvn -DskipTests -Papache-release 
-Darguments="-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests" release:perform
 
-# Move source code and signture of source code to release candidate directory
-#cp target/apache-kylin-*source-release.zip* 
${svn_release_folder}/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}
+  # Create a directory for this release candidate
+  #mkdir ${svn_release_folder}/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}
+  #rm -rf target/apache-kylin-*ource-release.zip.asc.sha256
 
-# Go to package directory
-#cd $binary_release_folder
-#git checkout ${KYLIN_PACKAGE_BRANCH}
-#git pull --rebase
+  # Move source code and signture of source code to release candidate directory
+  #cp target/apache-kylin-*source-release.zip* 
${svn_release_folder}/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}
 
-# Checkout to tag, which is created by maven-release-plugin
-# Commit message looks like "[maven-release-plugin] prepare release 
kylin-4.0.0-alpha"
-#git checkout kylin-${RELEASE_VERSION}
+  # Go to package directory
+  #cd $binary_release_folder
+  #git checkout ${KYLIN_PACKAGE_BRANCH}
+  #git pull --rebase
 
+  # Checkout to tag, which is created by maven-release-plugin
+  # Commit message looks like "[maven-release-plugin] prepare release 
kylin-4.0.0-alpha"
+  #git checkout kylin-${RELEASE_VERSION}
+fi
 
 ####################################################
 ####################################################
-####################################################
-####################################################
 #### Build binary
 
-
-# Build first packages
+# Build first package for Hadoop2
 build/script/package.sh
+if [[ "$RUNNING_CI" == "1" ]]; then
+    cp dist/apache-kylin-${RELEASE_VERSION}-bin.tar.gz ${ci_package_folder}
+    cd ${ci_package_folder}
+    tar -zxf dist/apache-kylin-${RELEASE_VERSION}-bin.tar.gz
+    mv apache-kylin-${RELEASE_VERSION}-bin apache-kylin-bin
+    tar -cvzf apache-kylin-bin.tar.gz apache-kylin-bin
+    rm -rf apache-kylin-${RELEASE_VERSION}-bin
+    cd -
+fi
 tar -zxf dist/apache-kylin-${RELEASE_VERSION}-bin.tar.gz
-mv apache-kylin-${RELEASE_VERSION}-bin 
apache-kylin-${RELEASE_VERSION}-bin-hadoop2
-tar -cvzf 
~/dist/dev/kylin/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}/apache-kylin-${RELEASE_VERSION}-bin-hadoop2.tar.gz
 apache-kylin-${RELEASE_VERSION}-bin-hadoop2
-rm -rf apache-kylin-${RELEASE_VERSION}-bin-hadoop2
+mv apache-kylin-${RELEASE_VERSION}-bin 
apache-kylin-${RELEASE_VERSION}-bin-hbase1x
+tar -cvzf 
~/dist/dev/kylin/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}/apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz
 apache-kylin-${RELEASE_VERSION}-bin-hbase1x
+rm -rf apache-kylin-${RELEASE_VERSION}-bin-hbase1x
 
 #build/script/package.sh -P cdh5.7
 #tar -zxf dist/apache-kylin-${RELEASE_VERSION}-bin.tar.gz
@@ -158,26 +151,21 @@ rm -rf apache-kylin-${RELEASE_VERSION}-bin-hadoop2
 #tar -cvzf 
~/dist/dev/kylin/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}/apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz
 apache-kylin-${RELEASE_VERSION}-bin-cdh57
 #rm -rf apache-kylin-${RELEASE_VERSION}-bin-cdh57
 
-
-####################################################
 ####################################################
 ####################################################
-####################################################
-#### Sign binary
+#### Release binary
 
-#cd ~/dist/dev/kylin/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}
-#gpg --armor --output apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz.asc 
--detach-sig apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz
-#shasum -a 256 apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz > 
apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz.sha256
-#
-#gpg --armor --output apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz.asc 
--detach-sig apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz
-#shasum -a 256 apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz > 
apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz.sha256
+if [[ "$RELEASE_ENABLE" == "1" ]]; then
+  ## Sign binary
+  cd ~/dist/dev/kylin/apache-kylin-${KYLIN_PACKAGE_VERSION_RC}
+  gpg --armor --output apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz.asc 
--detach-sig apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz
+  shasum -a 256 apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz > 
apache-kylin-${RELEASE_VERSION}-bin-hbase1x.tar.gz.sha256
 
-####################################################
-####################################################
-####################################################
-####################################################
-#### Upload to svn repository
+  # gpg --armor --output apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz.asc 
--detach-sig apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz
+  # shasum -a 256 apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz > 
apache-kylin-${RELEASE_VERSION}-bin-cdh57.tar.gz.sha256
 
-#cd ..
-#svn add apache-kylin-${KYLIN_PACKAGE_VERSION_RC}
-#svn commit -m 'Checkin release artifacts for '${KYLIN_PACKAGE_VERSION_RC}
\ No newline at end of file
+  ## Upload to svn repository
+  cd ..
+  svn add apache-kylin-${KYLIN_PACKAGE_VERSION_RC}
+  svn commit -m 'Checkin release artifacts for '${KYLIN_PACKAGE_VERSION_RC}
+fi
\ No newline at end of file
diff --git a/docker/dockerfile/cluster/client/run_cli.sh 
b/docker/dockerfile/cluster/client/run_cli.sh
index fcdd71c..ffd1ecd 100644
--- a/docker/dockerfile/cluster/client/run_cli.sh
+++ b/docker/dockerfile/cluster/client/run_cli.sh
@@ -4,12 +4,17 @@
 /opt/entrypoint/hive/entrypoint.sh
 /opt/entrypoint/hbase/entrypoint.sh
 
-sleep 180
+sleep 100
 
 cd $KYLIN_HOME
-sh bin/sample.sh
 sh bin/kylin.sh start
 
+# Only one node execute sample.sh
+if [[ $HOSTNAME =~ "kylin-all" ]]
+then
+  sh bin/sample.sh start
+fi
+
 while :
 do
     sleep 100
diff --git a/docker/setup_cluster.sh b/docker/setup_hadoop_cluster.sh
similarity index 86%
rename from docker/setup_cluster.sh
rename to docker/setup_hadoop_cluster.sh
index b323cd7..dd1db96 100644
--- a/docker/setup_cluster.sh
+++ b/docker/setup_hadoop_cluster.sh
@@ -58,21 +58,18 @@ fi
 
 
 if [ $CLUSTER_MODE == "write" ]; then
-  echo "Restart Kylin cluster & HBase cluster ......"
-  KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docker-compose-kylin-write.yml down
+  echo "Restart HBase cluster ......"
   if [ $ENABLE_HBASE == "yes" ]; then
     KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/write/docker-compose-hbase.yml down
     sleep 2
     KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/write/docker-compose-hbase.yml up -d
   fi
-  KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docker-compose-kylin-write.yml up -d
 fi
 
 if [ $CLUSTER_MODE == "write-read" ]; then
-  echo "Restart Kylin cluster[write-read mode] & Read HBase cluster ......"
+  echo "Restart standalone HBase/Hadoop cluster ......"
   KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/read/docker-compose-zookeeper.yml down
   KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/read/docker-compose-hadoop.yml down
-  KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docker-compose-kylin-write-read.yml down
   sleep 5
   KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/read/docker-compose-zookeeper.yml up -d
   KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/read/docker-compose-hadoop.yml up -d
@@ -82,7 +79,4 @@ if [ $CLUSTER_MODE == "write-read" ]; then
     sleep 2
     KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/read/docker-compose-hbase.yml up -d
   fi
-
-  KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docker-compose-kylin-write-read.yml up -d
-fi
-
+fi
\ No newline at end of file
diff --git a/dev-support/build-release/packaging.sh b/docker/setup_service.sh
similarity index 50%
copy from dev-support/build-release/packaging.sh
copy to docker/setup_service.sh
index 7997095..e476e17 100644
--- a/dev-support/build-release/packaging.sh
+++ b/docker/setup_service.sh
@@ -1,5 +1,4 @@
-#!/usr/bin/env bash
-
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -17,33 +16,21 @@
 # limitations under the License.
 #
 
-### Thank you for 
https://github.com/apache/spark/tree/master/dev/create-release .
-
-# docker build -f Dockerfile -t apachekylin/release-machine:jdk8-slim .
-# docker run --name machine apachekylin/release-machine:jdk8-slim
+SCRIPT_PATH=$(cd `dirname $0`; pwd)
+WS_ROOT=`dirname $SCRIPT_PATH`
 
-cat > $ENVFILE <<EOF
-DRY_RUN=$DRY_RUN
-SKIP_TAG=$SKIP_TAG
-RUNNING_IN_DOCKER=1
-GIT_BRANCH=$GIT_BRANCH
-NEXT_VERSION=$NEXT_VERSION
-RELEASE_VERSION=$RELEASE_VERSION
-RELEASE_TAG=$RELEASE_TAG
-GIT_REF=$GIT_REF
-ASF_USERNAME=$ASF_USERNAME
-GIT_NAME=$GIT_NAME
-GIT_EMAIL=$GIT_EMAIL
-GPG_KEY=$GPG_KEY
-ASF_PASSWORD=$ASF_PASSWORD
-GPG_PASSPHRASE=$GPG_PASSPHRASE
-RELEASE_STEP=$RELEASE_STEP
-USER=$USER
-EOF
+source ${SCRIPT_PATH}/header.sh
 
+if [ $CLUSTER_MODE == "write" ]; then
+  echo "Restart Kylin cluster  ......"
+  KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docker-compose-kylin-write.yml down
+  KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docker-compose-kylin-write.yml up -d
+fi
 
-docker run -ti \
-  --env-file "$ENVFILE" \
-  apachekylin/release-machine:jdk8-slim
+if [ $CLUSTER_MODE == "write-read" ]; then
+  echo "Restart Kylin cluster[write-read mode] ......"
+  KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docker-compose-kylin-write-read.yml down
+  sleep 5
+  KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docker-compose-kylin-write-read.yml up -d
+fi
 
-docker cp machine:/root/kylin/dist/apache-kylin-*-SNAPSHOT-bin.tar.gz .
\ No newline at end of file
diff --git a/docker/stop_cluster.sh b/docker/stop_cluster.sh
index 24ce4e8..2a13057 100644
--- a/docker/stop_cluster.sh
+++ b/docker/stop_cluster.sh
@@ -42,6 +42,6 @@ KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/others/docke
 KYLIN_WS=${WS_ROOT} docker-compose -f 
${SCRIPT_PATH}/docker-compose/write/docker-compose-hadoop.yml down
 
 # clean data
-#rm -rf ${SCRIPT_PATH}/docker-compose/write/data/*
-#rm -rf ${SCRIPT_PATH}/docker-compose/read/data/*
-#rm -rf ${SCRIPT_PATH}/docker-compose/others/data/*
+rm -rf ${SCRIPT_PATH}/docker-compose/write/data/*
+rm -rf ${SCRIPT_PATH}/docker-compose/read/data/*
+rm -rf ${SCRIPT_PATH}/docker-compose/others/data/*

Reply via email to