This is an automated email from the ASF dual-hosted git repository.
sekikn 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 f0025798 BIGTOP-3693. Support Docker Compose V2 (#979)
f0025798 is described below
commit f00257982a1cfde622eed9e23d76fdc424bcd9d3
Author: Peng Lee <[email protected]>
AuthorDate: Fri Sep 30 13:48:03 2022 +0800
BIGTOP-3693. Support Docker Compose V2 (#979)
---
provisioner/docker/docker-hadoop.sh | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/provisioner/docker/docker-hadoop.sh
b/provisioner/docker/docker-hadoop.sh
index 66aa4818..abbf2574 100755
--- a/provisioner/docker/docker-hadoop.sh
+++ b/provisioner/docker/docker-hadoop.sh
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+set -e
+
usage() {
echo "usage: $PROG [-C file] [-F file] args"
echo " -C file - Use alternate
file for config.yaml"
@@ -22,6 +24,7 @@ usage() {
echo " commands:"
echo " -c NUM_INSTANCES, --create NUM_INSTANCES - Create a Docker
based Bigtop Hadoop cluster"
echo " -d, --destroy - Destroy the
cluster"
+ echo " -dcp, --docker-compose-plugin - Execute docker
compose plugin command 'docker compose'"
echo " -e, --exec INSTANCE_NO|INSTANCE_NAME - Execute command
on a specific instance. Instance can be specified by name or number"
echo " For example:
$PROG --exec 1 bash"
echo "
$PROG --exec docker_bigtop_1 bash"
@@ -216,6 +219,7 @@ destroy() {
if [ -n "$PROVISION_ID" ]; then
$DOCKER_COMPOSE_CMD -p $PROVISION_ID stop
$DOCKER_COMPOSE_CMD -p $PROVISION_ID rm -f
+
fi
if [ -n "$NETWORK_ID" ]; then
@@ -298,6 +302,10 @@ get_nodes() {
fi
}
+change_docker_compose_cmd() {
+ DOCKER_COMPOSE_CMD="docker compose"
+}
+
PROG=`basename $0`
if [ $# -eq 0 ]; then
@@ -307,6 +315,13 @@ fi
yamlconf="config.yaml"
DOCKER_COMPOSE_CMD="docker-compose"
+for arg in $@
+do
+ if [ "$arg" == "-dcp" ] || [ "$arg" == "--docker-compose-plugin" ]; then
+ change_docker_compose_cmd
+ fi
+done
+
BIGTOP_PUPPET_DIR=../../bigtop-deploy/puppet
if [ -e .provision_id ]; then
PROVISION_ID=`cat .provision_id`
@@ -340,6 +355,8 @@ while [ $# -gt 0 ]; do
-d|--destroy)
destroy
shift;;
+ -dcp|--docker-compose-plugin)
+ shift;;
-e|--exec)
if [ $# -lt 3 ]; then
echo "exec command takes 2 parameters: 1) instance no 2) command to
be executed" 1>&2