Skip to content

Commit 6e5b8ee

Browse files
sxagdams
andauthored
Utilise containers in Azure dynamic VMs for AQA runs (#6553)
* docker: switch to a bespoke test container * improve label detection * improve label detection * Switch default container to UBI10 and make XDG_RUNTIME_DIR dynamic Signed-off-by: Stewart X Addison <[email protected]> --------- Signed-off-by: Stewart X Addison <[email protected]> Co-authored-by: George Adams <[email protected]>
1 parent 45008e6 commit 6e5b8ee

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

buildenv/jenkins/JenkinsfileBase

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,14 @@ def setupEnv() {
105105
env.EXIT_FAILURE = params.EXIT_FAILURE ? params.EXIT_FAILURE : false
106106
env.EXIT_SUCCESS = params.EXIT_SUCCESS ? params.EXIT_SUCCESS : false
107107
NUM_MACHINES = params.NUM_MACHINES ? params.NUM_MACHINES.toInteger() : 1
108-
env.LIB_DIR = JOB_NAME.contains("SmokeTests") ? "${WORKSPACE}/../../../../../externalDependency/lib" : "${WORKSPACE}/../../externalDependency/lib"
109-
env.SYSTEM_LIB_DIR = JOB_NAME.contains("SmokeTests") ? "${WORKSPACE}/../../../../../externalDependency/system_lib" : "${WORKSPACE}/../../externalDependency/system_lib"
108+
if (CLOUD_PROVIDER == 'azure') {
109+
// Needs to be inside the workspace as the docker container won't have permissions to write to higher level directories
110+
env.LIB_DIR = "${WORKSPACE}/externalDependency/lib"
111+
env.SYSTEM_LIB_DIR = "${WORKSPACE}/externalDependency/system_lib"
112+
} else {
113+
env.LIB_DIR = JOB_NAME.contains("SmokeTests") ? "${WORKSPACE}/../../../../../externalDependency/lib" : "${WORKSPACE}/../../externalDependency/lib"
114+
env.SYSTEM_LIB_DIR = JOB_NAME.contains("SmokeTests") ? "${WORKSPACE}/../../../../../externalDependency/system_lib" : "${WORKSPACE}/../../externalDependency/system_lib"
115+
}
110116
env.OPENJCEPLUS_GIT_REPO = params.OPENJCEPLUS_GIT_REPO ?: "https://github.com/ibmruntimes/OpenJCEPlus.git"
111117
env.OPENJCEPLUS_GIT_BRANCH = params.OPENJCEPLUS_GIT_BRANCH ?: "semeru-java${params.JDK_VERSION}"
112118
env.PARALLEL = env.PARALLEL ? params.PARALLEL : "None"
@@ -802,9 +808,11 @@ def runTest( ) {
802808
}
803809
for (int i = 1; i <= ITERATIONS; i++) {
804810
echo "ITERATION: ${i}/${ITERATIONS}"
805-
if (env.SPEC.contains('linux') && !(LABEL.contains('ci.agent.dynamic') && CLOUD_PROVIDER == 'azure') && (BUILD_LIST != "external")) {
811+
if (env.SPEC.contains('linux') && (BUILD_LIST != "external")) {
806812
// Detect if Xvfb is on the machine, and if not use the wayland startup code (Initially for EL10)
807813
if ( sh(script:"which Xvfb 2>&1", returnStatus:true) != 0 ) {
814+
env.XDG_RUNTIME_DIR = env.WORKSPACE + "/.xdg-runtime"
815+
sh "mkdir -pm 0700 " + env.XDG_RUNTIME_DIR
808816
sh "mkdir -p -m 1777 /tmp/.X11-unix"
809817
sh "weston --no-config --socket=wayland-vfb --backend=headless-backend.so --xwayland &"
810818
env.DISPLAY = ":0"

buildenv/jenkins/openjdk_tests

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,9 @@ def runTest() {
551551
}
552552
jenkinsfile = load "${WORKSPACE}/aqa-tests/buildenv/jenkins/JenkinsfileBase"
553553
if (LABEL.contains('ci.agent.dynamic') && CLOUD_PROVIDER.equals('azure')) {
554-
//Set dockerimage for azure agent. Fyre has stencil to setup the right environment
555-
docker.image('adoptopenjdk/centos7_build_image').pull()
556-
docker.image('adoptopenjdk/centos7_build_image').inside {
554+
// Set dockerimage for azure agent. Fyre has stencil to setup the right environment
555+
docker.image('ghcr.io/adoptium/test-containers:ubi10').pull()
556+
docker.image('ghcr.io/adoptium/test-containers:ubi10').inside {
557557
jenkinsfile.testBuild()
558558
}
559559
} else if (dockerAgentLabel.equals('default') && LABEL.contains('&&sw.tool.docker') && SPEC.equals('linux_riscv64')) {

0 commit comments

Comments
 (0)