You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ew...@apache.org on 2017/01/03 22:47:25 UTC
kafka git commit: KAFKA-4261: Provide debug option in vagrant-up.sh
Repository: kafka
Updated Branches:
refs/heads/trunk b565dd7eb -> ce1cb329d
KAFKA-4261: Provide debug option in vagrant-up.sh
Author: fpj <fp...@apache.org>
Reviewers: Ewen Cheslack-Postava <ew...@confluent.io>
Closes #1981 from fpj/vagrant-debug-option
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/ce1cb329
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/ce1cb329
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/ce1cb329
Branch: refs/heads/trunk
Commit: ce1cb329d5aa788968e47d7dfe307128f2ddc2ff
Parents: b565dd7
Author: fpj <fp...@apache.org>
Authored: Tue Jan 3 14:49:33 2017 -0800
Committer: Ewen Cheslack-Postava <me...@ewencp.org>
Committed: Tue Jan 3 14:49:33 2017 -0800
----------------------------------------------------------------------
vagrant/vagrant-up.sh | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/ce1cb329/vagrant/vagrant-up.sh
----------------------------------------------------------------------
diff --git a/vagrant/vagrant-up.sh b/vagrant/vagrant-up.sh
index 1d8a648..b01c10d 100755
--- a/vagrant/vagrant-up.sh
+++ b/vagrant/vagrant-up.sh
@@ -26,6 +26,7 @@ readonly ARGS="$@"
AWS=false
PARALLEL=true
MAX_PARALLEL=5
+DEBUG=false
readonly USAGE="Usage: $PROG_NAME [-h | --help] [--aws [--no-parallel] [--max-parallel MAX]]"
readonly HELP="$(cat <<EOF
@@ -35,7 +36,7 @@ Tool to bring up a vagrant cluster on local machine or aws.
--aws Use if you are running in aws
--no-parallel Bring up machines not in parallel. Only applicable on aws
--max-parallel MAX Maximum number of machines to bring up in parallel. Note: only applicable on test worker machines on aws. default: $MAX_PARALLEL
-
+ --debug Enable debug information for vagrant
Approximately speaking, this wrapper script essentially wraps 2 commands:
vagrant up
vagrant hostmanager
@@ -71,6 +72,9 @@ while [[ $# > 0 ]]; do
MAX_PARALLEL="$2"
shift
;;
+ --debug)
+ DEBUG=true
+ ;;
*)
# unknown option
echo "Unknown option $1"
@@ -200,7 +204,14 @@ function bring_up_aws {
local parallel="$1"
local max_parallel="$2"
local machines="$(read_vagrant_machines)"
-
+ case "$3" in
+ true)
+ local debug="--debug"
+ ;;
+ false)
+ local debug=""
+ ;;
+ esac
zk_broker_machines=$(zk_broker "$machines")
worker_machines=$(worker "$machines")
@@ -208,18 +219,18 @@ function bring_up_aws {
if [[ ! -z "$zk_broker_machines" ]]; then
# We still have to bring up zookeeper/broker nodes serially
echo "Bringing up zookeeper/broker machines serially"
- vagrant up --provider=aws --no-parallel --no-provision $zk_broker_machines
+ vagrant up --provider=aws --no-parallel --no-provision $zk_broker_machines $debug
vagrant hostmanager
vagrant provision
fi
if [[ ! -z "$worker_machines" ]]; then
echo "Bringing up test worker machines in parallel"
- vagrant_batch_command "vagrant up --provider=aws" "$worker_machines" "$max_parallel"
+ vagrant_batch_command "vagrant up $debug --provider=aws" "$worker_machines" "$max_parallel"
vagrant hostmanager
fi
else
- vagrant up --provider=aws --no-parallel --no-provision
+ vagrant up --provider=aws --no-parallel --no-provision $debug
vagrant hostmanager
vagrant provision
fi
@@ -227,7 +238,7 @@ function bring_up_aws {
function main {
if [[ "$AWS" == "true" ]]; then
- bring_up_aws "$PARALLEL" "$MAX_PARALLEL"
+ bring_up_aws "$PARALLEL" "$MAX_PARALLEL" "$DEBUG"
else
bring_up_local
fi