From 23acb8899b0b059615fdb69e6401be477c6c638c Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 11 Jan 2024 11:53:49 -0800 Subject: [PATCH] Small fixes in the docker files * add lsof to the packages to install for ccf; the test for duplicate services was failing (non-fatally); this should fix it * add explicit setting of noproxy in start_services to mirror handling in other tools scripts. this fixes a problem when running persistent test services on localhost. Signed-off-by: Mic Bowman --- docker/pdo_ccf_base.dockerfile | 1 + docker/tools/start_services.sh | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docker/pdo_ccf_base.dockerfile b/docker/pdo_ccf_base.dockerfile index 2ad6469b..5eabdc31 100644 --- a/docker/pdo_ccf_base.dockerfile +++ b/docker/pdo_ccf_base.dockerfile @@ -32,6 +32,7 @@ ARG ADD_APT_PKGS= ENV DEBIAN_FRONTEND "noninteractive" RUN apt-get update \ && apt-get install -y -q \ + lsof \ python \ python3-dev \ python3-venv \ diff --git a/docker/tools/start_services.sh b/docker/tools/start_services.sh index 0c333d8c..e815fd68 100755 --- a/docker/tools/start_services.sh +++ b/docker/tools/start_services.sh @@ -26,6 +26,7 @@ SCRIPT_NAME=$(basename ${BASH_SOURCE[-1]} ) # ----------------------------------------------------------------- # Process command line arguments # ----------------------------------------------------------------- +F_COUNT=5 F_LOGLEVEL= F_MODE=build F_REGISTER=no @@ -36,8 +37,8 @@ F_LEDGER_URL= F_USAGE='-c|--count -i|--interface [hostname] -1|--ledger [url] " F_USAGE+="--loglevel [debug|info|warn] -m|--mode [build|copy|skip] -r|--register' -SHORT_OPTS='i:l:m:r' -LONG_OPTS='interface:,ledger:,loglevel:,mode:,register' +SHORT_OPTS='c:i:l:m:r' +LONG_OPTS='count:,interface:,ledger:,loglevel:,mode:,register' TEMP=$(getopt -o ${SHORT_OPTS} --long ${LONG_OPTS} -n "${SCRIPT_NAME}" -- "$@") if [ $? != 0 ] ; then echo "Usage: ${SCRIPT_NAME} ${F_USAGE}" >&2 ; exit 1 ; fi @@ -73,10 +74,11 @@ export PDO_LEDGER_ADDRESS=$(force_to_ip ${PDO_HOSTNAME}) export PDO_LEDGER_URL=${PDO_LEDGER_URL:-http://${PDO_LEDGER_ADDRESS}:6600} if [ ! -z "${F_LEDGER_URL}" ] ; then export PDO_LEDGER_URL=${F_LEDGER_URL} + export PDO_LEDGER_ADDRESS=$( echo $PDO_LEDGER_URL | awk -F[/:] '{print $4}' ) fi -export no_proxy=$PDO_HOSTNAME,$no_proxy -export NO_PROXY=$PDO_HOSTNAME,$NO_PROXY +export no_proxy=$PDO_HOSTNAME,$PDO_LEDGER_ADDRESS,$no_proxy +export NO_PROXY=$PDO_HOSTNAME,$PDO_LEDGER_ADDRESS,$NO_PROXY # ----------------------------------------------------------------- # Handle the configuration of the services @@ -84,7 +86,7 @@ export NO_PROXY=$PDO_HOSTNAME,$NO_PROXY if [ "${F_MODE,,}" == "build" ]; then yell configure services for host $PDO_HOSTNAME and ledger $PDO_LEDGER_URL try ${PDO_INSTALL_ROOT}/bin/pdo-configure-services -t ${PDO_SOURCE_ROOT}/build/template -o ${PDO_HOME}\ - --count 5 5 5 + --count ${F_COUNT} ${F_COUNT} ${F_COUNT} elif [ "${F_MODE,,}" == "copy" ]; then yell copy the configuration from xfer/services/etc and xfer/services/keys try mkdir -p ${PDO_HOME}/etc ${PDO_HOME}/keys