From c908bb77d9f03548f0cd55cf2c7ebef8c32cd23d Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Thu, 27 Jun 2024 21:05:53 +0800 Subject: [PATCH] HBASE-28678 Make nightly builds for 3.x java 17 only and add java 17 test for 2.x (#6032) Signed-off-by: Xin Sun (cherry picked from commit 8ff8748a38d6b7d4725a41b5589d7c38bd36dae9) --- dev-support/Jenkinsfile | 28 ++++++++++++++++++++-------- dev-support/hbase-personality.sh | 24 +++++------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile index 3aadf7316b32..0a47726e53c2 100644 --- a/dev-support/Jenkinsfile +++ b/dev-support/Jenkinsfile @@ -205,8 +205,8 @@ pipeline { environment { BASEDIR = "${env.WORKSPACE}/component" TESTS = "${env.SHALLOW_CHECKS}" - SET_JAVA_HOME = "/usr/lib/jvm/java-11" - JAVA8_HOME="/usr/lib/jvm/java-8" + SET_JAVA_HOME = getJavaHomeForYetusGeneralCheck(env.BRANCH_NAME) + JAVA8_HOME = "/usr/lib/jvm/java-8" // Activates hadoop 3.0 profile in maven runs. HADOOP_PROFILE = '3.0' OUTPUT_DIR_RELATIVE = "${env.OUTPUT_DIR_RELATIVE_GENERAL}" @@ -307,7 +307,7 @@ pipeline { } } when { - branch 'branch-2*' + branch '*branch-2*' } environment { BASEDIR = "${env.WORKSPACE}/component" @@ -417,6 +417,9 @@ pipeline { label 'hbase' } } + when { + branch '*branch-2*' + } environment { BASEDIR = "${env.WORKSPACE}/component" TESTS = "${env.DEEP_CHECKS}" @@ -527,6 +530,9 @@ pipeline { label 'hbase' } } + when { + branch '*branch-2*' + } environment { BASEDIR = "${env.WORKSPACE}/component" TESTS = "${env.DEEP_CHECKS}" @@ -633,11 +639,6 @@ pipeline { } stage ('yetus jdk17 hadoop3 checks') { - when { - anyOf { - branch 'master';branch 'branch-3' - } - } agent { node { label 'hbase' @@ -943,12 +944,14 @@ pipeline { unstash 'jdk8-hadoop2-result' unstash 'jdk8-hadoop3-result' unstash 'jdk11-hadoop3-result' + unstash 'jdk17-hadoop3-result' unstash 'srctarball-result' sh "printenv" def results = ["${env.OUTPUT_DIR_RELATIVE_GENERAL}/commentfile", "${env.OUTPUT_DIR_RELATIVE_JDK8_HADOOP2}/commentfile", "${env.OUTPUT_DIR_RELATIVE_JDK8_HADOOP3}/commentfile", "${env.OUTPUT_DIR_RELATIVE_JDK11_HADOOP3}/commentfile", + "${env.OUTPUT_DIR_RELATIVE_JDK17_HADOOP3}/commentfile", 'output-srctarball/commentfile', 'output-integration/commentfile'] echo env.BRANCH_NAME @@ -1018,3 +1021,12 @@ List getJirasToComment(CharSequence source, List seen) { } return seen } +@NonCPS +String getJavaHomeForYetusGeneralCheck(String branchName) { + // for 2.x, build with java 11, for 3.x, build with java 17 + if (branchName.indexOf("branch-2") >=0) { + return "/usr/lib/jvm/java-11"; + } else { + return "/usr/lib/jvm/java-17" + } +} diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index c7131c45e2f1..25eee1463c10 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -178,7 +178,7 @@ function personality_modules # If we have HADOOP_PROFILE specified and we're on branch-2.x, pass along # the hadoop.profile system property. Ensures that Hadoop2 and Hadoop3 # logic is not both activated within Maven. - if [[ -n "${HADOOP_PROFILE}" ]] && [[ "${PATCH_BRANCH}" = branch-2* ]] ; then + if [[ -n "${HADOOP_PROFILE}" ]] && [[ "${PATCH_BRANCH}" == *"branch-2"* ]] ; then extra="${extra} -Dhadoop.profile=${HADOOP_PROFILE}" fi @@ -490,7 +490,7 @@ function shadedjars_rebuild # If we have HADOOP_PROFILE specified and we're on branch-2.x, pass along # the hadoop.profile system property. Ensures that Hadoop2 and Hadoop3 # logic is not both activated within Maven. - if [[ -n "${HADOOP_PROFILE}" ]] && [[ "${PATCH_BRANCH}" = branch-2* ]] ; then + if [[ -n "${HADOOP_PROFILE}" ]] && [[ "${PATCH_BRANCH}" = *"branch-2"* ]] ; then maven_args+=("-Dhadoop.profile=${HADOOP_PROFILE}") fi @@ -580,14 +580,7 @@ function hadoopcheck_rebuild # All supported Hadoop versions that we want to test the compilation with # See the Hadoop section on prereqs in the HBase Reference Guide - if [[ "${PATCH_BRANCH}" = branch-2.4 ]]; then - yetus_info "Setting Hadoop 2 versions to test based on branch-2.4 rules." - if [[ "${QUICK_HADOOPCHECK}" == "true" ]]; then - hbase_hadoop2_versions="2.10.2" - else - hbase_hadoop2_versions="2.10.0 2.10.1 2.10.2" - fi - elif [[ "${PATCH_BRANCH}" = branch-2* ]]; then + if [[ "${PATCH_BRANCH}" = *"branch-2"* ]]; then yetus_info "Setting Hadoop 2 versions to test based on branch-2.5+ rules." hbase_hadoop2_versions="2.10.2" else @@ -595,14 +588,7 @@ function hadoopcheck_rebuild hbase_hadoop2_versions="" fi - if [[ "${PATCH_BRANCH}" = branch-2.4 ]]; then - yetus_info "Setting Hadoop 3 versions to test based on branch-2.4 rules" - if [[ "${QUICK_HADOOPCHECK}" == "true" ]]; then - hbase_hadoop3_versions="3.1.4 3.2.4 3.3.6" - else - hbase_hadoop3_versions="3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6" - fi - elif [[ "${PATCH_BRANCH}" = branch-2.5 ]]; then + if [[ "${PATCH_BRANCH}" = *"branch-2.5"* ]]; then yetus_info "Setting Hadoop 3 versions to test based on branch-2.5 rules" if [[ "${QUICK_HADOOPCHECK}" == "true" ]]; then hbase_hadoop3_versions="3.2.4 3.3.6" @@ -642,7 +628,7 @@ function hadoopcheck_rebuild done hadoop_profile="" - if [[ "${PATCH_BRANCH}" = branch-2* ]]; then + if [[ "${PATCH_BRANCH}" == *"branch-2"* ]]; then hadoop_profile="-Dhadoop.profile=3.0" fi for hadoopver in ${hbase_hadoop3_versions}; do