Skip to content

Commit

Permalink
Added RETIREMENT_HOURS env var to control how long the pilot can reti…
Browse files Browse the repository at this point in the history
…re for
  • Loading branch information
rynge committed May 3, 2023
1 parent 147a00e commit d22be91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 10-setup-htcondor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,19 @@ if is_true "$CONTAINER_PILOT_USE_JOB_HOOK" && [[ ! -e ${prepare_hook} ]]; then
exit 1
fi

cat <<EOF
This pilot will accept new jobs for $ACCEPT_JOBS_FOR_HOURS hours, and
then let running jobs finish for $RETIREMENT_HOURS hours. To control
this behavior, you may set the ACCEPT_JOBS_FOR_HOURS and
RETIREMENT_HOURS environment variables.
EOF

# use GLIDEIN_ToRetire - this is for aligning with GWMS glideins
NOW=$(date +'%s')
GLIDEIN_ToRetire=$(($NOW + $ACCEPT_JOBS_FOR_HOURS * 60 * 60))

# Give the instance 24 hours to finish up before exiting
GLIDEIN_ToDie=$(($GLIDEIN_ToRetire + 24 * 60 * 60))
GLIDEIN_ToDie=$(($GLIDEIN_ToRetire + $RETIREMENT_HOURS * 60 * 60))

# to avoid collisions when ~ is shared, write the config file to /tmp
export PILOT_CONFIG_FILE=$LOCAL_DIR/condor_config.pilot
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ ENV CVMFS_QUOTA_LIMIT=

# How many hours to accept new jobs for
ENV ACCEPT_JOBS_FOR_HOURS=336
# Hours to let running jobs finish during retirement
env RETIREMENT_HOURS=24
# Minutes to wait before shutting down due to lack of jobs
ENV ACCEPT_IDLE_MINUTES=30

Expand Down

0 comments on commit d22be91

Please sign in to comment.