Skip to content

Commit 9ade8f7

Browse files
committed
Merge branch 'cherry_pick_199be59638835e1796f3d80d9d2700a0242a7292' into 'release-0.3'
Cherry-pick: Update cyrus-sasl-lib to address CVE-2022-24407 See merge request nvidia/cloud-native/mig-parted!72
2 parents 0f76c48 + 4e2cc25 commit 9ade8f7

File tree

4 files changed

+82
-3
lines changed

4 files changed

+82
-3
lines changed

.common-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ stages:
3838
.dist-ubi8:
3939
variables:
4040
DIST: "ubi8"
41+
CVE_UPDATES: "cyrus-sasl-lib"
4142

4243
.dist-ubuntu20.04:
4344
variables:
4445
DIST: "ubuntu20.04"
46+
CVE_UPDATES: "libsasl2-2 libsasl2-modules-db"
4547

4648
# Define the platform targets
4749
.platform-amd64:

deployments/gpu-operator/Dockerfile renamed to deployments/gpu-operator/Dockerfile.ubi8

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG BASE_DIST
15+
ARG BASE_DIST=ubi8
1616
ARG CUDA_VERSION
1717
ARG GOLANG_VERSION=x.x.x
1818
ARG VERSION="N/A"
@@ -55,4 +55,11 @@ LABEL name="NVIDIA MIG Manager for Kubernetes"
5555
LABEL summary="NVIDIA MIG Manager for Kubernetes"
5656
LABEL description="See summary"
5757

58+
# Install / upgrade packages here that are required to resolve CVEs
59+
ARG CVE_UPDATES
60+
RUN if [ -n "${CVE_UPDATES}" ]; then \
61+
yum update -y ${CVE_UPDATES} && \
62+
rm -rf /var/cache/yum/*; \
63+
fi
64+
5865
ENTRYPOINT ["nvidia-mig-manager"]
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG BASE_DIST=ubuntu20.04
16+
ARG CUDA_VERSION
17+
ARG GOLANG_VERSION=x.x.x
18+
ARG VERSION="N/A"
19+
20+
# NOTE: In cases where the libc version is a concern, we would have to use an
21+
# image based on the target OS to build the golang executables here -- especially
22+
# if cgo code is included.
23+
FROM golang:${GOLANG_VERSION} AS build
24+
25+
SHELL ["/bin/bash", "-c"]
26+
27+
ARG TARGETARCH
28+
WORKDIR /build
29+
COPY . .
30+
RUN go build -o /artifacts/nvidia-mig-parted ./cmd
31+
RUN go build -o /artifacts/nvidia-mig-manager ./deployments/gpu-operator/
32+
RUN cp ./deployments/gpu-operator/reconfigure-mig.sh /artifacts/reconfigure-mig.sh
33+
34+
RUN OS_ARCH=${TARGETARCH/x86_64/amd64} && OS_ARCH=${OS_ARCH/aarch64/arm64} && curl -o /artifacts/kubectl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${OS_ARCH}/kubectl";
35+
RUN chmod a+x /artifacts/kubectl
36+
37+
FROM nvidia/cuda:${CUDA_VERSION}-base-${BASE_DIST}
38+
39+
COPY ./LICENSE ./licenses/LICENSE
40+
COPY --from=build /artifacts/nvidia-mig-parted /usr/bin/nvidia-mig-parted
41+
COPY --from=build /artifacts/nvidia-mig-manager /usr/bin/nvidia-mig-manager
42+
COPY --from=build /artifacts/reconfigure-mig.sh /usr/bin/reconfigure-mig.sh
43+
COPY --from=build /artifacts/kubectl /usr/bin/kubectl
44+
45+
ENV NVIDIA_DISABLE_REQUIRE="true"
46+
ENV NVIDIA_VISIBLE_DEVICES=all
47+
ENV NVIDIA_MIG_CONFIG_DEVICES=all
48+
ENV NVIDIA_DRIVER_CAPABILITIES=utility
49+
50+
LABEL version="${VERSION}"
51+
LABEL release="N/A"
52+
LABEL vendor="NVIDIA"
53+
LABEL io.k8s.display-name="NVIDIA MIG Manager for Kubernetes"
54+
LABEL name="NVIDIA MIG Manager for Kubernetes"
55+
LABEL summary="NVIDIA MIG Manager for Kubernetes"
56+
LABEL description="See summary"
57+
58+
# Install / upgrade packages here that are required to resolve CVEs
59+
ARG CVE_UPDATES
60+
RUN if [ -n "${CVE_UPDATES}" ]; then \
61+
apt-get update && apt-get upgrade -y ${CVE_UPDATES} && \
62+
rm -rf /var/lib/apt/lists/*; \
63+
fi
64+
65+
ENTRYPOINT ["nvidia-mig-manager"]

deployments/gpu-operator/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ push-%: DIST = $(*)
7070
push-short: DIST = $(DEFAULT_PUSH_TARGET)
7171

7272
build-%: DIST = $(*)
73-
build-%: DOCKERFILE = $(CURDIR)/deployments/gpu-operator/Dockerfile
73+
build-%: DOCKERFILE = $(CURDIR)/deployments/gpu-operator/Dockerfile.$(DOCKERFILE_SUFFIX)
7474

7575
# Use a generic build target to build the relevant images
7676
$(BUILD_TARGETS): build-%: $(ARTIFACTS_ROOT)
@@ -83,5 +83,10 @@ $(BUILD_TARGETS): build-%: $(ARTIFACTS_ROOT)
8383
--build-arg CUDA_VERSION="$(CUDA_VERSION)" \
8484
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
8585
--build-arg VERSION="$(vVERSION)" \
86+
--build-arg CVE_UPDATES="$(CVE_UPDATES)" \
8687
-f $(DOCKERFILE) \
8788
$(CURDIR)
89+
90+
build-ubuntu%: DOCKERFILE_SUFFIX := ubuntu
91+
92+
build-ubi8: DOCKERFILE_SUFFIX := ubi8

0 commit comments

Comments
 (0)