From 33c1a7e48d8494fbba37b595e323ed1040392b77 Mon Sep 17 00:00:00 2001 From: George Adams Date: Fri, 4 Sep 2020 13:35:50 +0100 Subject: [PATCH 1/3] add dragonwell support --- configureBuild.sh | 2 ++ .../build/dockerFiles/dragonwell.dockerfile | 14 +++++++++++++ .../build/prTester/pr_test_pipeline.groovy | 3 ++- pipelines/jobs/configurations/jdk11u.groovy | 3 ++- .../jdk11u_pipeline_config.groovy | 6 ++++-- pipelines/jobs/configurations/jdk8u.groovy | 3 ++- .../jdk8u_pipeline_config.groovy | 9 +++++++-- sbin/build.sh | 4 +++- sbin/common/constants.sh | 1 + sbin/prepareWorkspace.sh | 20 ++++++++++++++++++- 10 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 pipelines/build/dockerFiles/dragonwell.dockerfile diff --git a/configureBuild.sh b/configureBuild.sh index 3846c546e..2570a9405 100755 --- a/configureBuild.sh +++ b/configureBuild.sh @@ -157,6 +157,8 @@ setRepository() { suffix="SAP/SapMachine" elif [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_CORRETTO}" ]]; then suffix="corretto/corretto-${BUILD_CONFIG[OPENJDK_CORE_VERSION]:3}" + elif [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]]; then + suffix="alibaba/dragonwell${BUILD_CONFIG[OPENJDK_CORE_VERSION]/jdk/}" elif [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ] && [ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "armv7l" ]; then suffix="adoptopenjdk/openjdk-aarch32-jdk8u"; elif [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ] && [ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "aarch64" ]; then diff --git a/pipelines/build/dockerFiles/dragonwell.dockerfile b/pipelines/build/dockerFiles/dragonwell.dockerfile new file mode 100644 index 000000000..9300dbede --- /dev/null +++ b/pipelines/build/dockerFiles/dragonwell.dockerfile @@ -0,0 +1,14 @@ +ARG image + +FROM $image + +RUN mkdir -p /opt/dragonwell +COPY --from=dragonwelljdk/build_jdk:8u /opt/dragonwell_8.3.3_boot /opt/dragonwell8 +COPY --from=dragonwelljdk/build_jdk:11u /opt/dragonwell_11.0.5.1 /opt/dragonwell11 +# COPY --from=joeylee97/dragonwell:v1 /opt/dragonwell/dragonwell8 /root/jenkins/workspace/build-scripts/jobs/jdk8u/jdk8u-linux-x64-dragonwell/workspace/dragonwell8 +# COPY --from=joeylee97/dragonwell:v1 /opt/dragonwell/.gradle /root/.gradle +# COPY --from=joeylee97/dragonwell:v1 /root/buildfiles /root/buildfiles + +ENV \ + JDK8_BOOT_DIR="/opt/dragonwell8" \ + JDK11_BOOT_DIR="/opt/dragonwell11" \ No newline at end of file diff --git a/pipelines/build/prTester/pr_test_pipeline.groovy b/pipelines/build/prTester/pr_test_pipeline.groovy index d8849b604..b34a761d3 100644 --- a/pipelines/build/prTester/pr_test_pipeline.groovy +++ b/pipelines/build/prTester/pr_test_pipeline.groovy @@ -123,7 +123,8 @@ class PullRequestTestPipeline implements Serializable { Map defaultTestConfigurations = [ "x64Linux": [ "hotspot", - "openj9" + "openj9", + "dragonwell" ], "aarch64Linux": [ "hotspot", diff --git a/pipelines/jobs/configurations/jdk11u.groovy b/pipelines/jobs/configurations/jdk11u.groovy index 8f0a8b4b7..1b46e1ea0 100644 --- a/pipelines/jobs/configurations/jdk11u.groovy +++ b/pipelines/jobs/configurations/jdk11u.groovy @@ -9,7 +9,8 @@ targetConfigurations = [ "x64Linux" : [ "hotspot", "openj9", - "corretto" + "corretto", + "dragonwell" ], "x64Windows" : [ "hotspot", diff --git a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy index 082995d0f..fe59d09d9 100644 --- a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy @@ -25,7 +25,8 @@ class Config11 { arch : 'x64', dockerImage : 'adoptopenjdk/centos6_build_image', dockerFile: [ - openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile' + openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile', + dragonwell: 'pipelines/build/dockerFiles/dragonwell.dockerfile' ], test : [ nightly: ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.external'], @@ -35,7 +36,8 @@ class Config11 { "openj9" : '--enable-jitserver --enable-dtrace=auto', "hotspot" : '--enable-dtrace=auto', "corretto" : '--enable-dtrace=auto', - "SapMachine" : '--enable-dtrace=auto' + "SapMachine" : '--enable-dtrace=auto', + "dragonwell" : '--enable-dtrace=auto --enable-unlimited-crypto --with-jvm-variants=server --with-zlib=system --with-jvm-features=zgc' ] ], diff --git a/pipelines/jobs/configurations/jdk8u.groovy b/pipelines/jobs/configurations/jdk8u.groovy index f8ec4b2d4..d29732ee7 100644 --- a/pipelines/jobs/configurations/jdk8u.groovy +++ b/pipelines/jobs/configurations/jdk8u.groovy @@ -6,7 +6,8 @@ targetConfigurations = [ "x64Linux" : [ "hotspot", "openj9", - "corretto" + "corretto", + "alibiba" ], "x32Windows" : [ "hotspot", diff --git a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy index c61f78bfc..5b1b375ba 100644 --- a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy @@ -25,11 +25,16 @@ class Config8 { arch : 'x64', dockerImage : 'adoptopenjdk/centos6_build_image', dockerFile: [ - openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile' + openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile', + dragonwell: 'pipelines/build/dockerFiles/dragonwell.dockerfile' ], test : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.external', 'special.functional', 'special.openjdk'], configureArgs : [ - "openj9" : '--enable-jitserver' + "openj9" : '--enable-jitserver', + "dragonwell" : '--enable-jfr --enable-unlimited-crypto --with-jvm-variants=server --with-zlib=system', + ], + buildArgs : [ + "dragonwell" : '--jdk-boot-dir /opt/dragonwell/j2sdk-image/' ] ], diff --git a/sbin/build.sh b/sbin/build.sh index 4c0ed185f..22a3734ad 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -150,7 +150,9 @@ getOpenJdkVersion() { fi else version=${BUILD_CONFIG[TAG]:-$(getFirstTagFromOpenJDKGitRepo)} - + if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]; then + version=$(echo $version | cut -d'_' -f 2) + fi # TODO remove pending #1016 version=${version%_adopt} version=${version#aarch64-shenandoah-} diff --git a/sbin/common/constants.sh b/sbin/common/constants.sh index d074ab0e8..011a4de03 100755 --- a/sbin/common/constants.sh +++ b/sbin/common/constants.sh @@ -39,6 +39,7 @@ export BUILD_VARIANT_HOTSPOT="hotspot" export BUILD_VARIANT_OPENJ9="openj9" export BUILD_VARIANT_CORRETTO="corretto" export BUILD_VARIANT_SAP="SapMachine" +export BUILD_VARIANT_DRAGONWELL="dragonwell" export GIT_TAGS_TO_SEARCH=100 diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 59c95f96f..c1367c1e1 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -53,7 +53,11 @@ checkoutAndCloneOpenJDKGitRepo() { # eg. origin https://github.com/adoptopenjdk/openjdk-jdk11u (fetch) # eg. origin https://github.com/adoptopenjdk/openjdk-jdk (fetch) # eg. origin git@github.com:adoptopenjdk/openjdk-jdk.git (fetch) - git --git-dir "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" remote -v | grep "origin.*fetch" | grep "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" | grep "${BUILD_CONFIG[REPOSITORY]}.git\|${BUILD_CONFIG[REPOSITORY]}\s" + if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]; then + git --git-dir "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" remote -v | grep "origin.*fetch" + else + git --git-dir "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" remote -v | grep "origin.*fetch" | grep "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" # | grep "${BUILD_CONFIG[REPOSITORY]}.git\|${BUILD_CONFIG[REPOSITORY]}\s" + fi local isValidGitRepo=$? set -e @@ -102,6 +106,7 @@ checkoutAndCloneOpenJDKGitRepo() { git clean -ffdx updateOpenj9Sources + updateDragonwellSources createSourceTagFile @@ -256,6 +261,19 @@ updateOpenj9Sources() { fi } +updateDragonwellSources() { + if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]] && [[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]]; then + # Building OpenJDK with Dragonwell must run get_source.sh to clone Dragonwell repositories + subrepos="corba jaxp jaxws langtools jdk hotspot nashorn" + GITURL="https://gitee.com/joeylee97" + REPO_PREFIX="dragonwell8_" + for repo in ${subrepos}; do + REPOURL=${GITURL}/${REPO_PREFIX}${repo}.git + git clone ${REPOURL} ${repo} + done + fi +} + # Clone the git repo cloneOpenJDKGitRepo() { setGitCloneArguments From 508e4e861af81a3d7d3067852ce007cd1b0df8dd Mon Sep 17 00:00:00 2001 From: George Adams Date: Sat, 5 Sep 2020 10:48:35 +0100 Subject: [PATCH 2/3] fix bootJDK --- .../build/common/openjdk_build_pipeline.groovy | 7 ++++++- .../build/dockerFiles/dragonwell.dockerfile | 16 +++++++--------- pipelines/build/prTester/pr_test_pipeline.groovy | 3 +-- .../configurations/jdk11u_pipeline_config.groovy | 3 +-- .../configurations/jdk8u_pipeline_config.groovy | 3 --- sbin/build.sh | 16 ++++++++++++---- sbin/common/config_init.sh | 2 ++ sbin/prepareWorkspace.sh | 13 ++++--------- 8 files changed, 33 insertions(+), 30 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 77890436a..913cd5ea4 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -88,6 +88,7 @@ class Build { switch (buildConfig.VARIANT) { case "openj9": variant = "j9"; break case "corretto": variant = "corretto"; break + case "dragonwell": variant = "dragonwell"; break; default: variant = "hs" } @@ -118,6 +119,8 @@ class Build { jdkBranch = 'openj9' } else if (buildConfig.VARIANT == "hotspot"){ jdkBranch = 'dev' + } else if (buildConfig.VARIANT == "dragonwell") { + jdkBranch = 'master' } else { context.error("Unrecognized build variant '${buildConfig.VARIANT}' ") throw new Exception() @@ -135,8 +138,10 @@ class Build { suffix="corretto/corretto-${javaNumber}" } else if (buildConfig.VARIANT == "openj9") { suffix = "ibmruntimes/openj9-openjdk-jdk${javaNumber}" - } else if (buildConfig.VARIANT == "hotspot"){ + } else if (buildConfig.VARIANT == "hotspot") { suffix = "adoptopenjdk/openjdk-${buildConfig.JAVA_TO_BUILD}" + } else if (buildConfig.VARIANT == "dragonwell") { + suffix = "alibaba/dragonwell${javaNumber}" } else { context.error("Unrecognized build variant '${buildConfig.VARIANT}' ") throw new Exception() diff --git a/pipelines/build/dockerFiles/dragonwell.dockerfile b/pipelines/build/dockerFiles/dragonwell.dockerfile index 9300dbede..5fb4d1eba 100644 --- a/pipelines/build/dockerFiles/dragonwell.dockerfile +++ b/pipelines/build/dockerFiles/dragonwell.dockerfile @@ -2,13 +2,11 @@ ARG image FROM $image -RUN mkdir -p /opt/dragonwell -COPY --from=dragonwelljdk/build_jdk:8u /opt/dragonwell_8.3.3_boot /opt/dragonwell8 -COPY --from=dragonwelljdk/build_jdk:11u /opt/dragonwell_11.0.5.1 /opt/dragonwell11 -# COPY --from=joeylee97/dragonwell:v1 /opt/dragonwell/dragonwell8 /root/jenkins/workspace/build-scripts/jobs/jdk8u/jdk8u-linux-x64-dragonwell/workspace/dragonwell8 -# COPY --from=joeylee97/dragonwell:v1 /opt/dragonwell/.gradle /root/.gradle -# COPY --from=joeylee97/dragonwell:v1 /root/buildfiles /root/buildfiles +RUN \ + # Dragonewell 8 requires a dragonwell 8 BootJDK + mkdir -p /opt/dragonwell; \ + wget https://github.com/alibaba/dragonwell8/releases/download/dragonwell-8.4.4_jdk8u262-ga/Alibaba_Dragonwell_8.4.4-GA_Linux_x64.tar.gz; \ + tar -xf Alibaba_Dragonwell_8.4.4-GA_Linux_x64.tar.gz -C /opt/; \ + mv /opt/jdk8u262-b10 /opt/dragonwell8 -ENV \ - JDK8_BOOT_DIR="/opt/dragonwell8" \ - JDK11_BOOT_DIR="/opt/dragonwell11" \ No newline at end of file +ENV JDK7_BOOT_DIR="/opt/dragonwell8" \ No newline at end of file diff --git a/pipelines/build/prTester/pr_test_pipeline.groovy b/pipelines/build/prTester/pr_test_pipeline.groovy index b34a761d3..d8849b604 100644 --- a/pipelines/build/prTester/pr_test_pipeline.groovy +++ b/pipelines/build/prTester/pr_test_pipeline.groovy @@ -123,8 +123,7 @@ class PullRequestTestPipeline implements Serializable { Map defaultTestConfigurations = [ "x64Linux": [ "hotspot", - "openj9", - "dragonwell" + "openj9" ], "aarch64Linux": [ "hotspot", diff --git a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy index fe59d09d9..166c9c30c 100644 --- a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy @@ -25,8 +25,7 @@ class Config11 { arch : 'x64', dockerImage : 'adoptopenjdk/centos6_build_image', dockerFile: [ - openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile', - dragonwell: 'pipelines/build/dockerFiles/dragonwell.dockerfile' + openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile' ], test : [ nightly: ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.external'], diff --git a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy index 5b1b375ba..55cf081ae 100644 --- a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy @@ -32,9 +32,6 @@ class Config8 { configureArgs : [ "openj9" : '--enable-jitserver', "dragonwell" : '--enable-jfr --enable-unlimited-crypto --with-jvm-variants=server --with-zlib=system', - ], - buildArgs : [ - "dragonwell" : '--jdk-boot-dir /opt/dragonwell/j2sdk-image/' ] ], diff --git a/sbin/build.sh b/sbin/build.sh index 22a3734ad..8c6b1420e 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -246,10 +246,18 @@ configuringVersionStringParameter() addConfigureArg "--without-version-pre" "" addConfigureArgIfValueIsNotEmpty "--with-version-build=" "${buildNumber}" - addConfigureArg "--with-vendor-version-string=" "AdoptOpenJDK" - addConfigureArg "--with-vendor-url=" "https://adoptopenjdk.net/" - addConfigureArg "--with-vendor-name=" "AdoptOpenJDK" - addConfigureArg "--with-vendor-bug-url=" "https://github.com/AdoptOpenJDK/openjdk-support/issues" + + if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]]; then + addConfigureArg "--with-vendor-name=" "Alibaba" + addConfigureArg "--with-vendor-url=" "http://www.alibabagroup.com" + addConfigureArg "--with-vendor-bug-url=" "mailto:dragonwell_use@googlegroups.com" + addConfigureArg "--with-vendor-version-string=" "\"(Alibaba Dragonwell)\"" + else + addConfigureArg "--with-vendor-version-string=" "AdoptOpenJDK" + addConfigureArg "--with-vendor-url=" "https://adoptopenjdk.net/" + addConfigureArg "--with-vendor-name=" "AdoptOpenJDK" + addConfigureArg "--with-vendor-bug-url=" "https://github.com/AdoptOpenJDK/openjdk-support/issues" + fi if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]]; then addConfigureArg "--with-vendor-vm-bug-url=" "https://github.com/eclipse/openj9/issues" diff --git a/sbin/common/config_init.sh b/sbin/common/config_init.sh index 6085819a4..50a1dac3c 100755 --- a/sbin/common/config_init.sh +++ b/sbin/common/config_init.sh @@ -324,6 +324,8 @@ function setBranch() { local branch="dev" if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]; then branch="openj9"; + elif [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]; then + branch="master"; elif [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_CORRETTO}" ]; then branch="develop"; fi diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index c1367c1e1..9026e17eb 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -56,7 +56,7 @@ checkoutAndCloneOpenJDKGitRepo() { if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]; then git --git-dir "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" remote -v | grep "origin.*fetch" else - git --git-dir "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" remote -v | grep "origin.*fetch" | grep "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" # | grep "${BUILD_CONFIG[REPOSITORY]}.git\|${BUILD_CONFIG[REPOSITORY]}\s" + git --git-dir "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" remote -v | grep "origin.*fetch" | grep "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" | grep "${BUILD_CONFIG[REPOSITORY]}.git\|${BUILD_CONFIG[REPOSITORY]}\s" fi local isValidGitRepo=$? set -e @@ -263,14 +263,9 @@ updateOpenj9Sources() { updateDragonwellSources() { if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]] && [[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]]; then - # Building OpenJDK with Dragonwell must run get_source.sh to clone Dragonwell repositories - subrepos="corba jaxp jaxws langtools jdk hotspot nashorn" - GITURL="https://gitee.com/joeylee97" - REPO_PREFIX="dragonwell8_" - for repo in ${subrepos}; do - REPOURL=${GITURL}/${REPO_PREFIX}${repo}.git - git clone ${REPOURL} ${repo} - done + cd "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}" || return + bash get_source_dragonwell.sh --site github + cd "${BUILD_CONFIG[WORKSPACE_DIR]}" fi } From 2db4ae6836a32623b62557500813f006fcb482cd Mon Sep 17 00:00:00 2001 From: George Adams Date: Sun, 6 Sep 2020 20:30:03 +0100 Subject: [PATCH 3/3] Update jdk8u.groovy --- pipelines/jobs/configurations/jdk8u.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/jobs/configurations/jdk8u.groovy b/pipelines/jobs/configurations/jdk8u.groovy index d29732ee7..32791691b 100644 --- a/pipelines/jobs/configurations/jdk8u.groovy +++ b/pipelines/jobs/configurations/jdk8u.groovy @@ -7,7 +7,7 @@ targetConfigurations = [ "hotspot", "openj9", "corretto", - "alibiba" + "dragonwell" ], "x32Windows" : [ "hotspot",