Skip to content

Commit 1375910

Browse files
authored
[None][infra] Delete container before attempting import (#9967)
Signed-off-by: Matt Lefebvre <[email protected]>
1 parent 96d6540 commit 1375910

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

jenkins/L0_Test.groovy

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,27 +1021,31 @@ def runLLMTestlistWithSbatch(pipeline, platform, testList, config=VANILLA_CONFIG
10211021
srunPrologue = """
10221022
export ENROOT_CACHE_PATH='/home/svc_tensorrt/.cache/enroot'
10231023
1024-
retry_command() {
1025-
local cmd=\$1
1026-
local max_attempts=\${2:-3}
1027-
local delay=\${3:-60}
1024+
importContainerWithRetries() {
1025+
local docker_uri=\$1
1026+
local output_path=\$2
1027+
local max_attempts=\${3:-3}
1028+
local delay=\${4:-60}
10281029
local attempt=1
10291030
1030-
until \$cmd
1031+
rm -f "\$output_path"
1032+
1033+
until enroot import -o "\$output_path" -- "docker://\$docker_uri"
10311034
do
10321035
if ((attempt >= max_attempts))
10331036
then
1034-
echo "Command '\$cmd' failed after \$max_attempts attempts"
1037+
echo "enroot import failed after \$max_attempts attempts"
10351038
return 1
10361039
fi
10371040
1038-
echo "Command '\$cmd' failed (attempt \$attempt of \$max_attempts). Retrying in \${delay}s..."
1041+
echo "enroot import failed (attempt \$attempt of \$max_attempts). Retrying in \${delay}s..."
1042+
rm -f "\$output_path"
10391043
sleep \$delay
10401044
((attempt++))
10411045
done
10421046
}
10431047
1044-
retry_command "enroot import -o $enrootImagePath -- docker://$container"
1048+
importContainerWithRetries "$container" "$enrootImagePath"
10451049
""".replaceAll("(?m)^\\s*", "")
10461050
}
10471051

0 commit comments

Comments
 (0)