Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to nvcr.io registry and update from ubi8 to ubi9 #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .common-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ stages:
variables:
DIST: ubuntu22.04

.dist-ubi8:
.dist-ubi9:
variables:
DIST: ubi8
DIST: ubi9

# Define the platform targets
.platform-amd64:
Expand Down Expand Up @@ -154,13 +154,13 @@ stages:
OUT_IMAGE_VERSION: "${DEVEL_RELEASE_IMAGE_VERSION}"

# Define the release jobs
release:staging-vectoradd-ubi8:
release:staging-vectoradd-ubi9:
extends:
- .release:staging
- .dist-ubi8
- .dist-ubi9
- .sample-vectoradd
needs:
- image-vectoradd-ubi8
- image-vectoradd-ubi9

release:staging-vectoradd-ubuntu22.04:
extends:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ jobs:
matrix:
dist:
- ubuntu22.04
- ubi8
- ubi9
sample:
- vectorAdd
- nbody
- deviceQuery
exclude:
- dist: ubi8
- dist: ubi9
sample: deviceQuery
- dist: ubi8
- dist: ubi9
sample: nbody

steps:
Expand Down
22 changes: 11 additions & 11 deletions .nvidia-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ image-vectoradd-ubuntu22.04:
- .dist-ubuntu22.04
- .sample-vectoradd

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

image-device-query-ubuntu22.04:
Expand Down Expand Up @@ -160,24 +160,24 @@ scan-device-query-ubuntu22.04-arm64:
- image-device-query-ubuntu22.04
- scan-device-query-ubuntu22.04-amd64

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

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

scan-nbody-ubuntu22.04-amd64:
extends:
Expand Down Expand Up @@ -222,10 +222,10 @@ release:ngc-device-query-ubuntu22.04:
- .dist-ubuntu22.04
- .sample-device-query

release:ngc-vectoradd-ubi8:
release:ngc-vectoradd-ubi9:
extends:
- .release:ngc
- .dist-ubi8
- .dist-ubi9
- .sample-vectoradd

release:ngc-nbody-ubuntu22.04:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM nvidia/cuda:12.6.2-devel-ubi8 AS builder
FROM nvcr.io/nvidia/cuda:12.6.2-devel-ubi9 AS builder

ARG CUDA_VERSION
RUN dnf install -y \
RUN dnf install -y --allowerasing \
curl \
&& \
dnf clean all
Expand All @@ -31,7 +31,7 @@ RUN curl -L https://codeload.github.com/NVIDIA/cuda-samples/tar.gz/refs/tags/${C
make build && \
cp $(find /build/bin -iname "${SAMPLE_NAME}") /build/${SAMPLE_NAME}

FROM nvidia/cuda:12.6.2-base-ubi8
FROM nvcr.io/nvidia/cuda:12.6.2-base-ubi9
ARG SAMPLE_NAME
LABEL io.k8s.display-name="NVIDIA CUDA ${SAMPLE_NAME} sample"
LABEL name="NVIDIA CUDA ${SAMPLE_NAME} sample"
Expand All @@ -43,13 +43,6 @@ LABEL description="See summary"

COPY ./LICENSE ./licenses/LICENSE

# Install / upgrade packages here that are required to resolve CVEs
ARG CVE_UPDATES
RUN if [ -n "${CVE_UPDATES}" ]; then \
yum update -y ${CVE_UPDATES} && \
rm -rf /var/cache/yum/*; \
fi

RUN mkdir -p /cuda-samples
COPY --from=builder /build/${SAMPLE_NAME} /cuda-samples/${SAMPLE_NAME}

Expand Down
21 changes: 5 additions & 16 deletions deployments/container/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM nvidia/cuda:12.6.2-devel-ubuntu22.04 AS builder
FROM nvcr.io/nvidia/cuda:12.6.2-base-ubuntu22.04 AS builder

ARG SAMPLE_NAME
ENV SAMPLE_NAME ${SAMPLE_NAME}

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-nvcc-12-6 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tariq1890 we'd have to do the same for the ubi9 image.

curl \
&& ( \
# The nbody sample requires libGL, libGLU, and libglut
test "${SAMPLE_NAME}" != "nbody" || apt-get install -y --no-install-recommends \
freeglut3-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
) \
g++ freeglut3-dev build-essential libx11-dev \
libxmu-dev libxi-dev libglu1-mesa-dev libfreeimage-dev libglfw3-dev \
&& \
rm -rf /var/lib/apt/lists/*

Expand All @@ -41,7 +37,7 @@ RUN curl -L https://codeload.github.com/NVIDIA/cuda-samples/tar.gz/refs/tags/${C
make build && \
cp $(find /build/bin -iname "${SAMPLE_NAME}") /build/${SAMPLE_NAME}

FROM nvidia/cuda:12.6.2-base-ubuntu22.04
FROM nvcr.io/nvidia/cuda:12.6.2-base-ubuntu22.04
ARG SAMPLE_NAME
LABEL io.k8s.display-name="NVIDIA CUDA ${SAMPLE_NAME} sample"
LABEL name="NVIDIA CUDA ${SAMPLE_NAME} sample"
Expand All @@ -61,13 +57,6 @@ RUN test "${SAMPLE_NAME}" = "nbody" && apt-get update && apt-get install -y --no

COPY ./LICENSE ./licenses/LICENSE

# Install / upgrade packages here that are required to resolve CVEs
ARG CVE_UPDATES
RUN if [ -n "${CVE_UPDATES}" ]; then \
apt-get update && apt-get upgrade -y ${CVE_UPDATES} && \
rm -rf /var/lib/apt/lists/*; \
fi

RUN mkdir -p /cuda-samples
COPY --from=builder /build/${SAMPLE_NAME} /cuda-samples/${SAMPLE_NAME}

Expand Down
5 changes: 2 additions & 3 deletions deployments/container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ OUT_IMAGE_TAG ?= $(LOWER_CASE_SAMPLE)-$(OUT_IMAGE_VERSION)-$(DIST)
OUT_IMAGE = $(OUT_IMAGE_NAME):$(OUT_IMAGE_TAG)

DEFAULT_PUSH_TARGET := ubuntu22.04
DISTRIBUTIONS := ubuntu22.04 ubi8
DISTRIBUTIONS := ubuntu22.04 ubi9

BUILD_TARGETS := $(patsubst %,build-%, $(DISTRIBUTIONS))
PUSH_TARGETS := $(patsubst %,push-%, $(DISTRIBUTIONS))
Expand Down Expand Up @@ -84,7 +84,7 @@ build-%: DOCKERFILE = $(CURDIR)/deployments/container/Dockerfile.$(DOCKERFILE_SU

build-ubuntu%: DOCKERFILE_SUFFIX = ubuntu

build-ubi8: DOCKERFILE_SUFFIX = ubi8
build-ubi9: DOCKERFILE_SUFFIX = ubi9

# Use a generic build target to build the relevant images
$(BUILD_TARGETS): build-%:
Expand All @@ -96,6 +96,5 @@ $(BUILD_TARGETS): build-%:
--tag $(IMAGE) \
--build-arg CUDA_SAMPLES_VERSION="$(CUDA_SAMPLES_VERSION)" \
--build-arg SAMPLE_NAME=$(SAMPLE) \
--build-arg CVE_UPDATES="$(CVE_UPDATES)" \
-f $(DOCKERFILE) \
$(CURDIR)