Skip to content

Commit 407e80f

Browse files
committed
HBASE-28676 Make pre commit build for 3.x to only run jdk 17 test
1 parent d1015a6 commit 407e80f

3 files changed

Lines changed: 13 additions & 277 deletions

File tree

dev-support/Jenkinsfile_GitHub

Lines changed: 1 addition & 276 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ pipeline {
5656
// stage works in its own subdirectory. there is an "output" under each of these
5757
// directories, which we retrieve after the build is complete.
5858
WORKDIR_REL_GENERAL_CHECK = 'yetus-general-check'
59-
WORKDIR_REL_JDK8_HADOOP3_CHECK = 'yetus-jdk8-hadoop3-check'
60-
WORKDIR_REL_JDK11_HADOOP3_CHECK = 'yetus-jdk11-hadoop3-check'
6159
WORKDIR_REL_JDK17_HADOOP3_CHECK = 'yetus-jdk17-hadoop3-check'
6260
ASF_NIGHTLIES = 'https://nightlies.apache.org'
6361
ASF_NIGHTLIES_BASE_ORI = "${ASF_NIGHTLIES}/hbase/${JOB_NAME}/${BUILD_NUMBER}"
@@ -82,8 +80,7 @@ pipeline {
8280
environment {
8381
// customized per parallel stage
8482
PLUGINS = "${GENERAL_CHECK_PLUGINS}"
85-
SET_JAVA_HOME = "/usr/lib/jvm/java-11"
86-
JAVA8_HOME = "/usr/lib/jvm/java-8"
83+
SET_JAVA_HOME = "/usr/lib/jvm/java-17"
8784
HADOOP_PROFILE = '3.0'
8885
WORKDIR_REL = "${WORKDIR_REL_GENERAL_CHECK}"
8986
// identical for all parallel stages
@@ -202,278 +199,6 @@ pipeline {
202199
}
203200
}
204201
}
205-
stage ('yetus jdk8 Hadoop3 checks') {
206-
agent {
207-
node {
208-
label 'hbase'
209-
}
210-
}
211-
environment {
212-
// customized per parallel stage
213-
PLUGINS = "${JDK_SPECIFIC_PLUGINS}"
214-
SET_JAVA_HOME = '/usr/lib/jvm/java-8'
215-
WORKDIR_REL = "${WORKDIR_REL_JDK8_HADOOP3_CHECK}"
216-
// identical for all parallel stages
217-
WORKDIR = "${WORKSPACE}/${WORKDIR_REL}"
218-
YETUSDIR = "${WORKDIR}/${YETUS_REL}"
219-
SOURCEDIR = "${WORKDIR}/${SRC_REL}"
220-
PATCHDIR = "${WORKDIR}/${PATCH_REL}"
221-
BUILD_URL_ARTIFACTS = "artifact/${WORKDIR_REL}/${PATCH_REL}"
222-
DOCKERFILE = "${WORKDIR}/${DOCKERFILE_REL}"
223-
YETUS_DRIVER = "${WORKDIR}/${YETUS_DRIVER_REL}"
224-
SKIP_ERRORPRONE = true
225-
}
226-
when {
227-
// this will return true if the pipeline is building a change request, such as a GitHub pull request.
228-
changeRequest()
229-
}
230-
steps {
231-
dir("${SOURCEDIR}") {
232-
checkout scm
233-
}
234-
dir("${YETUSDIR}") {
235-
sh'''#!/usr/bin/env bash
236-
wget https://dlcdn.apache.org/yetus/${YETUS_VERSION}/apache-yetus-${YETUS_VERSION}-bin.tar.gz && \
237-
tar --strip-components=1 -xzf apache-yetus-${YETUS_VERSION}-bin.tar.gz && \
238-
rm apache-yetus-${YETUS_VERSION}-bin.tar.gz
239-
'''
240-
}
241-
dir("${WORKDIR}") {
242-
withCredentials([
243-
usernamePassword(
244-
credentialsId: 'apache-hbase-at-github.zerozr99.workers.dev',
245-
passwordVariable: 'GITHUB_PASSWORD',
246-
usernameVariable: 'GITHUB_USER'
247-
)]) {
248-
script {
249-
def ret = sh(
250-
label: 'test-patch',
251-
returnStatus: true,
252-
script: '''#!/bin/bash -e
253-
hostname -a ; pwd ; ls -la
254-
printenv 2>&1 | sort
255-
echo "[INFO] Launching Yetus via ${YETUS_DRIVER}"
256-
"${YETUS_DRIVER}"
257-
'''
258-
)
259-
if (ret != 0) {
260-
// mark the build as UNSTABLE instead of FAILURE, to avoid skipping the later publish of
261-
// test output. See HBASE-26339 for more details.
262-
currentBuild.result = 'UNSTABLE'
263-
}
264-
}
265-
}
266-
}
267-
}
268-
post {
269-
always {
270-
junit testResults: "${WORKDIR_REL}/${SRC_REL}/**/target/**/TEST-*.xml",
271-
allowEmptyResults: true, skipPublishingChecks: true
272-
sh label: 'zip surefire reports', script: '''#!/bin/bash -e
273-
if [ -d "${PATCHDIR}/archiver" ]; then
274-
count=$(find "${PATCHDIR}/archiver" -type f | wc -l)
275-
if [[ 0 -ne ${count} ]]; then
276-
echo "zipping ${count} archived files"
277-
zip -q -m -r "${PATCHDIR}/test_logs.zip" "${PATCHDIR}/archiver"
278-
else
279-
echo "No archived files, skipping compressing."
280-
fi
281-
else
282-
echo "No archiver directory, skipping compressing."
283-
fi
284-
'''
285-
sshPublisher(publishers: [
286-
sshPublisherDesc(configName: 'Nightlies',
287-
transfers: [
288-
sshTransfer(remoteDirectory: "hbase/${JOB_NAME}/${BUILD_NUMBER}",
289-
sourceFiles: "${env.WORKDIR_REL}/${env.PATCH_REL}/test_logs.zip"
290-
)
291-
]
292-
)
293-
])
294-
// remove the big test logs zip file, store the nightlies url in test_logs.txt
295-
sh '''#!/bin/bash -e
296-
if [ -f "${PATCHDIR}/test_logs.zip" ]; then
297-
echo "Remove ${PATCHDIR}/test_logs.zip for saving space"
298-
rm -rf "${PATCHDIR}/test_logs.zip"
299-
python3 ${SOURCEDIR}/dev-support/gen_redirect_html.py "${ASF_NIGHTLIES_BASE}/${WORKDIR_REL}/${PATCH_REL}" > "${PATCHDIR}/test_logs.html"
300-
else
301-
echo "No test_logs.zip, skipping"
302-
fi
303-
'''
304-
// Has to be relative to WORKSPACE.
305-
archiveArtifacts artifacts: "${WORKDIR_REL}/${PATCH_REL}/*", excludes: "${WORKDIR_REL}/${PATCH_REL}/precommit"
306-
archiveArtifacts artifacts: "${WORKDIR_REL}/${PATCH_REL}/**/*", excludes: "${WORKDIR_REL}/${PATCH_REL}/precommit/**/*"
307-
publishHTML target: [
308-
allowMissing: true,
309-
keepAll: true,
310-
alwaysLinkToLastBuild: true,
311-
// Has to be relative to WORKSPACE
312-
reportDir: "${WORKDIR_REL}/${PATCH_REL}",
313-
reportFiles: 'report.html',
314-
reportName: 'PR JDK8 Hadoop3 Check Report'
315-
]
316-
}
317-
// Jenkins pipeline jobs fill slaves on PRs without this :(
318-
cleanup() {
319-
script {
320-
sh label: 'Cleanup workspace', script: '''#!/bin/bash -e
321-
# See YETUS-764
322-
if [ -f "${PATCHDIR}/pidfile.txt" ]; then
323-
echo "test-patch process appears to still be running: killing"
324-
kill `cat "${PATCHDIR}/pidfile.txt"` || true
325-
sleep 10
326-
fi
327-
if [ -f "${PATCHDIR}/cidfile.txt" ]; then
328-
echo "test-patch container appears to still be running: killing"
329-
docker kill `cat "${PATCHDIR}/cidfile.txt"` || true
330-
fi
331-
# See HADOOP-13951
332-
chmod -R u+rxw "${WORKSPACE}"
333-
'''
334-
dir ("${WORKDIR}") {
335-
deleteDir()
336-
}
337-
}
338-
}
339-
}
340-
}
341-
stage ('yetus jdk11 hadoop3 checks') {
342-
agent {
343-
node {
344-
label 'hbase'
345-
}
346-
}
347-
environment {
348-
// customized per parallel stage
349-
PLUGINS = "${JDK_SPECIFIC_PLUGINS}"
350-
SET_JAVA_HOME = '/usr/lib/jvm/java-11'
351-
WORKDIR_REL = "${WORKDIR_REL_JDK11_HADOOP3_CHECK}"
352-
// identical for all parallel stages
353-
WORKDIR = "${WORKSPACE}/${WORKDIR_REL}"
354-
YETUSDIR = "${WORKDIR}/${YETUS_REL}"
355-
SOURCEDIR = "${WORKDIR}/${SRC_REL}"
356-
PATCHDIR = "${WORKDIR}/${PATCH_REL}"
357-
BUILD_URL_ARTIFACTS = "artifact/${WORKDIR_REL}/${PATCH_REL}"
358-
DOCKERFILE = "${WORKDIR}/${DOCKERFILE_REL}"
359-
YETUS_DRIVER = "${WORKDIR}/${YETUS_DRIVER_REL}"
360-
SKIP_ERRORPRONE = true
361-
}
362-
when {
363-
// this will return true if the pipeline is building a change request, such as a GitHub pull request.
364-
changeRequest()
365-
}
366-
steps {
367-
dir("${SOURCEDIR}") {
368-
checkout scm
369-
}
370-
dir("${YETUSDIR}") {
371-
sh'''#!/usr/bin/env bash
372-
wget https://dlcdn.apache.org/yetus/${YETUS_VERSION}/apache-yetus-${YETUS_VERSION}-bin.tar.gz && \
373-
tar --strip-components=1 -xzf apache-yetus-${YETUS_VERSION}-bin.tar.gz && \
374-
rm apache-yetus-${YETUS_VERSION}-bin.tar.gz
375-
'''
376-
}
377-
dir("${WORKDIR}") {
378-
withCredentials([
379-
usernamePassword(
380-
credentialsId: 'apache-hbase-at-github.zerozr99.workers.dev',
381-
passwordVariable: 'GITHUB_PASSWORD',
382-
usernameVariable: 'GITHUB_USER'
383-
)]) {
384-
script {
385-
def ret = sh(
386-
label: 'test-patch',
387-
returnStatus: true,
388-
script: '''#!/bin/bash -e
389-
hostname -a ; pwd ; ls -la
390-
printenv 2>&1 | sort
391-
echo "[INFO] Launching Yetus via ${YETUS_DRIVER}"
392-
"${YETUS_DRIVER}"
393-
'''
394-
)
395-
if (ret != 0) {
396-
// mark the build as UNSTABLE instead of FAILURE, to avoid skipping the later publish of
397-
// test output. See HBASE-26339 for more details.
398-
currentBuild.result = 'UNSTABLE'
399-
}
400-
}
401-
}
402-
}
403-
}
404-
post {
405-
always {
406-
junit testResults: "${WORKDIR_REL}/${SRC_REL}/**/target/**/TEST-*.xml",
407-
allowEmptyResults: true, skipPublishingChecks: true
408-
sh label: 'zip surefire reports', script: '''#!/bin/bash -e
409-
if [ -d "${PATCHDIR}/archiver" ]; then
410-
count=$(find "${PATCHDIR}/archiver" -type f | wc -l)
411-
if [[ 0 -ne ${count} ]]; then
412-
echo "zipping ${count} archived files"
413-
zip -q -m -r "${PATCHDIR}/test_logs.zip" "${PATCHDIR}/archiver"
414-
else
415-
echo "No archived files, skipping compressing."
416-
fi
417-
else
418-
echo "No archiver directory, skipping compressing."
419-
fi
420-
'''
421-
sshPublisher(publishers: [
422-
sshPublisherDesc(configName: 'Nightlies',
423-
transfers: [
424-
sshTransfer(remoteDirectory: "hbase/${JOB_NAME}/${BUILD_NUMBER}",
425-
sourceFiles: "${env.WORKDIR_REL}/${env.PATCH_REL}/test_logs.zip"
426-
)
427-
]
428-
)
429-
])
430-
// remove the big test logs zip file, store the nightlies url in test_logs.txt
431-
sh '''#!/bin/bash -e
432-
if [ -f "${PATCHDIR}/test_logs.zip" ]; then
433-
echo "Remove ${PATCHDIR}/test_logs.zip for saving space"
434-
rm -rf "${PATCHDIR}/test_logs.zip"
435-
python3 ${SOURCEDIR}/dev-support/gen_redirect_html.py "${ASF_NIGHTLIES_BASE}/${WORKDIR_REL}/${PATCH_REL}" > "${PATCHDIR}/test_logs.html"
436-
else
437-
echo "No test_logs.zip, skipping"
438-
fi
439-
'''
440-
// Has to be relative to WORKSPACE.
441-
archiveArtifacts artifacts: "${WORKDIR_REL}/${PATCH_REL}/*", excludes: "${WORKDIR_REL}/${PATCH_REL}/precommit"
442-
archiveArtifacts artifacts: "${WORKDIR_REL}/${PATCH_REL}/**/*", excludes: "${WORKDIR_REL}/${PATCH_REL}/precommit/**/*"
443-
publishHTML target: [
444-
allowMissing: true,
445-
keepAll: true,
446-
alwaysLinkToLastBuild: true,
447-
// Has to be relative to WORKSPACE
448-
reportDir: "${WORKDIR_REL}/${PATCH_REL}",
449-
reportFiles: 'report.html',
450-
reportName: 'PR JDK11 Hadoop3 Check Report'
451-
]
452-
}
453-
// Jenkins pipeline jobs fill slaves on PRs without this :(
454-
cleanup() {
455-
script {
456-
sh label: 'Cleanup workspace', script: '''#!/bin/bash -e
457-
# See YETUS-764
458-
if [ -f "${PATCHDIR}/pidfile.txt" ]; then
459-
echo "test-patch process appears to still be running: killing"
460-
kill `cat "${PATCHDIR}/pidfile.txt"` || true
461-
sleep 10
462-
fi
463-
if [ -f "${PATCHDIR}/cidfile.txt" ]; then
464-
echo "test-patch container appears to still be running: killing"
465-
docker kill `cat "${PATCHDIR}/cidfile.txt"` || true
466-
fi
467-
# See HADOOP-13951
468-
chmod -R u+rxw "${WORKSPACE}"
469-
'''
470-
dir ("${WORKDIR}") {
471-
deleteDir()
472-
}
473-
}
474-
}
475-
}
476-
}
477202
stage ('yetus jdk17 hadoop3 checks') {
478203
agent {
479204
node {

hbase-build-configuration/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,18 @@
7777
<configuration>
7878
<release>${releaseTarget}</release>
7979
<showWarnings>true</showWarnings>
80+
<fork>true</fork>
8081
<compilerArgs>
82+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
83+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
84+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
85+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
86+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
87+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
88+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
89+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
90+
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
91+
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
8192
<arg>-XDcompilePolicy=simple</arg>
8293
<!-- All -Xep need to be on single line see: https://github.com/google/error-prone/pull/1115 -->
8394
<arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -XepExcludedPaths:.*/target/.* -Xep:FallThrough:OFF -Xep:MutablePublicArray:OFF -Xep:ClassNewInstance:ERROR -Xep:MissingDefault:ERROR -Xep:BanJNDI:WARN</arg>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@
809809
<tar.name>${project.build.finalName}.tar.gz</tar.name>
810810
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm</maven.build.timestamp.format>
811811
<buildDate>${maven.build.timestamp}</buildDate>
812-
<compileSource>1.8</compileSource>
812+
<compileSource>17</compileSource>
813813
<releaseTarget>8</releaseTarget>
814814
<!-- Build dependencies -->
815815
<!-- The $revision feature is introduced in 3.5.0 -->

0 commit comments

Comments
 (0)