Skip to content

Commit 75dc655

Browse files
Merge pull request #19996 from pshipton/build0.47
(0.47) Backport docker build support for x and p linux for jdk23
2 parents 24752b0 + 6f7b72a commit 75dc655

File tree

2 files changed

+37
-21
lines changed

2 files changed

+37
-21
lines changed

buildenv/jenkins/common/build.groovy

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,12 +814,41 @@ def _build_all() {
814814
}
815815
}
816816

817+
// TODO: remove this workaround when https://github.com/adoptium/infrastructure/issues/3597 resolved. related: infra 9292
818+
def create_docker_image_locally()
819+
{
820+
new_image_name=DOCKER_IMAGE.split(':')[0]+'_cuda'
821+
sh '''
822+
echo 'ARG image
823+
ARG cuda_ver=12.2.0
824+
ARG cuda_distro=ubi8
825+
FROM nvidia/cuda:${cuda_ver}-devel-${cuda_distro} as cuda
826+
FROM $image
827+
RUN mkdir -p /usr/local/cuda/nvvm
828+
COPY --from=cuda /usr/local/cuda/include /usr/local/cuda/include
829+
COPY --from=cuda /usr/local/cuda/nvvm/include /usr/local/cuda/nvvm/include
830+
ENV CUDA_HOME="/usr/local/cuda"' > dockerFile
831+
'''
832+
println "Preparing Docker image ${new_image_name} locally ..."
833+
dockerRegistry = getDockerRegistry(DOCKER_IMAGE)
834+
dockerCredentialID = variableFile.get_user_credentials_id(dockerRegistry.replaceAll('https://','') ?: 'dockerhub')
835+
docker.withRegistry(dockerRegistry, "${dockerCredentialID}") {
836+
docker.build(new_image_name, "--build-arg image=${DOCKER_IMAGE} -f dockerFile .")
837+
}
838+
DOCKER_IMAGE = new_image_name
839+
}
840+
817841
def build_all() {
818842
stage ('Queue') {
819843
timeout(time: 10, unit: 'HOURS') {
820844
node("${NODE}") {
821845
timeout(time: 5, unit: 'HOURS') {
822846
if ("${DOCKER_IMAGE}") {
847+
// TODO: remove this workaround when https://github.com/adoptium/infrastructure/issues/3597 resolved. related: infra 9292
848+
if ((PLATFORM ==~ /ppc64le_linux.*/) ||
849+
((PLATFORM ==~ /x86-64_linux.*/) && ((SDK_VERSION.toLowerCase() == 'next') || (SDK_VERSION.toInteger() >= 17)))) {
850+
create_docker_image_locally()
851+
}
823852
prepare_docker_environment()
824853
docker.image(DOCKER_IMAGE_ID).inside("-v /home/jenkins/openjdk_cache:/home/jenkins/openjdk_cache:rw,z -v /home/jenkins/.ssh:/home/jenkins/.ssh:rw,z") {
825854
_build_all()

buildenv/jenkins/variables/defaults.yml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ boot_jdk_default:
175175
cuda:
176176
extra_configure_options: '--enable-cuda'
177177
#========================================#
178-
# CUDA version 9
179-
#========================================#
180-
cuda_9:
181-
extends: ['cuda']
182-
extra_configure_options: '--with-cuda=/usr/local/cuda-9.0'
183-
#========================================#
184178
# CUDA default version
185179
#========================================#
186180
cuda_default:
@@ -217,7 +211,7 @@ ojdk292:
217211
# Linux PPCLE 64bits
218212
#========================================#
219213
ppc64le_linux:
220-
extends: ['boot_jdk_default', 'cuda_9', 'debuginfo', 'openjdk_reference_repo', 'openssl']
214+
extends: ['boot_jdk_default', 'cuda_default', 'debuginfo', 'openjdk_reference_repo', 'openssl']
221215
boot_jdk:
222216
arch: 'ppc64le'
223217
os: 'linux'
@@ -226,10 +220,11 @@ ppc64le_linux:
226220
8: 'linux-ppc64le-normal-server-release'
227221
11: 'linux-ppc64le-normal-server-release'
228222
node_labels:
229-
build: 'ci.role.build && hw.arch.ppc64le && sw.os.cent.7'
223+
build: 'ci.role.build && hw.arch.ppc64le && sw.tool.docker'
224+
docker_image: 'adoptopenjdk/centos7_build_image:latest'
230225
build_env:
231-
cmd:
232-
all: 'source /home/jenkins/set_gcc_11.2.0_env'
226+
vars:
227+
all: 'CC=/usr/local/gcc11/bin/gcc-11.2 CXX=/usr/local/gcc11/bin/g++-11.2'
233228
#========================================#
234229
# Linux PPCLE 64bits /w JITSERVER
235230
#========================================#
@@ -298,22 +293,14 @@ x86-64_linux:
298293
11: 'linux-x86_64-normal-server-release'
299294
node_labels:
300295
build:
301-
all: 'ci.role.build && hw.arch.x86 && sw.os.cent.7'
302-
8: 'ci.role.build && hw.arch.x86 && sw.tool.docker'
303-
11: 'ci.role.build && hw.arch.x86 && sw.tool.docker'
296+
all: 'ci.role.build && hw.arch.x86 && sw.tool.docker'
304297
docker_image:
305298
8: 'eclipseopenj9/jenkins-agent-x86-centos6:29'
306299
11: 'eclipseopenj9/jenkins-agent-x86-centos6:29'
300+
all: 'adoptopenjdk/centos7_build_image:latest'
307301
build_env:
308-
cmd:
309-
all: 'source /home/jenkins/set_gcc_11.2.0_env'
310-
# use env vars to configure gcc for 8, 11 (v11.2)
311-
8: ''
312-
11: ''
313302
vars:
314-
all: 'OPENJ9_JAVA_OPTIONS=-Xdump:system+java:events=systhrow,filter=java/lang/ClassCastException,request=exclusive+prepwalk+preempt'
315-
8: 'CC=/usr/local/gcc11/bin/gcc-11.2 CXX=/usr/local/gcc11/bin/g++-11.2'
316-
11: 'CC=/usr/local/gcc11/bin/gcc-11.2 CXX=/usr/local/gcc11/bin/g++-11.2'
303+
all: 'CC=/usr/local/gcc11/bin/gcc-11.2 CXX=/usr/local/gcc11/bin/g++-11.2'
317304
extra_test_labels:
318305
11: '!sw.os.cent.6'
319306
17: '!sw.os.cent.6'

0 commit comments

Comments
 (0)