Skip to content

Commit

Permalink
HBASE-28678 Make nightly builds for 3.x java 17 only and add java 17 …
Browse files Browse the repository at this point in the history
…test for 2.x (#6032)

Signed-off-by: Xin Sun <sunxin@apache.org>
(cherry picked from commit 8ff8748)
  • Loading branch information
Apache9 committed Jun 27, 2024
1 parent 5f1aa60 commit c908bb7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
28 changes: 20 additions & 8 deletions dev-support/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -307,7 +307,7 @@ pipeline {
}
}
when {
branch 'branch-2*'
branch '*branch-2*'
}
environment {
BASEDIR = "${env.WORKSPACE}/component"
Expand Down Expand Up @@ -417,6 +417,9 @@ pipeline {
label 'hbase'
}
}
when {
branch '*branch-2*'
}
environment {
BASEDIR = "${env.WORKSPACE}/component"
TESTS = "${env.DEEP_CHECKS}"
Expand Down Expand Up @@ -527,6 +530,9 @@ pipeline {
label 'hbase'
}
}
when {
branch '*branch-2*'
}
environment {
BASEDIR = "${env.WORKSPACE}/component"
TESTS = "${env.DEEP_CHECKS}"
Expand Down Expand Up @@ -633,11 +639,6 @@ pipeline {
}

stage ('yetus jdk17 hadoop3 checks') {
when {
anyOf {
branch 'master';branch 'branch-3'
}
}
agent {
node {
label 'hbase'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1018,3 +1021,12 @@ List<String> getJirasToComment(CharSequence source, List<String> 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"
}
}
24 changes: 5 additions & 19 deletions dev-support/hbase-personality.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -580,29 +580,15 @@ 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
yetus_info "Setting Hadoop 2 versions to null on master/feature branch rules since we do not support hadoop 2 for hbase 3.x any more."
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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c908bb7

Please sign in to comment.