Skip to content

Commit 4037858

Browse files
committed
Use only ubi9 image
This change switches to only using a ubi9 image to align with other projects. Signed-off-by: Evan Lezar <[email protected]>
1 parent fe64609 commit 4037858

File tree

4 files changed

+20
-108
lines changed

4 files changed

+20
-108
lines changed

.github/workflows/image.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ on:
3131
jobs:
3232
build:
3333
runs-on: ubuntu-latest
34-
strategy:
35-
matrix:
36-
dist: [ubuntu20.04, ubi8]
3734
steps:
3835
- uses: actions/checkout@v4
3936
name: Check out code
@@ -72,4 +69,4 @@ jobs:
7269
VERSION: ${COMMIT_SHORT_SHA}
7370
run: |
7471
echo "${VERSION}"
75-
make -f deployments/container/Makefile build-${{ matrix.dist }}
72+
make -f deployments/container/Makefile build

deployments/container/Dockerfile.ubi8 renamed to deployments/container/Dockerfile

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@
1313
# limitations under the License.
1414

1515
ARG GOLANG_VERSION=1.23.1
16-
ARG CUDA_IMAGE=cuda
17-
ARG CUDA_VERSION=11.8.0
18-
ARG BASE_DIST=ubi8
19-
FROM --platform=${TARGETARCH} nvcr.io/nvidia/cuda:${CUDA_VERSION}-base-${BASE_DIST} as build
16+
FROM --platform=${BUILDOS}/amd64 nvcr.io/nvidia/cuda:12.3.2-base-ubi9 AS build
2017

2118
RUN yum install -y \
22-
wget make git gcc \
19+
wget make git gcc-aarch64-linux-gnu gcc \
2320
&& \
2421
rm -rf /var/cache/yum/*
2522

26-
ARG TARGETARCH
2723
ARG GOLANG_VERSION=x.x.x
28-
RUN wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${TARGETARCH}.tar.gz \
24+
RUN wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz \
2925
| tar -C /usr/local -xz
3026

3127
ENV GOPATH /go
@@ -37,19 +33,27 @@ COPY . .
3733
RUN mkdir /artifacts
3834
ARG VERSION="N/A"
3935
ARG GIT_COMMIT="unknown"
40-
RUN make PREFIX=/artifacts cmds
36+
ARG TARGETARCH
37+
38+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
39+
cc=gcc; \
40+
elif [ "$TARGETARCH" = "arm64" ]; then \
41+
cc=aarch64-linux-gnu-gcc; \
42+
fi && \
43+
make CC=${cc} GOARCH=${TARGETARCH} PREFIX=/artifacts cmds
4144

42-
FROM nvcr.io/nvidia/${CUDA_IMAGE}:${CUDA_VERSION}-base-${BASE_DIST}
45+
46+
FROM nvcr.io/nvidia/cuda:12.3.2-base-ubi9
4347

4448
ENV NVIDIA_DISABLE_REQUIRE="true"
4549
ENV NVIDIA_VISIBLE_DEVICES=all
4650
ENV NVIDIA_DRIVER_CAPABILITIES=utility
51+
ARG VERSION="N/A"
52+
ARG GIT_COMMIT="unknown"
4753

4854
LABEL io.k8s.display-name="NVIDIA DRA Driver"
4955
LABEL name="NVIDIA DRA Driver"
5056
LABEL vendor="NVIDIA"
51-
ARG VERSION="N/A"
52-
ARG GIT_COMMIT="unknown"
5357
LABEL version=${VERSION}
5458
LABEL com.nvidia.git-commit="${GIT_COMMIT}"
5559
LABEL release="N/A"
@@ -62,10 +66,3 @@ RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-L
6266
COPY --from=build /artifacts/nvidia-dra-controller /usr/bin/nvidia-dra-controller
6367
COPY --from=build /artifacts/nvidia-dra-plugin /usr/bin/nvidia-dra-plugin
6468
COPY --from=build /build/templates /templates
65-
66-
# Install / upgrade packages here that are required to resolve CVEs
67-
ARG CVE_UPDATES
68-
RUN if [ -n "${CVE_UPDATES}" ]; then \
69-
yum update -y ${CVE_UPDATES} && \
70-
rm -rf /var/cache/yum/*; \
71-
fi

deployments/container/Dockerfile.ubuntu

Lines changed: 0 additions & 77 deletions
This file was deleted.

deployments/container/Makefile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ OUT_IMAGE_TAG = $(OUT_IMAGE_VERSION)-$(DIST)
3838
OUT_IMAGE = $(OUT_IMAGE_NAME):$(OUT_IMAGE_TAG)
3939

4040
##### Public rules #####
41-
DEFAULT_PUSH_TARGET := ubuntu20.04
42-
DISTRIBUTIONS = $(DEFAULT_PUSH_TARGET) ubi8
41+
DEFAULT_PUSH_TARGET := ubi9
42+
DISTRIBUTIONS = $(DEFAULT_PUSH_TARGET)
4343

4444
IMAGE_TARGETS := $(patsubst %,image-%,$(DISTRIBUTIONS))
4545
BUILD_TARGETS := $(patsubst %,build-%,$(DISTRIBUTIONS))
@@ -69,28 +69,23 @@ push-%: DIST = $(*)
6969
push-short: DIST = $(DEFAULT_PUSH_TARGET)
7070

7171
build-%: DIST = $(*)
72-
build-%: DOCKERFILE = $(CURDIR)/deployments/container/Dockerfile.$(DOCKERFILE_SUFFIX)
72+
build-%: DOCKERFILE = $(CURDIR)/deployments/container/Dockerfile
7373

7474
# Use a generic build target to build the relevant images
7575
$(IMAGE_TARGETS): image-%:
7676
DOCKER_BUILDKIT=1 \
7777
$(DOCKER) $(BUILDX) build --pull \
78+
--provenance=false --sbom=false \
7879
$(DOCKER_BUILD_OPTIONS) \
7980
$(DOCKER_BUILD_PLATFORM_OPTIONS) \
8081
--tag $(IMAGE) \
81-
--build-arg BASE_DIST="$(DIST)" \
82-
--build-arg CUDA_VERSION="$(CUDA_VERSION)" \
8382
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
8483
--build-arg VERSION="$(VERSION)" \
8584
--build-arg GIT_COMMIT="$(GIT_COMMIT)" \
8685
$(if $(LABEL_IMAGE_SOURCE),--label "org.opencontainers.image.source=$(LABEL_IMAGE_SOURCE)",) \
8786
-f $(DOCKERFILE) \
8887
$(CURDIR)
8988

90-
build-ubuntu%: DOCKERFILE_SUFFIX := ubuntu
91-
92-
build-ubi8: DOCKERFILE_SUFFIX := ubi8
93-
9489
# Handle the default build target.
9590
.PHONY: build
9691
build: $(DEFAULT_PUSH_TARGET)

0 commit comments

Comments
 (0)