From 30499a8c925705b38066c11a4719c8ad3b1d13df Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Mon, 25 Mar 2024 15:23:49 +0000 Subject: [PATCH 1/3] Fixes to allow use of RHEL downloads for s390x devkit, and support Marist podman UIDs --- pipelines/build/devkit/build_devkit.groovy | 11 +++++++++-- pipelines/build/devkit/make_devkit.sh | 20 ++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/pipelines/build/devkit/build_devkit.groovy b/pipelines/build/devkit/build_devkit.groovy index 6c8f125f8..e5afd757f 100644 --- a/pipelines/build/devkit/build_devkit.groovy +++ b/pipelines/build/devkit/build_devkit.groovy @@ -118,8 +118,15 @@ node(params.DEVKIT_BUILD_NODE) { if (params.DOCKER_IMAGE != "") { // Build within docker container - docker.image(params.DOCKER_IMAGE).pull() - docker.image(params.DOCKER_IMAGE).inside() { + if (!("${params.DOCKER_IMAGE}".contains('rhel'))) { + docker.image(params.DOCKER_IMAGE).pull() + } + String dockerRunArg="" + // Add extra mapping for Marist s390x machiens if running podman + if ( ! sh(script: "docker --version | grep podman", returnStatus:true) ) { + dockerRunArg += " --userns keep-id:uid=1002,gid=1003" + } + docker.image(params.DOCKER_IMAGE).inside(dockerRunArg) { build() } } else { diff --git a/pipelines/build/devkit/make_devkit.sh b/pipelines/build/devkit/make_devkit.sh index 7560c2d18..60666196e 100755 --- a/pipelines/build/devkit/make_devkit.sh +++ b/pipelines/build/devkit/make_devkit.sh @@ -43,9 +43,25 @@ patch -p1 < ../Tools.gmk.patch devkit_target="${ARCH}-linux-gnu" -# Perform devkit build -cd make/devkit && make TARGETS=${devkit_target} BASE_OS=${BASE_OS} BASE_OS_VERSION=${BASE_OS_VERSION} +if [ "${BASE_OS}" = "rhel" ]; then + mkdir -p ../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION} + # Downlod RPMS from RHEL (Requires machine to be attached to RHEL subscription) + RPMDIR=/var/cache/yum/s390x/7Server/rhel-7-for-system-z-rpms/packages + pwd + for A in glibc glibc-headers glibc-devel cups-libs cups-devel libX11 libX11-devel xorg-x11-proto-devel alsa-lib alsa-lib-devel libXext libXext-devel libXtst libXtst-devel libXrender libXrender-devel libXrandr libXrandr-devel freetype freetype-devel libXt libXt-devel libSM libSM-devel libICE libICE-devel libXi libXi-devel libXdmcp libXdmcp-devel libXau libXau-devel libgcc libxcrypt zlib zlib-devel libffi libffi-devel fontconfig fontconfig-devel kernel-headers; do + if [ ! -z "$(ls $RPMDIR/${A}-[0-9]*${ARCH}*.rpm)" ]; then + cp -pv ${RPMDIR}/${A}-[0-9]*${ARCH}*.rpm "../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}" + elif [ ! -z "$(ls $RPMDIR/${A}-[0-9]*noarch.rpm)" ]; then + cp -pv ${RPMDIR}/${A}-[0-9]*noarch.rpm "../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}" + fi + done + # Temporary fudge to use Centos logic until we adjust Tools.gmk + BASE_OS=Centos +fi +# Perform devkit build +cd make/devkit && pwd && make TARGETS=${devkit_target} BASE_OS=${BASE_OS} BASE_OS_VERSION=${BASE_OS_VERSION} +find ../../build/devkit -type f -print # Back to original folder cd ../../.. From 5a4bd16c16883c996db0ff0862c63863b8664f0c Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Wed, 3 Apr 2024 17:03:29 +0100 Subject: [PATCH 2/3] Abstract out VERSION in the devkit script --- pipelines/build/devkit/make_devkit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipelines/build/devkit/make_devkit.sh b/pipelines/build/devkit/make_devkit.sh index 60666196e..5de64b128 100755 --- a/pipelines/build/devkit/make_devkit.sh +++ b/pipelines/build/devkit/make_devkit.sh @@ -44,15 +44,15 @@ patch -p1 < ../Tools.gmk.patch devkit_target="${ARCH}-linux-gnu" if [ "${BASE_OS}" = "rhel" ]; then - mkdir -p ../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION} + mkdir -p ../../../build/devkit/${VERSION}/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION} # Downlod RPMS from RHEL (Requires machine to be attached to RHEL subscription) RPMDIR=/var/cache/yum/s390x/7Server/rhel-7-for-system-z-rpms/packages pwd for A in glibc glibc-headers glibc-devel cups-libs cups-devel libX11 libX11-devel xorg-x11-proto-devel alsa-lib alsa-lib-devel libXext libXext-devel libXtst libXtst-devel libXrender libXrender-devel libXrandr libXrandr-devel freetype freetype-devel libXt libXt-devel libSM libSM-devel libICE libICE-devel libXi libXi-devel libXdmcp libXdmcp-devel libXau libXau-devel libgcc libxcrypt zlib zlib-devel libffi libffi-devel fontconfig fontconfig-devel kernel-headers; do if [ ! -z "$(ls $RPMDIR/${A}-[0-9]*${ARCH}*.rpm)" ]; then - cp -pv ${RPMDIR}/${A}-[0-9]*${ARCH}*.rpm "../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}" + cp -pv ${RPMDIR}/${A}-[0-9]*${ARCH}*.rpm "../../../build/devkit/${VERSION}/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}" elif [ ! -z "$(ls $RPMDIR/${A}-[0-9]*noarch.rpm)" ]; then - cp -pv ${RPMDIR}/${A}-[0-9]*noarch.rpm "../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}" + cp -pv ${RPMDIR}/${A}-[0-9]*noarch.rpm "../../../build/devkit/${VERSION}/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}" fi done # Temporary fudge to use Centos logic until we adjust Tools.gmk From e28915e6de52416e04e282056959a83d4755340b Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Thu, 4 Apr 2024 10:53:34 +0100 Subject: [PATCH 3/3] Remove reference to Marist Signed-off-by: Stewart X Addison --- pipelines/build/devkit/build_devkit.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build/devkit/build_devkit.groovy b/pipelines/build/devkit/build_devkit.groovy index e5afd757f..1d6859a14 100644 --- a/pipelines/build/devkit/build_devkit.groovy +++ b/pipelines/build/devkit/build_devkit.groovy @@ -122,7 +122,7 @@ node(params.DEVKIT_BUILD_NODE) { docker.image(params.DOCKER_IMAGE).pull() } String dockerRunArg="" - // Add extra mapping for Marist s390x machiens if running podman + // Add extra mapping for Adoptium RHEL machines running podman if ( ! sh(script: "docker --version | grep podman", returnStatus:true) ) { dockerRunArg += " --userns keep-id:uid=1002,gid=1003" }