Skip to content

Commit ffff66b

Browse files
authored
Merge pull request #285 from NVIDIA/precompiledbasemultikernel
base image precompiled multi lts_kernel support
2 parents 710a4a1 + 1c69e42 commit ffff66b

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

.common-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,15 @@ trigger-pipeline:
9393
matrix:
9494
- DRIVER_BRANCH: [535, 550, 570]
9595
KERNEL_FLAVOR: [aws, azure, generic, nvidia, oracle]
96+
LTS_KERNEL: ["5.15"]
9697

9798
# Define the matrix of precompiled jobs that can be run in parallel for ubuntu24.04
9899
.driver-versions-precompiled-ubuntu24.04:
99100
parallel:
100101
matrix:
101102
- DRIVER_BRANCH: [550, 570]
102103
KERNEL_FLAVOR: [aws, azure, generic, nvidia, oracle]
104+
LTS_KERNEL: ["6.8"]
103105

104106
# Define the distribution targets
105107
.dist-ubuntu20.04:

.github/workflows/image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175
make DRIVER_BRANCH=${{ matrix.driver }} KERNEL_FLAVOR=${{ matrix.flavor }} LTS_KERNEL=${LTS_KERNEL} build-base-${BASE_TARGET}
176176
177177
trap "docker rm -f base-${BASE_TARGET}-${{ matrix.flavor }}" EXIT
178-
docker run -d --name base-${BASE_TARGET}-${{ matrix.flavor }} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${{ matrix.flavor }}-${{ matrix.driver }}
178+
docker run -d --name base-${BASE_TARGET}-${{ matrix.flavor }} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${{ matrix.flavor }}-${{ matrix.driver }}
179179
# try 3 times every 10 seconds to get the file, if success exit the loop
180180
for i in {1..3}; do
181181
docker cp base-${BASE_TARGET}-${{ matrix.flavor }}:/var/kernel_version.txt kernel_version.txt && break

.github/workflows/precompiled.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
make DRIVER_BRANCH=${{ matrix.driver_branch }} KERNEL_FLAVOR=${{ matrix.flavor }} LTS_KERNEL=${LTS_KERNEL} build-base-${BASE_TARGET}
111111
112112
trap "docker rm -f base-${BASE_TARGET}-${{ matrix.flavor }}" EXIT
113-
docker run -d --name base-${BASE_TARGET}-${{ matrix.flavor }} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${{ matrix.flavor }}-${{ matrix.driver_branch }}
113+
docker run -d --name base-${BASE_TARGET}-${{ matrix.flavor }} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${{ matrix.flavor }}-${{ matrix.driver_branch }}
114114
# try 3 times every 10 seconds to get the file, if success exit the loop
115115
for i in {1..3}; do
116116
docker cp base-${BASE_TARGET}-${{ matrix.flavor }}:/var/kernel_version.txt kernel_version.txt && break

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,12 @@ build-signed_ubuntu24.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRAN
199199
build-signed_ubuntu24.04%: DOCKER_BUILD_ARGS = --build-arg KERNEL_VERSION="$(KERNEL_VERSION)"
200200

201201
# base is an image used to poll Canonical for the latest kernel version
202+
# LTS_KERNEL must be defined in the environment when invoking this target.
203+
LTS_KERNEL ?= ""
204+
build-base-%: $(if $(LTS_KERNEL),,$(error "LTS_KERNEL is not set"))
202205
build-base-%: DOCKERFILE = $(CURDIR)/base/Dockerfile
203206
build-base-%: TARGET = $(word 3,$(subst -, ,$@))
204-
build-base-%: IMAGE_TAG = base-$(word 3,$(subst -, ,$@))-$(KERNEL_FLAVOR)-$(DRIVER_BRANCH)
207+
build-base-%: IMAGE_TAG = base-$(word 3,$(subst -, ,$@))-$(LTS_KERNEL)-$(KERNEL_FLAVOR)-$(DRIVER_BRANCH)
205208
$(BASE_BUILD_TARGETS):
206209
DOCKER_BUILDKIT=1 \
207210
$(DOCKER) $(BUILDX) build --pull --no-cache \
@@ -217,7 +220,7 @@ $(BASE_BUILD_TARGETS):
217220
$(CURDIR)/base
218221

219222
push-base-%: TARGET = $(word 3,$(subst -, ,$@))
220-
push-base-%: IMAGE_TAG = base-$(word 3,$(subst -, ,$@))-$(KERNEL_FLAVOR)-$(DRIVER_BRANCH)
223+
push-base-%: IMAGE_TAG = base-$(word 3,$(subst -, ,$@))-$(LTS_KERNEL)-$(KERNEL_FLAVOR)-$(DRIVER_BRANCH)
221224
push-base-%: OUT_IMAGE_TAG = ${IMAGE_TAG}
222225
$(BASE_PUSH_TARGETS):
223226
regctl \

scripts/precompiled.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ function sourceVersions(){
2222
fi
2323

2424
if command -v regctl; then
25-
regctl image get-file ghcr.io/nvidia/driver:base-${BASE_TARGET}-${KERNEL_FLAVOR}-${DRIVER_BRANCH} /var/kernel_version.txt kernel_version.txt
25+
regctl image get-file ghcr.io/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${KERNEL_FLAVOR}-${DRIVER_BRANCH} /var/kernel_version.txt kernel_version.txt
2626
else
2727
trap "docker rm -f base-${BASE_TARGET}" EXIT
28-
docker run --pull=always -d --name base-${BASE_TARGET}-${KERNEL_FLAVOR} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${KERNEL_FLAVOR}-${DRIVER_BRANCH}
28+
docker run --pull=always -d --name base-${BASE_TARGET}-${KERNEL_FLAVOR} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${KERNEL_FLAVOR}-${DRIVER_BRANCH}
2929
# try 3 times every 3 seconds to get the file, if success exit the loop
3030
for i in {1..3}; do
3131
docker cp base-${BASE_TARGET}-${KERNEL_FLAVOR}:/var/kernel_version.txt kernel_version.txt && break

0 commit comments

Comments
 (0)