Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up jdk for jck interactive #4239

Merged
merged 2 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,8 @@ def setup() {
CODE_COVERAGE_OPTION = params.CODE_COVERAGE ? "--code_coverage true" : ""

CURL_OPTS = (params.CURL_OPTS) ? "--curl_opts \"${params.CURL_OPTS}\"" : ""


GET_SH_CMD = "./get.sh -s `pwd`/.. -p $PLATFORM -r ${SDK_RESOURCE} ${JDK_VERSION_OPTION} ${JDK_IMPL_OPTION} ${CUSTOMIZED_SDK_URL_OPTION} ${CLONE_OPENJ9_OPTION} ${OPENJ9_REPO_OPTION} ${OPENJ9_BRANCH_OPTION} ${OPENJ9_SHA_OPTION} ${TKG_REPO_OPTION} ${TKG_BRANCH_OPTION} ${VENDOR_TEST_REPOS} ${VENDOR_TEST_BRANCHES} ${VENDOR_TEST_DIRS} ${VENDOR_TEST_SHAS} ${TEST_IMAGES_REQUIRED} ${DEBUG_IMAGES_REQUIRED} ${CODE_COVERAGE_OPTION} ${CURL_OPTS}"
RESOLVED_MAKE = "if [ `uname` = AIX ] || [ `uname` = SunOS ] || [ `uname` = *BSD ]; then MAKE=gmake; else MAKE=make; fi"

dir( WORKSPACE) {
// use sshagent with Jenkins credentials ID for all platforms except zOS
// on zOS use the user's ssh key
Expand All @@ -441,6 +438,55 @@ def setup() {
}
}

def setup_jck_interactives() {
def targetDir = "${env.WORKSPACE}/../../jck_run/jdk${JDK_VERSION}/jdk"
if (PLATFORM.contains("windows")) {
targetDir = "c:/Users/jenkins/jck_run/jdk${JDK_VERSION}/jdk"
}
def tarBall = CUSTOMIZED_SDK_URL.tokenize('/').last()
echo "tarBall is ${tarBall}"
def jckRunDirExists = sh(script: """
if [ -d "${targetDir}" ]; then
echo true
else
echo false
fi
""", returnStdout: true).toBoolean()

if (jckRunDirExists) {
def jdkDir = ""
if (PLATFORM.contains("windows")) {
jdkDir = sh(script: "unzip -l `pwd`/openjdkbinary/${tarBall} | head -n 4 | tail -n 1 | xargs -n 1 echo | tail -n 1", returnStdout: true).trim().replaceFirst(".\$","")
if (PLATFORM.contains("x86-32_windows")) {
jdkDir = "${jdkDir}_32"
} else if (PLATFORM.contains("x86-64_windows")) {
jdkDir = "${jdkDir}_64"
}
} else {
jdkDir = sh(script: "tar -tf `pwd`/openjdkbinary/${tarBall} | head -1", returnStdout: true).trim().replaceFirst(".\$","")
}
def jckRunDir = "${targetDir}/${jdkDir}"
def jckRunJDKExists = sh(script: """
if [ -d "${jckRunDir}" ]; then
echo true
else
echo false
fi
""", returnStdout: true).toBoolean()

if (!jckRunJDKExists) {
sh returnStatus: true, script: """
cd ${targetDir}
mkdir ${jdkDir}
cd ${jdkDir}
cp -r ${TEST_JDK_HOME}/* .
chgrp -R jck ${targetDir}/${jdkDir}
chmod -R 775 ${targetDir}/${jdkDir}
"""
}
}
}

def getJobProperties() {
def jobProperties = "./aqa-tests/job.properties"
if (fileExists("${jobProperties}")) {
Expand Down Expand Up @@ -470,6 +516,9 @@ def get_sources() {
sh "$GET_SH_CMD"
}
}
if (env.BUILD_LIST.contains('jck') && SDK_RESOURCE.contains('customized' && params.SETUP_JCK_RUN )) {
setup_jck_interactives()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup_jck_interactives() is an additional step added for preparing SDK for JCK interactives. Since it has nothing to do with automatic JCK test execution, I think this setup_jck_interactives() should happen after the test execution in the Post stage

or create its own stage after Post stage. Mixing the step in get_sources() will cause confusion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed putting it at the end. Why we decided not to was, if we wait to do this step in the post stage, due to the long running jck tests, it means that the setup might take several hours (in some cases 12+ hrs), which then reduces our ability to make our target release goals (2 days for primaries, 7 days for secondaries).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that for those not using this approach, the call to setup_jck_interactives() does nearly nothing (checks for existence of a directory that is not present and returns).

}
def makeCompileTest(){
String makeTestCmd = "bash ./compile.sh ${USE_TESTENV_PROPERTIES}"
Expand Down
5 changes: 4 additions & 1 deletion buildenv/jenkins/aqaTestPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def LABEL = (params.LABEL) ?: ""
def LABEL_ADDITION = (params.LABEL_ADDITION) ?: ""
def TEST_FLAG = (params.TEST_FLAG) ?: ""
def APPLICATION_OPTIONS = (params.APPLICATION_OPTIONS) ?: ""
def SETUP_JCK_RUN = params.SETUP_JCK_RUN ?: false


// Use BUILD_USER_ID if set and jdk-JDK_VERSIONS
def DEFAULT_SUFFIX = (env.BUILD_USER_ID) ? "${env.BUILD_USER_ID} - jdk-${params.JDK_VERSIONS}" : "jdk-${params.JDK_VERSIONS}"
Expand Down Expand Up @@ -116,7 +118,8 @@ JDK_VERSIONS.each { JDK_VERSION ->
string(name: 'LABEL_ADDITION', value: LABEL_ADDITION),
string(name: 'TEST_FLAG', value: TEST_FLAG),
string(name: 'APPLICATION_OPTIONS', value: APPLICATION_OPTIONS),
booleanParam(name: 'KEEP_REPORTDIR', value: keep_reportdir)
booleanParam(name: 'KEEP_REPORTDIR', value: keep_reportdir),
booleanParam(name: 'SETUP_JCK_RUN', value: SETUP_JCK_RUN)
], wait: true
def result = downstreamJob.getResult()
echo " ${TEST_JOB_NAME} result is ${result}"
Expand Down
2 changes: 2 additions & 0 deletions buildenv/jenkins/testJobTemplate
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def OPENJ9_REPO = "https://github.com/eclipse-openj9/openj9.git"
def ADOPTOPENJDK_REPO = "https://github.com/adoptium/aqa-tests.git"
def ADOPTOPENJDK_BRANCH = "master"
def USE_TESTENV_PROPERTIES = false
def SETUP_JCK_RUN = false

// Jenkins does not support using Repository URL and Branch build parameters with lightweight checkout together
// (See https://issues.jenkins.io/browse/JENKINS-48431)
Expand Down Expand Up @@ -438,6 +439,7 @@ ARCH_OS_LIST.each { ARCH_OS ->
booleanParam('PERSONAL_BUILD', false, "Is this a personal build?")
booleanParam('USE_TESTENV_PROPERTIES', USE_TESTENV_PROPERTIES.toBoolean(), "use properties defined in the testenv.properties")
stringParam('RERUN_ITERATIONS', RERUN_ITERATIONS, "Optional. Number of times to repeat execution of failed test target(s).")
booleanParam('SETUP_JCK_RUN', SETUP_JCK_RUN.toBoolean(), "setup jdk during release for jck interactive run")
}
cpsScm {
scm {
Expand Down