Skip to content

Portable Container Testing #6188

Description

@llxia

Portable Container Testing (in dev.external) is a scenario designed to validate the JVM feature portability and consistency of Docker containers across different environments. The process involves creating a lightweight Docker container, running tests, pushing it to a Docker registry, then pulling and running it on machines with either the same or different OS/micro-architectures and running tests again. This ensures the container with JVM feature (i.e., CRIU, portable SCC, etc) behaves reliably across micro-architectures.

Currently, we have Portable Container Testing created for CRIU. For details, see

} else if (!JOB_NAME.contains("_imagePull") && !JOB_NAME.contains("_imageUpload") && params.TARGET == "dev.external" ) {
// trigger xxx_imageUpload test job, then xxx_imagePull test job
def commonLabel = "sw.tool.podman&&sw.tool.container.criu"
if (params.LABEL_ADDITION) {
commonLabel += "&&${params.LABEL_ADDITION}"
}
def imageUploadMap = [
'x86-64_linux' : [
['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.22&&hw.arch.x86.broadwell"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.22&&hw.arch.x86.amd"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.x86.broadwell"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.x86.amd"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.x86.skylake"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9&&hw.arch.x86.amd"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9&&hw.arch.x86.broadwell"]
],
'aarch64_linux' : [
// no machine available ['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.20"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.22&&hw.arch.aarch64.armv8"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.aarch64.armv8"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9&&hw.arch.aarch64.armv8"]
],
's390x_linux' : [
['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.22&&hw.arch.s390x.z13"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.22&&hw.arch.s390x.z14"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.22&&hw.arch.s390x.z15"],
// no machine available ['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.s390x.z13"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.s390x.z14"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.s390x.z15"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9&&hw.arch.s390x.z14"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9&&hw.arch.s390x.z15"]
],
'ppc64le_linux' : [
// no machine available ['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.ppc64le.p9"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8&&hw.arch.ppc64le.p10"],
// no machine available ['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9&&hw.arch.ppc64le.p8"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9&&hw.arch.ppc64le.p9"],
// no machine available ['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.98&&hw.arch.ppc64le.p10"],
]
]
def imagePullMap = [
'x86-64_linux' : [
['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.22"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9"]
],
'aarch64_linux' : [
['LABEL_ADDITION' : "${commonLabel}&&sw.os.ubuntu.22"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.8"],
['LABEL_ADDITION' : "${commonLabel}&&sw.os.rhel.9"]
],
's390x_linux' : [
['LABEL_ADDITION' : "${commonLabel}&&hw.arch.s390x.z13"],
['LABEL_ADDITION' : "${commonLabel}&&hw.arch.s390x.z14"],
['LABEL_ADDITION' : "${commonLabel}&&hw.arch.s390x.z15"]
],
'ppc64le_linux' : [
// Temporarily exclude ubuntu 24 machines due to issue runtimes_backlog 1506
['LABEL_ADDITION' : "${commonLabel}&&hw.arch.ppc64le.p10&&!sw.os.ubuntu.24"],
['LABEL_ADDITION' : "${commonLabel}&&hw.arch.ppc64le.p9&&!sw.os.ubuntu.24"]
]
]
if (params.PLATFORM && imageUploadMap[params.PLATFORM] != null && imagePullMap[params.PLATFORM] != null) {
def imageUploadJobName = "${JOB_NAME}_imageUpload"
def imagePullJobName = "${JOB_NAME}_imagePull"
generateJobViaAutoGen(imageUploadJobName)
generateJobViaAutoGen(imagePullJobName)
def imageUploadJobs = [:]
def target = "testList TESTLIST=disabled.criu_pingPerf_testCreateRestoreImageAndPushToRegistry_ubi8,disabled.criu_pingPerf_testCreateRestoreImageAndPushToRegistry_ubi9,disabled.criu-portable-checkpoint_test,disabled.criu-ubi-portable-checkpoint_test"
if (params.PLATFORM == "ppc64le_linux") {
// exclude criu-portable-checkpoint_test on plinux due to github_ibm/runtimes/backlog/issues/1099
target = target.minus("disabled.criu-portable-checkpoint_test,")
}
echo "Trigger ${imageUploadJobName} job ..."
for (int i = 0; i < imageUploadMap[params.PLATFORM].size(); i++) {
def labelAddition = imageUploadMap[params.PLATFORM][i].LABEL_ADDITION
def newParams = ["LABEL_ADDITION" : labelAddition, "TARGET" : "${target}", "DOCKER_REGISTRY_DIR" : "${JOB_NAME}:${BUILD_NUMBER}"]
def childParams = changeParam(params, newParams)
imageUploadJobs["${imageUploadJobName}_${i}]"] = {
build job: imageUploadJobName, parameters: childParams
}
}
parallel imageUploadJobs
def imagePullJobs = [:]
echo "Trigger ${imagePullJobName} job ..."
for (int i = 0; i < imagePullMap[params.PLATFORM].size(); i++) {
def labelAddition = imagePullMap[params.PLATFORM][i].LABEL_ADDITION
def newParams = ["LABEL_ADDITION" : labelAddition, "DOCKER_REGISTRY_DIR" : "${JOB_NAME}:${BUILD_NUMBER}"]
def childParams = changeParam(params, newParams)
imagePullJobs["${imagePullJobName}_${i}]"] = {
build job: imagePullJobName, parameters: childParams
}
}
parallel imagePullJobs
} else {
assert false : "Cannot find key PLATFORM: ${params.PLATFORM} in imageUploadMap: ${imageUploadMap} and/or imagePullMap: ${imagePullMap}."
}
} else {

For portable SCC, we will be testing with different OS and micro-architecture combinations than those used for CRIU. Initially, the portable SCC test scenarios will be added directly to the code. To support future enhancements and additional combinations, we will introduce a config folder to store imageUploadMap and imagePullMap JSON files for each feature. Adding support for a new feature will only require implementing the relevant tests and including the corresponding mapping files in the config folder.

related: automation/issues/294

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions