Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support various OS label in CRIU portable test #4406

Merged
merged 1 commit into from
Mar 9, 2023
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
2 changes: 1 addition & 1 deletion external/criu-portable-restore/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<include>../criuSettings.mk</include>
<test>
<testCaseName>criu-portable-restore_test</testCaseName>
<command> $(TEST_ROOT)$(D)external$(D)external.sh --load --tag "${DOCKERIMAGE_TAG}" --dir criu-portable-restore --testtarget _cmdLineTester_criu_keepCheckpoint --portable "true" --platform "${PLATFORM}" --node_name "${NODE_NAME}" --node_labels "${NODE_LABELS}" --docker_registry_required "true" --docker_registry_url $(DOCKER_REGISTRY_URL) --docker_registry_dir "$(DOCKER_REGISTRY_DIR)" --criu_default_image_job_name "$(CRIU_DEFAULT_IMAGE_JOB_NAME)" --criu_micro_architecture_list "$(CRIU_MICRO_ARCHITECTURE_LIST)" --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS) --tmpfs /run"; \
<command> $(TEST_ROOT)$(D)external$(D)external.sh --load --tag "${DOCKERIMAGE_TAG}" --dir criu-portable-restore --testtarget _cmdLineTester_criu_keepCheckpoint --portable "true" --platform "${PLATFORM}" --node_name "${NODE_NAME}" --node_labels "${NODE_LABELS}" --docker_registry_required "true" --docker_registry_url $(DOCKER_REGISTRY_URL) --docker_registry_dir "$(DOCKER_REGISTRY_DIR)" --criu_default_image_job_name "$(CRIU_DEFAULT_IMAGE_JOB_NAME)" --criu_combo_os_microarch_list "$(CRIU_XLINUX_COMBO_LIST)" --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS) --tmpfs /run"; \
$(TEST_STATUS); \
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir criu-portable-restore --platform "${PLATFORM}" --node_labels "${NODE_LABELS}" --docker_registry_url $(DOCKER_REGISTRY_URL) --docker_registry_dir "$(DOCKER_REGISTRY_DIR)" --criu_default_image_job_name "$(CRIU_DEFAULT_IMAGE_JOB_NAME)"
</command>
Expand Down
2 changes: 1 addition & 1 deletion external/criu-ubi-portable-restore/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<include>../criuSettings.mk</include>
<test>
<testCaseName>criu-ubi-portable-restore_test</testCaseName>
<command> $(TEST_ROOT)$(D)external$(D)external.sh --load --tag "${DOCKERIMAGE_TAG}" --dir criu-ubi-portable-restore --testtarget _cmdLineTester_criu_keepCheckpoint --portable "true" --platform "${PLATFORM}" --node_name "${NODE_NAME}" --node_labels "${NODE_LABELS}" --docker_registry_required "true" --docker_registry_url $(DOCKER_REGISTRY_URL) --docker_registry_dir "$(DOCKER_REGISTRY_DIR)" --criu_default_image_job_name "$(CRIU_DEFAULT_IMAGE_JOB_NAME)" --criu_micro_architecture_list "$(CRIU_MICRO_ARCHITECTURE_LIST)" --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS) --tmpfs /run"; \
<command> $(TEST_ROOT)$(D)external$(D)external.sh --load --tag "${DOCKERIMAGE_TAG}" --dir criu-ubi-portable-restore --testtarget _cmdLineTester_criu_keepCheckpoint --portable "true" --platform "${PLATFORM}" --node_name "${NODE_NAME}" --node_labels "${NODE_LABELS}" --docker_registry_required "true" --docker_registry_url $(DOCKER_REGISTRY_URL) --docker_registry_dir "$(DOCKER_REGISTRY_DIR)" --criu_default_image_job_name "$(CRIU_DEFAULT_IMAGE_JOB_NAME)" --criu_combo_os_microarch_list "$(CRIU_XLINUX_COMBO_LIST)" --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS) --tmpfs /run"; \
$(TEST_STATUS); \
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir criu-ubi-portable-restore --platform "${PLATFORM}" --node_labels "${NODE_LABELS}" --docker_registry_url $(DOCKER_REGISTRY_URL) --docker_registry_dir "$(DOCKER_REGISTRY_DIR)" --criu_default_image_job_name "$(CRIU_DEFAULT_IMAGE_JOB_NAME)"
</command>
Expand Down
1 change: 0 additions & 1 deletion external/criuSettings.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# limitations under the License.
##############################################################################

export CRIU_MICRO_ARCHITECTURE_LIST=hw.arch.x86.skylake hw.arch.x86.amd
export CRIU_XLINUX_COMBO_LIST=sw.os.ubuntu.22-hw.arch.x86.broadwell sw.os.rhel.8-hw.arch.x86.broadwell sw.os.rhel.8-hw.arch.x86.amd sw.os.rhel.8-hw.arch.x86.skylake
# not available: sw.os.ubuntu.22-hw.arch.x86.amd sw.os.ubuntu.22-hw.arch.x86.skylake
export CRIU_DEFAULT_IMAGE_JOB_NAME=criu_image_upload
29 changes: 17 additions & 12 deletions external/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ build_number=""
node_name=""
node_labels=""
node_label_micro_architecture=""
node_label_current_os=""
container_run="docker run"
container_login="docker login"
container_inspect="docker inspect"
Expand All @@ -43,7 +44,7 @@ container_push="docker push"
container_pull="docker pull"
container_rm="docker rm"
container_rmi="docker rmi"
criu_micro_architecture_list=""
criu_combo_os_microarch_list=""
docker_registry_required="false"
docker_registry_url=""
docker_registry_dir=""
Expand All @@ -56,7 +57,7 @@ imageArg=""


usage () {
echo 'Usage : external.sh --dir TESTDIR --tag DOCKERIMAGE_TAG --version JDK_VERSION --impl JDK_IMPL [--docker_os docker_os][--platform PLATFORM] [--portable portable] [--node_name node_name] [--node_labels node_labels] [--docker_registry_required docker_registry_required] [--docker_registry_url DOCKER_REGISTRY_URL] [--docker_registry_dir DOCKER_REGISTRY_DIR] [--criu_micro_architecture_list CRIU_MICRO_ARCHITECTURE_LIST] [--mount_jdk mount_jdk] [--test_root TEST_ROOT] [--reportsrc appReportDir] [--reportdst REPORTDIR] [--testtarget target] [--docker_args EXTRA_DOCKER_ARGS] [--build|--run|--load|--clean]'
echo 'Usage : external.sh --dir TESTDIR --tag DOCKERIMAGE_TAG --version JDK_VERSION --impl JDK_IMPL [--docker_os docker_os][--platform PLATFORM] [--portable portable] [--node_name node_name] [--node_labels node_labels] [--docker_registry_required docker_registry_required] [--docker_registry_url DOCKER_REGISTRY_URL] [--docker_registry_dir DOCKER_REGISTRY_DIR] [--criu_combo_os_microarch_list CRIU_XLINUX_COMBO_LIST] [--mount_jdk mount_jdk] [--test_root TEST_ROOT] [--reportsrc appReportDir] [--reportdst REPORTDIR] [--testtarget target] [--docker_args EXTRA_DOCKER_ARGS] [--build|--run|--load|--clean]'
}

supported_tests="external_custom aot camel criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring"
Expand Down Expand Up @@ -150,9 +151,13 @@ parseCommandLineArgs() {
node_labels="$1"; shift;
for label in $node_labels
do
if [[ "$label" == "hw.arch."*"."* ]]; then
if [[ -z "$node_label_micro_architecture" && "$label" == "hw.arch."*"."* ]]; then #hw.arch.x86.skylake
node_label_micro_architecture=$label
echo "node_label_micro_architecture is $node_label_micro_architecture"
elif [[ -z "$node_label_current_os" && "$label" == "sw.os."*"."* ]]; then # sw.os.ubuntu.22 sw.os.rhel.8
node_label_current_os=$label
echo "node_label_current_os is $node_label_current_os"
elif [[ -n "$node_label_current_os" && -n "$node_label_micro_architecture" ]]; then
break
fi
done;;
Expand All @@ -173,8 +178,8 @@ parseCommandLineArgs() {
"--criu_default_image_job_name" )
criu_default_image_job_name="$1"; shift;;

"--criu_micro_architecture_list" )
criu_micro_architecture_list="$1"; shift;;
"--criu_combo_os_microarch_list" )
criu_combo_os_microarch_list="$1"; shift;;

"--test_root" )
test_root="$1"; shift;;
Expand Down Expand Up @@ -286,7 +291,7 @@ if [ $command_type == "run" ]; then
echo "Private Docker Registry login starts:"
echo $DOCKER_REGISTRY_CREDENTIALS_PSW | $container_login --username=$DOCKER_REGISTRY_CREDENTIALS_USR --password-stdin $docker_registry_url

restore_ready_checkpoint_image_folder="${docker_registry_url}/${job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_micro_architecture}"
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}"
tagged_restore_ready_checkpoint_image_num="${restore_ready_checkpoint_image_folder}:${build_number}"
tagged_restore_ready_checkpoint_image_latest="${restore_ready_checkpoint_image_folder}:latest"

Expand Down Expand Up @@ -338,14 +343,14 @@ if [ $command_type == "load" ]; then
restore_docker_image_name_list+=("${docker_registry_url}/${docker_registry_dir}")
else
echo "Testing images from nightly builds"
image_micro_architecture_list=($criu_micro_architecture_list)
for image_micro_architecture in ${image_micro_architecture_list[@]}
image_os_micro_architecture_list=($criu_combo_os_microarch_list)
for image_os_micro_architecture in ${image_os_micro_architecture_list[@]}
do
restore_docker_image_name_list+=("${docker_registry_url}/$criu_default_image_job_name/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${image_micro_architecture}:latest")
restore_docker_image_name_list+=("${docker_registry_url}/$criu_default_image_job_name/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${image_os_micro_architecture}:latest")
done
fi

echo "The host machine micro-architecture is ${node_label_micro_architecture}"
echo "The host machine OS is ${node_label_current_os}, and micro-architecture is ${node_label_micro_architecture}"
for restore_docker_image_name in ${restore_docker_image_name_list[@]}
do
echo "Pulling image $restore_docker_image_name"
Expand Down Expand Up @@ -385,6 +390,6 @@ if [ $command_type == "clean" ]; then
fi
$container_rm -f $test-test; $container_rmi -f adoptopenjdk-$test-test:${JDK_VERSION}-$package-$docker_os-${JDK_IMPL}-$build_type
$container_rm -f restore-test
$container_rmi -f ${docker_registry_url}/${job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_micro_architecture}:latest
$container_rmi -f ${docker_registry_url}/${criu_default_image_job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_micro_architecture}:latest
$container_rmi -f ${docker_registry_url}/${job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_current_os}-${node_label_micro_architecture}:latest
$container_rmi -f ${docker_registry_url}/${criu_default_image_job_name}/${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_current_os}-${node_label_micro_architecture}:latest
fi