From cd0c7cb3a68efa26eb9a198250755901f55dde6d Mon Sep 17 00:00:00 2001 From: Matyas Selmeci Date: Fri, 5 Jul 2024 15:35:10 -0500 Subject: [PATCH] Fix failure to detect HAS_SINGULARITY in images based on Condor 23.8+ based on `condor_status -direct` issues Condor 23.8 has a bug where condor_status -direct for startd ads still attempts to contact the collector. Hopefully it will be fixed in 23.10. For those versions, use a hack where we use -pool instead of -direct. --- tests/test_inside_gha.sh | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/test_inside_gha.sh b/tests/test_inside_gha.sh index 645f171..cb0438f 100755 --- a/tests/test_inside_gha.sh +++ b/tests/test_inside_gha.sh @@ -69,6 +69,22 @@ function print_test_header { echo -e "$sep\n$msg\n$sep" } +function condor_version_in_range { + local minimum maximum + minimum=${1:?minimum not provided to condor_version_in_range} + maximum=${2:-99.99.99} + + local condor_version + condor_version=$(run_inside_backfill_container condor_version | awk '/CondorVersion/ {print $2}') + python3 -c ' +import sys +minimum = [int(x) for x in sys.argv[1].split(".")] +maximum = [int(x) for x in sys.argv[2].split(".")] +version = [int(x) for x in sys.argv[3].split(".")] +sys.exit(0 if minimum <= version <= maximum else 1) +' "$minimum" "$maximum" "$condor_version" +} + function wait_for_output { set +x maxtime="$1" @@ -128,11 +144,25 @@ function test_docker_startup { function test_docker_HAS_SINGULARITY { print_test_header "Testing singularity detection inside the backfill container" + # Condor 23.8 has a bug where condor_status -direct for startd ads still + # attempts to contact the collector. Hopefully it will be fixed in 23.10; + # in the meantime, use -pool instead of -direct (which is a hack). + local direct + if condor_version_in_range 23.8.0 23.9.99; then + direct="-pool" + else + direct="-direct" + fi + logdir=$(run_inside_backfill_container find /pilot -type d -name log); ret=$? [[ $ret -eq $ABORT_CODE ]] && { debug_docker_backfill; return $ABORT_CODE; } startd_addr=$(run_inside_backfill_container condor_who -log $logdir -dae | awk '/^Startd/ {print $6}'); ret=$? [[ $ret -eq $ABORT_CODE ]] && { debug_docker_backfill; return $ABORT_CODE; } - has_singularity=$(run_inside_backfill_container condor_status -direct $startd_addr -af HAS_SINGULARITY); ret=$? + echo "startd addr: $startd_addr" + has_singularity=$(run_inside_backfill_container \ + env _CONDOR_SEC_CLIENT_AUTHENTICATION_METHODS=FS \ + condor_status -slot "$direct" "$startd_addr" -af HAS_SINGULARITY \ + ); ret=$? [[ $ret -eq $ABORT_CODE ]] && { debug_docker_backfill; return $ABORT_CODE; } if [[ $has_singularity == 'true' ]]; then return 0