diff --git a/external/aot/build.xml b/external/aot/build.xml new file mode 100644 index 0000000000..36b6e56948 --- /dev/null +++ b/external/aot/build.xml @@ -0,0 +1,27 @@ + + + + + Build aot Test + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/aot/playlist.xml b/external/aot/playlist.xml new file mode 100644 index 0000000000..ac0e1c559f --- /dev/null +++ b/external/aot/playlist.xml @@ -0,0 +1,32 @@ + + + + + aot_test + $(TEST_ROOT)$(D)external$(D)external.sh --load --tag "${DOCKERIMAGE_TAG}" --dir aot --portable "true" --mount_jdk "false" --platform "${PLATFORM}" --node_name "${NODE_NAME}" --node_labels "${NODE_LABELS}" --test_root "$(TEST_ROOT)" --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(EXTRA_DOCKER_ARGS)"; \ + $(TEST_STATUS); \ + $(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir aot --platform "${PLATFORM}" --node_labels "${NODE_LABELS}" + + + AOT:applicable + + + sanity + + + external + + + diff --git a/external/aot/test.sh b/external/aot/test.sh new file mode 100644 index 0000000000..1e8743efb8 --- /dev/null +++ b/external/aot/test.sh @@ -0,0 +1,27 @@ +#/bin/bash +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -e +echo "Testing AOT" +aot_failure_msg="AOT header validation failed" +java -Xjit:verbose -version >output 2>&1 +fail_count=$(grep "$aot_failure_msg" output) +if [ -z "$fail_count" ]; then + echo "Test Passed!" +else + cat output + echo -e "\nError: $aot_failure_msg" + exit 1 +fi +set +e diff --git a/external/criu-portable-checkpoint/playlist.xml b/external/criu-portable-checkpoint/playlist.xml index 7f69f00d1c..8d1332a0fc 100644 --- a/external/criu-portable-checkpoint/playlist.xml +++ b/external/criu-portable-checkpoint/playlist.xml @@ -15,7 +15,7 @@ criu-portable-checkpoint_test - $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir criu-portable-checkpoint --testtarget _cmdLineTester_criu_keepCheckpoint --portable "true" --platform "${PLATFORM}" --node_name "${NODE_NAME}" --node_labels "${NODE_LABELS}" --docker_registry_url $(DOCKER_REGISTRY_URL) --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(EXTRA_DOCKER_ARGS) --tmpfs /run"; \ + $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir criu-portable-checkpoint --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) --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(EXTRA_DOCKER_ARGS) --tmpfs /run"; \ $(TEST_STATUS); \ $(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir criu-portable-checkpoint --platform "${PLATFORM}" --node_labels "${NODE_LABELS}" --docker_registry_url $(DOCKER_REGISTRY_URL) diff --git a/external/criu-portable-restore/playlist.xml b/external/criu-portable-restore/playlist.xml index 5af5df49a6..468d6abc77 100644 --- a/external/criu-portable-restore/playlist.xml +++ b/external/criu-portable-restore/playlist.xml @@ -15,7 +15,7 @@ criu-portable-restore_test - $(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_url $(DOCKER_REGISTRY_URL) --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(EXTRA_DOCKER_ARGS) --tmpfs /run"; \ + $(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) --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(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) diff --git a/external/criu-ubi-portable-checkpoint/playlist.xml b/external/criu-ubi-portable-checkpoint/playlist.xml index db76deb7af..929543c332 100644 --- a/external/criu-ubi-portable-checkpoint/playlist.xml +++ b/external/criu-ubi-portable-checkpoint/playlist.xml @@ -15,7 +15,7 @@ criu-ubi-portable-checkpoint_test - $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir criu-ubi-portable-checkpoint --testtarget _cmdLineTester_criu_keepCheckpoint --portable "true" --platform "${PLATFORM}" --node_name "${NODE_NAME}" --node_labels "${NODE_LABELS}" --docker_registry_url $(DOCKER_REGISTRY_URL) --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(EXTRA_DOCKER_ARGS) --tmpfs /run"; \ + $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir criu-ubi-portable-checkpoint --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) --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(EXTRA_DOCKER_ARGS) --tmpfs /run"; \ $(TEST_STATUS); \ $(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir criu-ubi-portable-checkpoint --platform "${PLATFORM}" --node_labels "${NODE_LABELS}" --docker_registry_url $(DOCKER_REGISTRY_URL) diff --git a/external/criu-ubi-portable-restore/playlist.xml b/external/criu-ubi-portable-restore/playlist.xml index 319b6fa4a2..30421cbff2 100644 --- a/external/criu-ubi-portable-restore/playlist.xml +++ b/external/criu-ubi-portable-restore/playlist.xml @@ -15,7 +15,7 @@ criu-ubi-portable-restore_test - $(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_url $(DOCKER_REGISTRY_URL) --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(EXTRA_DOCKER_ARGS) --tmpfs /run"; \ + $(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) --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(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) diff --git a/external/external.sh b/external/external.sh index 24c05cd270..39bb018731 100755 --- a/external/external.sh +++ b/external/external.sh @@ -30,19 +30,21 @@ portable="false" node_name="" node_labels="" node_label_micro_architecture="" +docker_registry_required="false" docker_registry_url="" reportdst="false" reportsrc="false" docker_args="" mountV="" +mount_jdk="true" 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_url DOCKER_REGISTRY_URL] [--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] [--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 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" +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" function check_test() { test=$1 @@ -109,6 +111,9 @@ parseCommandLineArgs() { "--portable" ) portable="$1"; shift;; + "--mount_jdk" ) + mount_jdk="$1"; shift;; + "--node_name" ) node_name="$1"; shift;; @@ -123,9 +128,15 @@ parseCommandLineArgs() { fi done;; + "--docker_registry_required" ) + docker_registry_required="$1"; shift;; + "--docker_registry_url" ) docker_registry_url="$1"; shift;; + "--test_root" ) + test_root="$1"; shift;; + "--reportsrc" ) reportsrc="$1"; shift;; @@ -260,21 +271,43 @@ fi if [ $command_type == "load" ]; then # TO-DO: Use a different micro architecture (e.g. skylake vs broadwell) to test when machine label completed. - if [[ $docker_registry_url ]]; then - echo "Private Docker Registry login starts:" - echo $DOCKER_REGISTRY_CREDENTIALS_PSW | docker login --username=$DOCKER_REGISTRY_CREDENTIALS_USR --password-stdin $docker_registry_url - - current_micro_architecture=$node_label_micro_architecture - docker pull $docker_registry_url/criu-restore-ready-with-jdk:${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${current_micro_architecture} - docker image ls - # restore - echo "docker run --privileged $mountV --name restore-checkpoint --rm $docker_registry_url/criu-restore-ready-with-jdk:${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${current_micro_architecture}" - docker run --privileged $mountV --name restore-checkpoint --rm $docker_registry_url/criu-restore-ready-with-jdk:${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${current_micro_architecture} - - docker logout $docker_registry_url - else - echo "Docker Regsitry is not avaialble on this Jenkins" - exit 1 + if [[ $docker_registry_required != "false" ]]; then + if [[ $docker_registry_url ]]; then + echo "Private Docker Registry login starts:" + echo $DOCKER_REGISTRY_CREDENTIALS_PSW | docker login --username=$DOCKER_REGISTRY_CREDENTIALS_USR --password-stdin $docker_registry_url + + current_micro_architecture=$node_label_micro_architecture + docker pull $docker_registry_url/criu-restore-ready-with-jdk:${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${current_micro_architecture} + docker image ls + mount_options="" + if [[ $mount_jdk != "false" ]]; then + echo "Mounting JDK" + mount_options="$mountV" + fi + # restore + echo "docker run --privileged $mount_options --name restore-test --rm $docker_registry_url/criu-restore-ready-with-jdk:${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${current_micro_architecture}" + docker run --privileged $mount_options --name restore-test --rm $docker_registry_url/criu-restore-ready-with-jdk:${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${current_micro_architecture} + + docker logout $docker_registry_url + else + echo "Docker Regsitry is not avaialble on this Jenkins" + exit 1 + fi + else # no need private docker registry + docker_image_name="eclipse-temurin:${JDK_VERSION}-jdk" + if [[ "${JDK_IMPL}" == *"openj9"* ]]; then + docker_image_name="ibm-semeru-runtimes:open-${JDK_VERSION}-jdk" + fi + test_script_path="$test_root/external/$test/test.sh" + chmod a+x $test_script_path + mount_test_script="-v $test_script_path:/test.sh" + mount_options=$mount_test_script + if [[ $mount_jdk != "false" ]]; then + echo "Mounting JDK and test script" + mount_options="$mountV $mount_test_script" + fi + echo "docker run --privileged $mount_options --name restore-test --rm $docker_image_name bash /test.sh" + docker run --privileged $mount_options --name restore-test --rm $docker_image_name bash /test.sh fi fi @@ -283,6 +316,6 @@ if [ $command_type == "clean" ]; then test="$(echo ${EXTERNAL_CUSTOM_REPO} | awk -F'/' '{print $NF}' | sed 's/.git//g')" fi docker rm -f $test-test; docker rmi -f adoptopenjdk-$test-test:${JDK_VERSION}-$package-$docker_os-${JDK_IMPL}-$build_type - docker rm -f restore-checkpoint + docker rm -f restore-test docker rmi -f ${docker_registry_url}/criu-restore-ready-with-jdk:${JDK_VERSION}-${JDK_IMPL}-${docker_os}-${platform}-${node_label_micro_architecture} fi