Skip to content

Commit

Permalink
Merge pull request #930 from elezar/switch-to-ubi9-image
Browse files Browse the repository at this point in the history
Switch to CUDA ubi9 base image
  • Loading branch information
elezar committed Aug 29, 2024
2 parents f21de56 + 0ed7cf9 commit f566a82
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
24 changes: 12 additions & 12 deletions .common-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ trigger-pipeline:
- when: always

# The .dist- dummy steps set the DIST variable for the targeted distribution.
.dist-ubi8:
.dist-ubi9:
variables:
DIST: "ubi8"
DIST: "ubi9"

# Define the platform targets
.platform-amd64:
Expand Down Expand Up @@ -119,22 +119,22 @@ trigger-pipeline:
- .scan-base

# Define the scan targets
scan-ubi8-amd64:
scan-ubi9-amd64:
extends:
- .scan
- .dist-ubi8
- .dist-ubi9
- .platform-amd64
needs:
- image-ubi8
- image-ubi9

scan-ubi8-arm64:
scan-ubi9-arm64:
extends:
- .scan
- .dist-ubi8
- .dist-ubi9
- .platform-arm64
needs:
- image-ubi8
- scan-ubi8-amd64
- image-ubi9
- scan-ubi9-amd64

# Download the regctl binary for use in the release steps
.regctl-setup:
Expand Down Expand Up @@ -203,9 +203,9 @@ scan-ubi8-arm64:
variables:
OUT_IMAGE_VERSION: "${DEVEL_RELEASE_IMAGE_VERSION}"

release:staging-ubi8:
release:staging-ubi9:
extends:
- .release:staging
- .dist-ubi8
- .dist-ubi9
needs:
- image-ubi8
- image-ubi9
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig
E2E_IMAGE_REPO: ghcr.io/nvidia/k8s-device-plugin
E2E_IMAGE_TAG: ${COMMIT_SHORT_SHA}-ubi8
E2E_IMAGE_TAG: ${COMMIT_SHORT_SHA}-ubi9
LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs
run: |
make test-e2e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig
E2E_IMAGE_REPO: ghcr.io/nvidia/k8s-device-plugin
E2E_IMAGE_TAG: ${COMMIT_SHORT_SHA}-ubi8
E2E_IMAGE_TAG: ${COMMIT_SHORT_SHA}-ubi9
LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs
run: |
make test-e2e
Expand Down
16 changes: 8 additions & 8 deletions .nvidia-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ variables:
- regctl registry login "${OUT_REGISTRY}" -u "${OUT_REGISTRY_USER}" -p "${OUT_REGISTRY_TOKEN}"
- make -f deployments/container/Makefile IMAGE=${IN_REGISTRY}/${IN_IMAGE_NAME}:${IN_VERSION}-${DIST} OUT_IMAGE=${OUT_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}-${DIST} push-${DIST}

image-ubi8:
image-ubi9:
extends:
- .image-pull
- .dist-ubi8
- .dist-ubi9

# We skip the integration tests for the internal CI:
.integration:
Expand Down Expand Up @@ -113,10 +113,10 @@ image-ubi8:

# Define the external release targets
# Release to NGC
release:ngc-ubi8:
release:ngc-ubi9:
extends:
- .release:ngc
- .dist-ubi8
- .dist-ubi9

# Define the external image signing steps for NGC
# Download the ngc cli binary for use in the sign steps
Expand Down Expand Up @@ -160,13 +160,13 @@ sign:ngc-short-tag:
extends:
- .sign:ngc
needs:
- release:ngc-ubi8
- release:ngc-ubi9
variables:
IMAGE_TAG: "${CI_COMMIT_TAG}"

sign:ngc-ubi8:
sign:ngc-ubi9:
extends:
- .dist-ubi8
- .dist-ubi9
- .sign:ngc
needs:
- release:ngc-ubi8
- release:ngc-ubi9
8 changes: 4 additions & 4 deletions deployments/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG GOLANG_VERSION=1.22.6
FROM nvcr.io/nvidia/cuda:12.6.0-base-ubi8 AS build
FROM nvcr.io/nvidia/cuda:12.6.0-base-ubi9 AS build

RUN yum install -y \
wget make git gcc \
Expand Down Expand Up @@ -44,14 +44,14 @@ ARG VERSION="N/A"
ARG GIT_COMMIT="unknown"
RUN make PREFIX=/artifacts cmds

# We use the ubi8-minimal image as a reference image in removing unneeded dependencies.
FROM redhat/ubi8-minimal:latest AS minimal
# We use the ubi9-minimal image as a reference image in removing unneeded dependencies.
FROM redhat/ubi9-minimal:latest AS minimal

RUN rpm -qa --queryformat='^%{NAME}-\[0-9\].*\.%{ARCH}$\n' | sort -u > /tmp/package-names.minimal
RUN rpm -qa | sort -u > /tmp/package-list.minimal

# We define the following image as a base image and remove unneeded packages.
FROM nvcr.io/nvidia/cuda:12.6.0-base-ubi8 AS base
FROM nvcr.io/nvidia/cuda:12.6.0-base-ubi9 AS base

WORKDIR /cleanup

Expand Down
2 changes: 1 addition & 1 deletion deployments/container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ OUT_IMAGE_TAG = $(OUT_IMAGE_VERSION)-$(DIST)
OUT_IMAGE = $(OUT_IMAGE_NAME):$(OUT_IMAGE_TAG)

##### Public rules #####
DEFAULT_PUSH_TARGET := ubi8
DEFAULT_PUSH_TARGET := ubi9
DISTRIBUTIONS = $(DEFAULT_PUSH_TARGET)

IMAGE_TARGETS := $(patsubst %,image-%,$(DISTRIBUTIONS))
Expand Down
8 changes: 4 additions & 4 deletions deployments/container/cleanup/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ for key in $(rpm -qa gpg-pubkey*); do
fi
done

dnf clean all
dnf clean -y all
rm -rf /var/cache/dnf

dnf install -y microdnf

microdnf remove $(rpm -q --whatrequires dnf)
microdnf remove -y $(rpm -q --whatrequires dnf)
rpm -e dnf

microdnf remove \
microdnf remove -y \
$(rpm -q --whatrequires /usr/libexec/platform-python) \
$(rpm -q --whatrequires 'python(abi)') \
python* \
dnf*

microdnf remove \
microdnf remove -y \
$(rpm -qa | sort | grep -v -f package-names.minimal -e gpg-pubkey)

# We don't want to add third-party content to the base image and only remove packages.
Expand Down

0 comments on commit f566a82

Please sign in to comment.