Skip to content

Commit

Permalink
Small fixes in the docker files
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
cmickeyb committed Jan 12, 2024
1 parent 01dd1a5 commit 23acb88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions docker/pdo_ccf_base.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
12 changes: 7 additions & 5 deletions docker/tools/start_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -73,18 +74,19 @@ 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
# -----------------------------------------------------------------
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
Expand Down

0 comments on commit 23acb88

Please sign in to comment.