Skip to content

Commit afcf740

Browse files
authored
Enable test specified docker image in grinder (#4562)
- for grinder portable restore test, only pull the specified docker image - for non-grinder pipeline, pull all available platfrom checkpoint images Signed-off-by: LongyuZhang <[email protected]>
1 parent 8843703 commit afcf740

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

external/external.sh

+16-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test=derby
2727
testtarget=""
2828
platform="linux_x86-64"
2929
portable="false"
30-
job_name=$JOB_NAME
30+
docker_image_source_job_name=""
3131
build_number=$BUILD_NUMBER
3232
node_name=""
3333
node_labels=""
@@ -172,7 +172,7 @@ parseCommandLineArgs() {
172172
docker_registry_dir="$1"; shift;
173173
docker_registry_dir=$(echo "$docker_registry_dir" | tr '[:upper:]' '[:lower:]') # docker registry link must be lowercase
174174
IFS=':' read -r -a dir_array <<< "$docker_registry_dir"
175-
job_name=${dir_array[0]}
175+
docker_image_source_job_name=${dir_array[0]}
176176
build_number=${dir_array[1]};;
177177

178178
"--criu_default_image_job_name" )
@@ -291,7 +291,7 @@ if [ $command_type == "run" ]; then
291291
echo "Private Docker Registry login starts:"
292292
echo $DOCKER_REGISTRY_CREDENTIALS_PSW | $container_login --username=$DOCKER_REGISTRY_CREDENTIALS_USR --password-stdin $docker_registry_url
293293

294-
restore_ready_checkpoint_image_folder="${docker_registry_url}/${job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_current_os}-${node_label_micro_architecture}"
294+
restore_ready_checkpoint_image_folder="${docker_registry_url}/${docker_image_source_job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_current_os}-${node_label_micro_architecture}"
295295
tagged_restore_ready_checkpoint_image_num="${restore_ready_checkpoint_image_folder}:${build_number}"
296296

297297
# Push a docker image with build_num for records
@@ -329,12 +329,17 @@ if [ $command_type == "load" ]; then
329329

330330
restore_docker_image_name_list=()
331331

332-
echo "Testing images from nightly builds"
333-
image_os_micro_architecture_list=($criu_combo_os_microarch_list)
334-
for image_os_micro_architecture in ${image_os_micro_architecture_list[@]}
335-
do
336-
restore_docker_image_name_list+=("${docker_registry_url}/$job_name/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${image_os_micro_architecture}:${build_number}")
337-
done
332+
if [[ $JOB_NAME == "Grinder" ]]; then
333+
echo "Testing image from docker_registry_dir"
334+
restore_docker_image_name_list+=("${docker_registry_url}/$docker_image_source_job_name:${build_number}")
335+
else
336+
echo "Testing images from nightly builds"
337+
image_os_micro_architecture_list=($criu_combo_os_microarch_list)
338+
for image_os_micro_architecture in ${image_os_micro_architecture_list[@]}
339+
do
340+
restore_docker_image_name_list+=("${docker_registry_url}/$docker_image_source_job_name/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${image_os_micro_architecture}:${build_number}")
341+
done
342+
fi
338343

339344
echo "The host machine OS is ${node_label_current_os}, and micro-architecture is ${node_label_micro_architecture}"
340345
for restore_docker_image_name in ${restore_docker_image_name_list[@]}
@@ -376,5 +381,6 @@ if [ $command_type == "clean" ]; then
376381
fi
377382
$container_rm -f $test-test; $container_rmi -f adoptopenjdk-$test-test:${JDK_VERSION}-$package-$docker_os-${JDK_IMPL}-$build_type
378383
$container_rm -f restore-test
379-
$container_rmi -f ${docker_registry_url}/${job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_current_os}-${node_label_micro_architecture}:${build_number}
384+
$container_rmi -f ${docker_registry_url}/${docker_image_source_job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_current_os}-${node_label_micro_architecture}:${build_number}
385+
$container_rmi -f ${docker_registry_url}/${docker_image_source_job_name}:${build_number}
380386
fi

0 commit comments

Comments
 (0)