From 2cf9384954a959f2a52e30237066ddcb780c00be Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 8 Sep 2020 16:18:15 +0100 Subject: [PATCH] add dragonwell support (#2051) * add dragonwell support * fix bootJDK * Update jdk8u.groovy --- configureBuild.sh | 2 ++ .../common/openjdk_build_pipeline.groovy | 7 ++++++- .../build/dockerFiles/dragonwell.dockerfile | 12 +++++++++++ pipelines/jobs/configurations/jdk11u.groovy | 3 ++- .../jdk11u_pipeline_config.groovy | 3 ++- pipelines/jobs/configurations/jdk8u.groovy | 3 ++- .../jdk8u_pipeline_config.groovy | 6 ++++-- sbin/build.sh | 20 ++++++++++++++----- sbin/common/config_init.sh | 2 ++ sbin/common/constants.sh | 1 + sbin/prepareWorkspace.sh | 15 +++++++++++++- 11 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 pipelines/build/dockerFiles/dragonwell.dockerfile diff --git a/configureBuild.sh b/configureBuild.sh index 3846c546ee..2570a9405f 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/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 77890436a5..913cd5ea4a 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 new file mode 100644 index 0000000000..5fb4d1ebaa --- /dev/null +++ b/pipelines/build/dockerFiles/dragonwell.dockerfile @@ -0,0 +1,12 @@ +ARG image + +FROM $image + +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 JDK7_BOOT_DIR="/opt/dragonwell8" \ No newline at end of file diff --git a/pipelines/jobs/configurations/jdk11u.groovy b/pipelines/jobs/configurations/jdk11u.groovy index 8f0a8b4b79..1b46e1ea01 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 082995d0f5..166c9c30c9 100644 --- a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy @@ -35,7 +35,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 f8ec4b2d47..32791691b8 100644 --- a/pipelines/jobs/configurations/jdk8u.groovy +++ b/pipelines/jobs/configurations/jdk8u.groovy @@ -6,7 +6,8 @@ targetConfigurations = [ "x64Linux" : [ "hotspot", "openj9", - "corretto" + "corretto", + "dragonwell" ], "x32Windows" : [ "hotspot", diff --git a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy index c61f78bfcc..55cf081ae2 100644 --- a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy @@ -25,11 +25,13 @@ 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', ] ], diff --git a/sbin/build.sh b/sbin/build.sh index 4c0ed185f2..8c6b1420e5 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-} @@ -244,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 bf715c36a0..b7f5459b4d 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/common/constants.sh b/sbin/common/constants.sh index d074ab0e8f..011a4de034 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 59c95f96fe..9026e17ebb 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,14 @@ updateOpenj9Sources() { fi } +updateDragonwellSources() { + if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_DRAGONWELL}" ]] && [[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]]; then + 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 +} + # Clone the git repo cloneOpenJDKGitRepo() { setGitCloneArguments