This is an automated email from the ASF dual-hosted git repository. tarmstrong pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push: new dbe9fef IMPALA-8186: script to configure docker network dbe9fef is described below commit dbe9fefa05ce9738865349e9130004457ff31c62 Author: Tim Armstrong <tarmstr...@cloudera.com> AuthorDate: Mon Feb 11 16:33:05 2019 -0800 IMPALA-8186: script to configure docker network This automates the network setup that I did manually in http://gerrit.cloudera.org:8080/12189 After running the script it should be possible to run "./buildall.sh -format -testdata" to load test data with the right hostnames, then "start-impala-cluster.py --docker_network=network-name" to run a dockerised minicluster. Change-Id: Icb4854aa951bcad7087a9653845b22ffd862057d Reviewed-on: http://gerrit.cloudera.org:8080/12452 Reviewed-by: Philip Zeyliger <phi...@cloudera.com> Tested-by: Tim Armstrong <tarmstr...@cloudera.com> --- docker/configure_test_network.sh | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docker/configure_test_network.sh b/docker/configure_test_network.sh new file mode 100755 index 0000000..df5567b --- /dev/null +++ b/docker/configure_test_network.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# Sets up a Docker bridge network with the name provided by the first argument and +# appends the configuration required to use it in a dockerised minicluster to +# bin/impala-config-local.sh. Note that impala-config.sh needs to be re-sourced, +# cluster configurations need to be regenerated, all minicluster processes restarted, +# and data reloaded for the change to be effective and your cluster to be functional. + +set -euo pipefail + +usage() { + echo "configure_test_network.sh <docker network name>" +} + +if [[ $# != 1 ]]; then + usage + exit 1 +fi + +NETWORK_NAME=$1 + +# Remove existing network if present. +echo "Removing existing network '$NETWORK_NAME'" +docker network rm "$NETWORK_NAME" || true + +echo "Create network '$NETWORK_NAME'" +docker network create -d bridge $NETWORK_NAME +GATEWAY=$(docker network inspect "$NETWORK_NAME" -f '{{(index .IPAM.Config 0).Gateway}}') +echo "Gateway is '${GATEWAY}'" + +echo "Updating impala-config-local.sh" +echo "# Configuration to use docker network ${NETWORK_NAME}" \ + >> "$IMPALA_HOME"/bin/impala-config-local.sh +echo "export INTERNAL_LISTEN_HOST=${GATEWAY}" >> "$IMPALA_HOME"/bin/impala-config-local.sh +echo "export DEFAULT_FS=hdfs://\${INTERNAL_LISTEN_HOST}:20500" \ + >> "$IMPALA_HOME"/bin/impala-config-local.sh