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 Plinux criu ubi8 test by adding repo file #4760

Merged
merged 1 commit into from
Sep 15, 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
1 change: 1 addition & 0 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ def buildTest() {
try {
timeout(time: 2, unit: 'HOURS') {
copyArtifacts fingerprintArtifacts: true, projectName: "UploadFileOnJenkins", selector: specific("2"), target: 'aqa-tests/external/criu/'
copyArtifacts fingerprintArtifacts: true, projectName: "UploadFileOnJenkins", selector: specific("3"), target: 'aqa-tests/external/criu/'
}
} catch (Exception e) {
echo 'Exception: ' + e.toString()
Expand Down
57 changes: 38 additions & 19 deletions external/criu/pingPerf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
set -e

pingPerfZipPath=""
ubiRepoFilePath="" # Temporarily This file is only for plinux ubi8
testJDKPath=""
jdkVersion=""
restoreImage="ol-instanton-test-pingperf-restore"
Expand Down Expand Up @@ -42,6 +43,9 @@ getSemeruDockerfile() {
if [[ $docker_os == "ubi" ]]; then
echo "curl -OLJSks https://raw.githubusercontent.com/ibmruntimes/semeru-containers/ibm/$jdkVersion/jdk/${docker_os}/${docker_os}${docker_os_version}/${semeruDockerfile}"
curl -OLJSks https://raw.githubusercontent.com/ibmruntimes/semeru-containers/ibm/$jdkVersion/jdk/${docker_os}/${docker_os}${docker_os_version}/${semeruDockerfile}
if [[ ${PLATFORM} == *"ppc"* && $docker_os_version == "8" ]]; then
findCommandAndReplace 'FROM registry.access.redhat.com/ubi8/ubi:latest' 'FROM registry.access.redhat.com/ubi8/ubi:latest \n COPY ubi.repo /etc/yum.repos.d/ \n ' $semeruDockerfile ";"
fi
findCommandAndReplace '\-H \"\${CRIU_AUTH_HEADER}\"' '--user \"\${DOCKER_REGISTRY_CREDENTIALS_USR}:\${DOCKER_REGISTRY_CREDENTIALS_PSW}\"' $semeruDockerfile ";"
findCommandAndReplace 'RUN --mount.*' 'ARG DOCKER_REGISTRY_CREDENTIALS_USR \n ARG DOCKER_REGISTRY_CREDENTIALS_PSW \n RUN set -eux; \\' $semeruDockerfile
findCommandAndReplace '\/opt\/java\/openjdk\/legal\/java.base\/LICENSE \/licenses;' "\/opt\/java\/openjdk\/legal\/java.base\/LICENSE \/licenses\/;" $semeruDockerfile
Expand Down Expand Up @@ -76,6 +80,16 @@ prepare() {
exit 1
fi

if [[ ${PLATFORM} == *"ppc"* && $docker_os == "ubi" && $docker_os_version == "8" ]]; then
if [ -f "$ubiRepoFilePath" ]; then
rm -f ubi.repo
cp "$ubiRepoFilePath" .
else
echo "${ubiRepoFilePath} does not exist."
exit 1
fi
fi

getCriuseccompproFile
getSemeruDockerfile

Expand Down Expand Up @@ -360,8 +374,9 @@ setup() {

if [ "$1" == "prepare" ]; then
pingPerfZipPath=$2
testJDKPath=$3
jdkVersion=$4
ubiRepoFilePath=$3
testJDKPath=$4
jdkVersion=$5
prepare
elif [ "$1" == "buildImage" ]; then
buildImage
Expand All @@ -379,10 +394,11 @@ elif [ "$1" == "clean" ]; then
clean
elif [ "$1" == "testCreateRestoreImageOnly" ]; then
pingPerfZipPath=$2
testJDKPath=$3
jdkVersion=$4
docker_os=$5
docker_os_version=$6
ubiRepoFilePath=$3
testJDKPath=$4
jdkVersion=$5
docker_os=$6
docker_os_version=$7
testCreateRestoreImageOnly
elif [ "$1" == "testUnprivilegedRestoreOnly" ]; then
testUnprivilegedRestoreOnly
Expand All @@ -402,27 +418,30 @@ elif [ "$1" == "pullImagePrivilegedRestore" ]; then
pullImagePrivilegedRestore
elif [ "$1" == "testCreateRestoreImageAndPushToRegistry" ]; then
pingPerfZipPath=$2
testJDKPath=$3
jdkVersion=$4
docker_os=$5
docker_os_version=$6
docker_registry_dir=$7
ubiRepoFilePath=$3
testJDKPath=$4
jdkVersion=$5
docker_os=$6
docker_os_version=$7
docker_registry_dir=$8
setup
testCreateRestoreImageOnly
pushImage
elif [ "$1" == "testCreateImageAndUnprivilegedRestore" ]; then
pingPerfZipPath=$2
testJDKPath=$3
jdkVersion=$4
docker_os=$5
docker_os_version=$6
ubiRepoFilePath=$3
testJDKPath=$4
jdkVersion=$5
docker_os=$6
docker_os_version=$7
testCreateImageAndUnprivilegedRestore
elif [ "$1" == "testCreateImageAndPrivilegedRestore" ]; then
pingPerfZipPath=$2
testJDKPath=$3
jdkVersion=$4
docker_os=$5
docker_os_version=$6
ubiRepoFilePath=$3
testJDKPath=$4
jdkVersion=$5
docker_os=$6
docker_os_version=$7
testCreateImageAndPrivilegedRestore
else
echo "unknown command"
Expand Down
36 changes: 6 additions & 30 deletions external/criu/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@
<include>../criuSettings.mk</include>
<test>
<testCaseName>criu_pingPerf_testCreateImageAndUnprivilegedRestore_ubi8</testCaseName>
<disables>
<disable>
<comment>runtimes_backlog_issues_1207</comment>
<platform>ppc64le_linux</platform>
</disable>
</disables>
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateImageAndUnprivilegedRestore $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "8"; \
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateImageAndUnprivilegedRestore $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_ROOT)/external/criu/upload/ubi.repo $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "8"; \
$(TEST_STATUS); \
$(TEST_ROOT)/external/criu/pingPerf.sh clean
</command>
Expand All @@ -38,7 +32,7 @@
</test>
<test>
<testCaseName>criu_pingPerf_testCreateImageAndUnprivilegedRestore_ubi9</testCaseName>
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateImageAndUnprivilegedRestore $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "9"; \
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateImageAndUnprivilegedRestore $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_ROOT)/external/criu/upload/ubi.repo $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "9"; \
$(TEST_STATUS); \
$(TEST_ROOT)/external/criu/pingPerf.sh clean
</command>
Expand All @@ -54,13 +48,7 @@
</test>
<test>
<testCaseName>criu_pingPerf_testCreateImageAndPrivilegedRestore_ubi8</testCaseName>
<disables>
<disable>
<comment>runtimes_backlog_issues_1207</comment>
<platform>ppc64le_linux</platform>
</disable>
</disables>
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateImageAndPrivilegedRestore $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "8"; \
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateImageAndPrivilegedRestore $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_ROOT)/external/criu/upload/ubi.repo $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "8"; \
$(TEST_STATUS); \
$(TEST_ROOT)/external/criu/pingPerf.sh clean
</command>
Expand All @@ -76,7 +64,7 @@
</test>
<test>
<testCaseName>criu_pingPerf_testCreateImageAndPrivilegedRestore_ubi9</testCaseName>
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateImageAndPrivilegedRestore $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "9"; \
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateImageAndPrivilegedRestore $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_ROOT)/external/criu/upload/ubi.repo $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "9"; \
$(TEST_STATUS); \
$(TEST_ROOT)/external/criu/pingPerf.sh clean
</command>
Expand All @@ -97,7 +85,7 @@
<comment>runtimes_backlog_issues_879</comment>
</disable>
</disables>
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateRestoreImageAndPushToRegistry $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "8" "$(DOCKER_REGISTRY_DIR)"; \
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateRestoreImageAndPushToRegistry $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_ROOT)/external/criu/upload/ubi.repo $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "8" "$(DOCKER_REGISTRY_DIR)"; \
$(TEST_STATUS); \
$(TEST_ROOT)/external/criu/pingPerf.sh clean
</command>
Expand All @@ -118,7 +106,7 @@
<comment>runtimes_backlog_issues_879</comment>
</disable>
</disables>
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateRestoreImageAndPushToRegistry $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "9" "$(DOCKER_REGISTRY_DIR)"; \
<command>$(TEST_ROOT)/external/criu/pingPerf.sh testCreateRestoreImageAndPushToRegistry $(TEST_ROOT)/external/criu/upload/PingperfFiles.zip $(TEST_ROOT)/external/criu/upload/ubi.repo $(TEST_JDK_HOME) ${JDK_VERSION} "ubi" "9" "$(DOCKER_REGISTRY_DIR)"; \
$(TEST_STATUS); \
$(TEST_ROOT)/external/criu/pingPerf.sh clean
</command>
Expand All @@ -134,12 +122,6 @@
</test>
<test>
<testCaseName>criu_pingPerf_pullImageUnprivilegedRestore_ubi8</testCaseName>
<disables>
<disable>
<comment>runtimes_backlog_issues_1207</comment>
<platform>ppc64le_linux</platform>
</disable>
</disables>
<command>$(TEST_ROOT)/external/criu/pingPerf.sh pullImageUnprivilegedRestore "ubi" "8" "$(DOCKER_REGISTRY_DIR)"; \
$(TEST_STATUS); \
$(TEST_ROOT)/external/criu/pingPerf.sh clean
Expand Down Expand Up @@ -172,12 +154,6 @@
</test>
<test>
<testCaseName>criu_pingPerf_pullImagePrivilegedRestore_ubi8</testCaseName>
<disables>
<disable>
<comment>runtimes_backlog_issues_1207</comment>
<platform>ppc64le_linux</platform>
</disable>
</disables>
<command>$(TEST_ROOT)/external/criu/pingPerf.sh pullImagePrivilegedRestore "ubi" "8" "$(DOCKER_REGISTRY_DIR)"; \
$(TEST_STATUS); \
$(TEST_ROOT)/external/criu/pingPerf.sh clean
Expand Down