Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions 10-setup-htcondor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,17 @@ do
done <$condor_vars_file
set -x

# osg-flock's additional-htcondor-config only adds directories from
# GLIDEIN_SINGULARITY_BINDPATH to SINGULARITY_BIND_EXPR. Its file check drops
# /etc/passwd, which the native HTCondor container path also needs when
# cvmfsexec created a nested user namespace. The GlideinWMS wrapper reads
# GLIDEIN_SINGULARITY_BINDPATH directly and already receives this bind.
if [[ $CVMFSEXEC_PASSWD_BIND == 1 ]]; then
singularity_bind_expr=${SINGULARITY_BIND_EXPR#\"}
singularity_bind_expr=${singularity_bind_expr%\"}
echo "SINGULARITY_BIND_EXPR = \"${singularity_bind_expr},/etc/passwd\"" >> "$PILOT_CONFIG_FILE"
fi

if [[ $EXTRA_JOB_ENV ]]; then
job_env="$job_env $EXTRA_JOB_ENV"
fi
Expand Down
1 change: 1 addition & 0 deletions sbin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ CVMFSEXEC_REPOS=$(tr -d '"'"'" <<<$CVMFSEXEC_REPOS) # delete single and double
# lookup. This replaces the job image's own /etc/passwd, so it only runs
# when cvmfsexec is actually creating that nested namespace.
export SINGULARITY_BIND_EXTRA="${SINGULARITY_BIND_EXTRA:+$SINGULARITY_BIND_EXTRA,}/etc/passwd"
export CVMFSEXEC_PASSWD_BIND=1

cd "$cvmfsexec_root" || \
fail "Couldn't enter $cvmfsexec_root"
Expand Down
24 changes: 22 additions & 2 deletions tests/test_inside_gha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# shellcheck disable=SC2086

APPTAINER_BIN=/usr/bin/apptainer
OSP_TOKEN_PATH=/tmp/token
OSP_TOKEN_PATH=${OSP_TOKEN_PATH:-/tmp/token}
CONDOR_LOGDIR=/pilot/log
COMMON_APPTAINER_EXEC_ARGS="-B /cvmfs -B /dev/fuse -c -i"
COMMON_DOCKER_RUN_ARGS="--user osg
Expand Down Expand Up @@ -102,7 +102,8 @@ function docker_exit_with_cleanup {

function print_test_header {
msg=$*
sep=$(python -c "print ('=' * ${#msg})")
printf -v sep '%*s' "${msg}" ''
sep=${sep// /=}
echo -e "$sep\n$msg\n$sep"
}

Expand Down Expand Up @@ -192,6 +193,24 @@ function test_docker_HAS_SINGULARITY {
return 1
}

function test_docker_passwd_bind {
[[ $CVMFS_INSTALL == cvmfsexec ]] || return 0
print_test_header "Testing HTCondor passwd bind under cvmfsexec"

local binds
binds=$(run_inside_backfill_container /bin/bash -c '
PILOT_CONFIG_FILE=$(find /pilot -maxdepth 2 -name condor_config.pilot -print -quit)
export PILOT_CONFIG_FILE
condor_config_val SINGULARITY_BIND_EXPR
') || return $?
binds=${binds#\"}
binds=${binds%\"}
if [[ ,$binds, != *,/etc/passwd,* ]]; then
echo "HTCondor SINGULARITY_BIND_EXPR omits /etc/passwd: $binds" >&2
return 1
fi
}

function test_singularity_startup {
print_test_header "Testing container startup"

Expand Down Expand Up @@ -402,6 +421,7 @@ elif [[ $TESTTYPE == pilot ]]; then
start_docker_backfill "${DOCKER_EXTRA_ARGS[@]}" || docker_exit_with_cleanup $?
test_docker_startup || docker_exit_with_cleanup $?
test_docker_HAS_SINGULARITY || docker_exit_with_cleanup $?
test_docker_passwd_bind || docker_exit_with_cleanup $?
docker stop backfill
docker_exit_with_cleanup 0
;;
Expand Down
Loading