bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From evan...@apache.org
Subject [bigtop] branch master updated: BIGTOP-3172. [Provisioner] Support to specify components and smoke-tests when launching Docker Provisioner (#479)
Date Tue, 26 Feb 2019 10:55:46 GMT
This is an automated email from the ASF dual-hosted git repository.

evansye pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ac2baf  BIGTOP-3172. [Provisioner] Support to specify components and smoke-tests
when launching Docker Provisioner (#479)
2ac2baf is described below

commit 2ac2baf2301a37c44593b2729a8627222851eecb
Author: Evans Ye <evansye@apache.org>
AuthorDate: Tue Feb 26 18:55:42 2019 +0800

    BIGTOP-3172. [Provisioner] Support to specify components and smoke-tests when launching
Docker Provisioner (#479)
---
 build.gradle                        | 13 ++++++++++++-
 packages.gradle                     |  3 +--
 provisioner/docker/docker-hadoop.sh | 37 +++++++++++++++++++++++++++++++------
 3 files changed, 44 insertions(+), 9 deletions(-)

diff --git a/build.gradle b/build.gradle
index 3674750..facdcd5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -265,9 +265,20 @@ task "docker-provisioner"(type:Exec,
       '-C', _config,
       '--create', _num_instances,
   ]
-  if ( project.hasProperty("run_smoke_tests") && run_smoke_tests ) {
+  if ( project.hasProperty("stack") ) {
+    command.add('--stack')
+    command.add("${stack}")
+  }
+  if ( project.hasProperty("run_smoke_tests") ) {
     command.add("--smoke-tests")
   }
+  if ( project.hasProperty("smoke_tests") ) {
+    command.add('--smoke-tests')
+    command.add("${smoke_tests}")
+  }
+  if ( project.hasProperty("nexus") ) {
+    command.add('--nexus')
+  }
   workingDir 'provisioner/docker'
   commandLine command
 }
diff --git a/packages.gradle b/packages.gradle
index 9ff524b..b6f5985 100644
--- a/packages.gradle
+++ b/packages.gradle
@@ -630,7 +630,6 @@ def genTasks = { target ->
           group: PACKAGES_GROUP) doLast {
     def _prefix = project.hasProperty("prefix") ? prefix : "trunk"
     def _OS = project.hasProperty("OS") ? OS : "centos-7"
-    def _nexus = project.hasProperty("nexus") ? nexus : false
     def _target_pkg = "$target-pkg"
     def additionalConfigKeys = ['git_repo', 'git_ref', 'git_dir', 'git_commit_hash', 'base_version']
     additionalConfigKeys.each { key ->
@@ -645,7 +644,7 @@ def genTasks = { target ->
             '--os', _OS,
             '--target', _target_pkg,
     ]
-    if (_nexus) {
+    if ( project.hasProperty("nexus") ) {
       command.add('--nexus')
     }
 
diff --git a/provisioner/docker/docker-hadoop.sh b/provisioner/docker/docker-hadoop.sh
index 02e8697..2bc6fd9 100755
--- a/provisioner/docker/docker-hadoop.sh
+++ b/provisioner/docker/docker-hadoop.sh
@@ -70,7 +70,9 @@ create() {
 
     # Fetch configurations form specificed yaml config file
     repo=$(get-yaml-config repo)
-    components="[`echo $(get-yaml-config components) | sed 's/ /, /g'`]"
+    if [ -z ${components+x} ]; then
+        components="[`echo $(get-yaml-config components) | sed 's/ /, /g'`]"
+    fi
     distro=$(get-yaml-config distro)
     enable_local_repo=$(get-yaml-config enable_local_repo)
     generate-config "$hadoop_head_node" "$repo" "$components"
@@ -139,7 +141,9 @@ provision() {
 
 smoke-tests() {
     hadoop_head_node=${NODES:0:12}
-    smoke_test_components="`echo $(get-yaml-config smoke_test_components) | sed 's/ /,/g'`"
+    if [ -z ${smoke_test_components+x} ]; then
+        smoke_test_components="`echo $(get-yaml-config smoke_test_components) | sed 's/ /,/g'`"
+    fi
     docker exec $hadoop_head_node bash -c "bash -x /bigtop-home/provisioner/utils/smoke-tests.sh
$smoke_test_components"
 }
 
@@ -240,14 +244,15 @@ while [ $# -gt 0 ]; do
           usage
         fi
         env-check
-        create $2
+        READY_TO_LAUNCH=true
+        NUM_INSTANCES=$2
         shift 2;;
     -C|--conf)
         if [ $# -lt 2 ]; then
           echo "Alternative config file for config.yaml" 1>&2
           usage
         fi
-	yamlconf=$2
+	    yamlconf=$2
         shift 2;;
     -d|--destroy)
         destroy
@@ -280,12 +285,25 @@ while [ $# -gt 0 ]; do
             shift 2
         fi
         ;;
+    -k|--stack)
+        if [ $# -lt 2 ]; then
+          log "No stack specified"
+          usage
+        fi
+        components="[$2]"
+        shift 2;;
     -p|--provision)
         provision
         shift;;
     -s|--smoke-tests)
-        smoke-tests
-        shift;;
+        if [ $# -lt 2 ] || [[ $2 == -* ]]; then
+            shift
+        else
+            smoke_test_components=$2
+            shift 2
+        fi
+        READY_TO_TEST=true
+        ;;
     -h|--help)
         usage
         shift;;
@@ -294,3 +312,10 @@ while [ $# -gt 0 ]; do
         usage;;
     esac
 done
+
+if [ "$READY_TO_LAUNCH" = true ]; then
+    create $NUM_INSTANCES
+fi
+if [ "$READY_TO_TEST" = true ]; then
+    smoke-tests
+fi


Mime
View raw message