Skip to content

Commit

Permalink
Revert "Revert "Add --nanny-port + --nanny-address-contact in image c…
Browse files Browse the repository at this point in the history
…onf scripts""

This reverts commit ee6d7ee.
  • Loading branch information
oshadura committed Feb 17, 2023
1 parent f960205 commit 78de622
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docker/k8s-worker/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket

; Adding (ENV_WORKER_ID) should fixes https://github.com/CoffeaTeam/jhub/issues/37
[program:dask-worker]
command=/bin/bash -c "dask-worker tls://%(ENV_HOST_IP)s:8786 --nthreads 2 --tls-ca-file %(ENV_CERT_DIR)s/..data/ca.pem --tls-cert %(ENV_CERT_DIR)s/..data/hostcert.pem --tls-key %(ENV_CERT_DIR)s/..data/hostcert.pem --nanny --listen-address tls://0.0.0.0:8788 --name kubernetes-worker-%(ENV_WORKER_ID)s --contact-address tls://%(ENV_WORKER_IP)s:8788"
command=/bin/bash -c "dask-worker tls://%(ENV_HOST_IP)s:8786 --nthreads 2 --tls-ca-file %(ENV_CERT_DIR)s/..data/ca.pem --tls-cert %(ENV_CERT_DIR)s/..data/hostcert.pem --tls-key %(ENV_CERT_DIR)s/..data/hostcert.pem --nanny --nanny-port 8001 --nanny-contact-address tls://%(ENV_HOST_IP):8001 --listen-address tls://0.0.0.0:8788 --name kubernetes-worker-%(ENV_WORKER_ID)s --contact-address tls://%(ENV_WORKER_IP)s:8788"
startretries=100
autostart=true
autorestart=true
Expand Down
23 changes: 13 additions & 10 deletions docker/prepare-env/prepare-env-cc-analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ ! -v COFFEA_CASA_SIDECAR ]]; then
else
# From chtc/dask-chtc: wait for the job ad to be updated with <service>_HostPort
# This happens during the first update, usually a few seconds after the job starts
echo "Waiting for dask_HostPort information..."
echo "Waiting for dask_HostPort and nanny_HostPort information..."
# Check if we are not in GH CI environment (otherwise image check will stuck forever)
# docs: Always set to true when GitHub Actions is running the workflow.
# You can use this variable to differentiate when tests are being run locally or by GitHub Actions.
Expand All @@ -47,14 +47,14 @@ if [[ ! -v COFFEA_CASA_SIDECAR ]]; then
echo "Got dask_HostPort, proceeding..."
echo

#while true; do
# if grep nanny_HostPort "$_CONDOR_JOB_AD"; then
# break
# fi
# sleep 1
#done
#echo "Got nanny_HostPort, proceeding..."
#echo
while true; do
if grep nanny_HostPort "$_CONDOR_JOB_AD"; then
break
fi
sleep 1
done
echo "Got nanny_HostPort, proceeding..."
echo

if [ -z "$_CONDOR_JOB_IWD" ]; then
echo "Error: something is wrong, $_CONDOR_JOB_IWD (path to the initial working directory the job was born with) was not defined!"
Expand Down Expand Up @@ -113,6 +113,8 @@ if [[ ! -v COFFEA_CASA_SIDECAR ]]; then
# memory requested for worker, hostname of scheduler), parcing HTCondor Job AD file`
# Nanny container port will be used later...
PORT=`cat $_CONDOR_JOB_AD | grep dask_HostPort | tr -d '"' | awk '{print $NF;}'`
NANNYPORT=`cat $_CONDOR_JOB_AD | grep nanny_HostPort | tr -d '"' | awk '{print $NF;}'`
NANNYCONTAINER_PORT=`cat $_CONDOR_JOB_AD | grep nanny_ContainerPort | tr -d '"' | awk '{print $NF;}'`
CONTAINER_PORT=`cat $_CONDOR_JOB_AD | grep dask_ContainerPort | tr -d '"' | awk '{print $NF;}'`
#FIXME:
#NANNY_PORT=`cat $_CONDOR_JOB_AD | grep nanny_HostPort | tr -d '"' | awk '{print $NF;}'`
Expand All @@ -132,7 +134,6 @@ if [[ ! -v COFFEA_CASA_SIDECAR ]]; then

# Dask worker command execurted in HTCondor pool.
# Communication protocol: in Coffea-casa we use only secured communications (over TLS)
#FIXME: add later --nanny-port $NANNYCONTAINER_PORT \
HTCONDOR_COMAND="/opt/conda/bin/python -m distributed.cli.dask_worker $EXTERNALIP_PORT \
--name $NAME \
--tls-ca-file $PATH_CA_FILE \
Expand All @@ -141,10 +142,12 @@ if [[ ! -v COFFEA_CASA_SIDECAR ]]; then
--nthreads $CPUS \
--memory-limit $MEMORY_MB_FORMATTED \
--nanny \
--nanny-port $NANNYCONTAINER_PORT \
--death-timeout 60 \
--protocol tls \
--lifetime 7200 \
--listen-address tls://0.0.0.0:$CONTAINER_PORT \
--nanny-contact-address tls://$HOST:$NANNYPORT \
--contact-address tls://$HOST:$PORT"
# Debug print
echo $HTCONDOR_COMAND 1>&2
Expand Down

0 comments on commit 78de622

Please sign in to comment.