From e19254368f5e3aca222d77d8d5762b99d65e2959 Mon Sep 17 00:00:00 2001 From: Noam Tsemah Date: Mon, 8 Dec 2025 13:37:18 +0200 Subject: [PATCH] [CI] issue: 4705805 Move doca-host installation to image Install doca-host during image build instead of runtime to reduce ci duration and avoid network failures. Signed-off-by: Noam Tsemah --- .ci/dockerfiles/Dockerfile.rhel8.6-inbox | 8 ++++++ .ci/dockerfiles/Dockerfile.rhel8.6.base | 9 ++++++ .ci/dockerfiles/Dockerfile.rhel9.0 | 9 ++++++ .ci/dockerfiles/Dockerfile.rhel9.4 | 6 ++++ .ci/dockerfiles/Dockerfile.sl15sp4 | 9 ++++++ .ci/dockerfiles/Dockerfile.ub22.04 | 9 ++++++ .ci/dockerfiles/Dockerfile.ub24.04 | 9 ++++++ .ci/matrix_job.yaml | 36 ++++++------------------ .ci/proj_jjb.yaml | 11 -------- .ci/scripts/doca_install.sh | 13 +++++---- 10 files changed, 75 insertions(+), 44 deletions(-) create mode 100644 .ci/dockerfiles/Dockerfile.rhel8.6-inbox create mode 100644 .ci/dockerfiles/Dockerfile.rhel8.6.base create mode 100644 .ci/dockerfiles/Dockerfile.rhel9.0 create mode 100644 .ci/dockerfiles/Dockerfile.sl15sp4 create mode 100644 .ci/dockerfiles/Dockerfile.ub22.04 create mode 100644 .ci/dockerfiles/Dockerfile.ub24.04 diff --git a/.ci/dockerfiles/Dockerfile.rhel8.6-inbox b/.ci/dockerfiles/Dockerfile.rhel8.6-inbox new file mode 100644 index 000000000..3ac410918 --- /dev/null +++ b/.ci/dockerfiles/Dockerfile.rhel8.6-inbox @@ -0,0 +1,8 @@ +ARG ARCH=x86_64 +FROM nbu-harbor.gtm.nvidia.com/hpcx/${ARCH}/rhel8.6/builder:inbox + +# Install DOCA +COPY .ci/scripts/doca_install.sh /tmp/doca_install.sh +RUN chmod +x /tmp/doca_install.sh && \ + /tmp/doca_install.sh && \ + rm -f /tmp/doca_install.sh /tmp/GPG-KEY-Mellanox.pub diff --git a/.ci/dockerfiles/Dockerfile.rhel8.6.base b/.ci/dockerfiles/Dockerfile.rhel8.6.base new file mode 100644 index 000000000..52f9e46f0 --- /dev/null +++ b/.ci/dockerfiles/Dockerfile.rhel8.6.base @@ -0,0 +1,9 @@ +ARG ARCH=x86_64 +ARG HARBOR_URL=nbu-harbor.gtm.nvidia.com +FROM ${HARBOR_URL}/hpcx/${ARCH}/rhel8.6/base + +# Install DOCA +COPY .ci/scripts/doca_install.sh /tmp/doca_install.sh +RUN chmod +x /tmp/doca_install.sh && \ + /tmp/doca_install.sh && \ + rm -f /tmp/doca_install.sh /tmp/GPG-KEY-Mellanox.pub diff --git a/.ci/dockerfiles/Dockerfile.rhel9.0 b/.ci/dockerfiles/Dockerfile.rhel9.0 new file mode 100644 index 000000000..3047b0415 --- /dev/null +++ b/.ci/dockerfiles/Dockerfile.rhel9.0 @@ -0,0 +1,9 @@ +ARG ARCH=x86_64 +ARG HARBOR_URL=nbu-harbor.gtm.nvidia.com +FROM ${HARBOR_URL}/hpcx/${ARCH}/rhel9.0/base + +# Install DOCA +COPY .ci/scripts/doca_install.sh /tmp/doca_install.sh +RUN chmod +x /tmp/doca_install.sh && \ + /tmp/doca_install.sh && \ + rm -f /tmp/doca_install.sh /tmp/GPG-KEY-Mellanox.pub diff --git a/.ci/dockerfiles/Dockerfile.rhel9.4 b/.ci/dockerfiles/Dockerfile.rhel9.4 index 7e6fb9530..f77430abe 100644 --- a/.ci/dockerfiles/Dockerfile.rhel9.4 +++ b/.ci/dockerfiles/Dockerfile.rhel9.4 @@ -35,3 +35,9 @@ RUN dnf install --allowerasing -y \ librdmacm unzip patch wget make \ libnl3-devel rpm-build && \ dnf clean all && rm -rf /var/cache/dnf/* + +# Install DOCA +COPY .ci/scripts/doca_install.sh /tmp/doca_install.sh +RUN chmod +x /tmp/doca_install.sh && \ + /tmp/doca_install.sh && \ + rm -f /tmp/doca_install.sh /tmp/GPG-KEY-Mellanox.pub diff --git a/.ci/dockerfiles/Dockerfile.sl15sp4 b/.ci/dockerfiles/Dockerfile.sl15sp4 new file mode 100644 index 000000000..745a2a334 --- /dev/null +++ b/.ci/dockerfiles/Dockerfile.sl15sp4 @@ -0,0 +1,9 @@ +ARG ARCH=x86_64 +ARG HARBOR_URL=nbu-harbor.gtm.nvidia.com +FROM ${HARBOR_URL}/hpcx/${ARCH}/sles15sp4/base + +# Install DOCA +COPY .ci/scripts/doca_install.sh /tmp/doca_install.sh +RUN chmod +x /tmp/doca_install.sh && \ + /tmp/doca_install.sh && \ + rm -f /tmp/doca_install.sh /tmp/GPG-KEY-Mellanox.pub diff --git a/.ci/dockerfiles/Dockerfile.ub22.04 b/.ci/dockerfiles/Dockerfile.ub22.04 new file mode 100644 index 000000000..7bda7a078 --- /dev/null +++ b/.ci/dockerfiles/Dockerfile.ub22.04 @@ -0,0 +1,9 @@ +ARG ARCH=x86_64 +ARG HARBOR_URL=nbu-harbor.gtm.nvidia.com +FROM ${HARBOR_URL}/hpcx/${ARCH}/ubuntu22.04/base + +# Install DOCA +COPY .ci/scripts/doca_install.sh /tmp/doca_install.sh +RUN chmod +x /tmp/doca_install.sh && \ + /tmp/doca_install.sh && \ + rm -f /tmp/doca_install.sh /tmp/GPG-KEY-Mellanox.pub diff --git a/.ci/dockerfiles/Dockerfile.ub24.04 b/.ci/dockerfiles/Dockerfile.ub24.04 new file mode 100644 index 000000000..826d58019 --- /dev/null +++ b/.ci/dockerfiles/Dockerfile.ub24.04 @@ -0,0 +1,9 @@ +ARG ARCH=x86_64 +ARG HARBOR_URL=nbu-harbor.gtm.nvidia.com +FROM ${HARBOR_URL}/hpcx/${ARCH}/ubuntu24.04/base + +# Install DOCA +COPY .ci/scripts/doca_install.sh /tmp/doca_install.sh +RUN chmod +x /tmp/doca_install.sh && \ + /tmp/doca_install.sh && \ + rm -f /tmp/doca_install.sh /tmp/GPG-KEY-Mellanox.pub diff --git a/.ci/matrix_job.yaml b/.ci/matrix_job.yaml index d069e900f..5132ad066 100644 --- a/.ci/matrix_job.yaml +++ b/.ci/matrix_job.yaml @@ -42,15 +42,15 @@ env: runs_on_dockers: # doca-host - - {name: 'rhel8.6-x86_64', url: '${registry_host}/hpcx/x86_64/rhel8.6/base', category: 'base', arch: 'x86_64'} - - {name: 'rhel9.0-x86_64', url: '${registry_host}/hpcx/x86_64/rhel9.0/base', category: 'base', arch: 'x86_64'} - - {name: 'rhel9.4-aarch64', file: '.ci/dockerfiles/Dockerfile.rhel9.4', category: 'base', arch: 'aarch64', tag: '20250203', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=aarch64 --no-cache'} - - {name: 'ub24.04-x86_64', url: '${registry_host}/hpcx/x86_64/ubuntu24.04/base', category: 'base', arch: 'x86_64'} - - {name: 'ub24.04-aarch64', url: '${registry_host}/hpcx/aarch64/ubuntu24.04/base', category: 'base', arch: 'aarch64'} - - {name: 'sl15sp4-x86_64', url: '${registry_host}/hpcx/x86_64/sles15sp4/base', category: 'base', arch: 'x86_64'} - - {name: 'rhel8.6-inbox-x86_64', url: '${registry_host}/hpcx/x86_64/rhel8.6/builder:inbox', category: 'base', arch: 'x86_64'} - - {name: 'ub22.04-x86_64', url: '${registry_host}/hpcx/x86_64/ubuntu22.04/base', category: 'base', arch: 'x86_64'} - - {name: 'ub22.04-aarch64', url: '${registry_host}/hpcx/aarch64/ubuntu22.04/base', category: 'base', arch: 'aarch64'} + - {name: 'rhel8.6-x86_64', file: '.ci/dockerfiles/Dockerfile.rhel8.6.base', category: 'base', arch: 'x86_64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=x86_64 --no-cache'} + - {name: 'rhel9.0-x86_64', file: '.ci/dockerfiles/Dockerfile.rhel9.0', category: 'base', arch: 'x86_64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=x86_64 --no-cache'} + - {name: 'rhel9.4-aarch64', file: '.ci/dockerfiles/Dockerfile.rhel9.4', category: 'base', arch: 'aarch64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=aarch64 --no-cache'} + - {name: 'ub24.04-x86_64', file: '.ci/dockerfiles/Dockerfile.ub24.04', category: 'base', arch: 'x86_64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=x86_64 --no-cache'} + - {name: 'ub24.04-aarch64', file: '.ci/dockerfiles/Dockerfile.ub24.04', category: 'base', arch: 'aarch64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=aarch64 --no-cache'} + - {name: 'sl15sp4-x86_64', file: '.ci/dockerfiles/Dockerfile.sl15sp4', category: 'base', arch: 'x86_64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=x86_64 --no-cache'} + - {name: 'rhel8.6-inbox-x86_64', file: '.ci/dockerfiles/Dockerfile.rhel8.6-inbox', category: 'base', arch: 'x86_64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=x86_64 --no-cache'} + - {name: 'ub22.04-x86_64', file: '.ci/dockerfiles/Dockerfile.ub22.04', category: 'base', arch: 'x86_64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=x86_64 --no-cache'} + - {name: 'ub22.04-aarch64', file: '.ci/dockerfiles/Dockerfile.ub22.04', category: 'base', arch: 'aarch64', tag: '20251208', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=aarch64 --no-cache'} # tool - {name: 'toolbox', url: '${registry_host}/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'} - {name: 'blackduck', file: '.ci/dockerfiles/Dockerfile.rhel8.6', category: 'tool', arch: 'x86_64', tag: '20250630', uri: 'vma/$arch/$name/bduck', build_args: '--no-cache --target bduck'} @@ -111,24 +111,6 @@ steps: archiveArtifacts: '*.html' parallel: false - - name: Install Doca-host - containerSelector: - - "{category: 'base'}" - agentSelector: - - "{nodeLabel: 'skip-agent'}" - run: | - echo "Installing DOCA: ${DOCA_VERSION} ..." - .ci/scripts/doca_install.sh - - - name: Install Doca-host on Tools - run: | - echo "Installing DOCA: ${DOCA_VERSION} ..." - .ci/scripts/doca_install.sh - containerSelector: - - "{name: 'style', category: 'tool'}" - agentSelector: - - "{nodeLabel: 'skip-agent'}" - - name: Autogen run: | ./autogen.sh -s diff --git a/.ci/proj_jjb.yaml b/.ci/proj_jjb.yaml index 5ee4df328..3333fad67 100644 --- a/.ci/proj_jjb.yaml +++ b/.ci/proj_jjb.yaml @@ -31,17 +31,6 @@ name: "DEBUG" default: 0 description: "Enable debug prints and traces, valid values are 0-9." - - string: - name: "DOCA_VERSION" - default: "2.8.0" - description: "DOCA version - see https://developer.nvidia.com/doca-downloads?deployment_platform=Host-Server&deployment_package=DOCA-Host" - - choice: - name: DOCA_BRANCH - choices: - - latest - - stage - - dev - description: "On which DOCA branch to run?" - bool: name: "do_build" default: true diff --git a/.ci/scripts/doca_install.sh b/.ci/scripts/doca_install.sh index 5252ab1cc..1d5b658c0 100755 --- a/.ci/scripts/doca_install.sh +++ b/.ci/scripts/doca_install.sh @@ -4,8 +4,8 @@ set -xvEe -o pipefail DOCA_REPO_PATH="https://doca-repo-prod.nvidia.com/internal/repo/doca" TARGET=${TARGET:=all} -DOCA_VERSION=${DOCA_VERSION:='2.8.0'} -DOCA_BRANCH=${DOCA_BRANCH:="latest"} +DOCA_VERSION='3.2.0' +DOCA_BRANCH="latest" GPG_KEY="GPG-KEY-Mellanox.pub" function error_handler() { @@ -56,7 +56,8 @@ function map_os_and_arch { ;; rhel|ol) - OS="${ID}${VERSION_ID}" + # Extract major version only (e.g., 9.6 -> 9) + OS="${ID}${VERSION_ID%%.*}" GPG_KEY_CMD='rpm --import "${GPG_KEY}"' REPO_CMD='yum install -y yum-utils && yum-config-manager --add-repo "${REPO_URL}"' PKG_MGR="yum --nogpgcheck" @@ -90,7 +91,7 @@ function map_os_and_arch { map_os_and_arch # Install DOCA repo GPG key -${CURL_INSTALL}; curl -o "${GPG_KEY}" "${DOCA_REPO_PATH}/${DOCA_VERSION}/${OS}/${ARCH}/${DOCA_BRANCH}/${GPG_KEY}" +${CURL_INSTALL}; curl -o "${GPG_KEY}" "${DOCA_REPO_PATH}/${DOCA_VERSION}/${OS}/${ARCH}/${DOCA_BRANCH}/${GPG_KEY}" eval "${GPG_KEY_CMD}" # Install DOCA repo @@ -98,12 +99,12 @@ REPO_URL="${DOCA_REPO_PATH}/${DOCA_VERSION}/${OS}/${ARCH}/${DOCA_BRANCH}/" eval "${REPO_CMD}" # Install DOCA -${PKG_MGR} ${UPDATE_CMD} +${PKG_MGR} ${UPDATE_CMD} ${PKG_MGR} install -y doca-ofed-userspace echo "==============================================" -echo +echo echo "DOCA for Host has been successfully installed" echo echo "=============================================="