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

base image precompiled multi lts_kernel support #285

Merged
merged 1 commit into from
Mar 26, 2025
Merged
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
2 changes: 2 additions & 0 deletions .common-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ trigger-pipeline:
matrix:
- DRIVER_BRANCH: [535, 550]
KERNEL_FLAVOR: [aws, azure, generic, nvidia, oracle]
LTS_KERNEL: ["5.15"]
Copy link
Contributor Author

@shivakunv shivakunv Mar 20, 2025

Choose a reason for hiding this comment

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

I'll change it to LTS_KERNEL: ["5.15", "6.8"] later (release of ubuntu22.04 6.8 kernel support)


# Define the matrix of precompiled jobs that can be run in parallel for ubuntu24.04
.driver-versions-precompiled-ubuntu24.04:
parallel:
matrix:
- DRIVER_BRANCH: [550]
KERNEL_FLAVOR: [aws, azure, generic, nvidia, oracle]
LTS_KERNEL: ["6.8"]

# Define the distribution targets
.dist-ubuntu20.04:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
make DRIVER_BRANCH=${{ matrix.driver }} KERNEL_FLAVOR=${{ matrix.flavor }} LTS_KERNEL=${LTS_KERNEL} build-base-${BASE_TARGET}

trap "docker rm -f base-${BASE_TARGET}-${{ matrix.flavor }}" EXIT
docker run -d --name base-${BASE_TARGET}-${{ matrix.flavor }} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${{ matrix.flavor }}-${{ matrix.driver }}
docker run -d --name base-${BASE_TARGET}-${{ matrix.flavor }} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${{ matrix.flavor }}-${{ matrix.driver }}
# try 3 times every 10 seconds to get the file, if success exit the loop
for i in {1..3}; do
docker cp base-${BASE_TARGET}-${{ matrix.flavor }}:/var/kernel_version.txt kernel_version.txt && break
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/precompiled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
make DRIVER_BRANCH=${{ matrix.driver_branch }} KERNEL_FLAVOR=${{ matrix.flavor }} LTS_KERNEL=${LTS_KERNEL} build-base-${BASE_TARGET}

trap "docker rm -f base-${BASE_TARGET}-${{ matrix.flavor }}" EXIT
docker run -d --name base-${BASE_TARGET}-${{ matrix.flavor }} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${{ matrix.flavor }}-${{ matrix.driver_branch }}
docker run -d --name base-${BASE_TARGET}-${{ matrix.flavor }} ghcr.io/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${{ matrix.flavor }}-${{ matrix.driver_branch }}
# try 3 times every 10 seconds to get the file, if success exit the loop
for i in {1..3}; do
docker cp base-${BASE_TARGET}-${{ matrix.flavor }}:/var/kernel_version.txt kernel_version.txt && break
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,12 @@ build-signed_ubuntu24.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRAN
build-signed_ubuntu24.04%: DOCKER_BUILD_ARGS = --build-arg KERNEL_VERSION="$(KERNEL_VERSION)"

# base is an image used to poll Canonical for the latest kernel version
# LTS_KERNEL must be defined in the environment when invoking this target.
LTS_KERNEL ?= ""
build-base-%: $(if $(LTS_KERNEL),,$(error "LTS_KERNEL is not set"))
build-base-%: DOCKERFILE = $(CURDIR)/base/Dockerfile
build-base-%: TARGET = $(word 3,$(subst -, ,$@))
build-base-%: IMAGE_TAG = base-$(word 3,$(subst -, ,$@))-$(KERNEL_FLAVOR)-$(DRIVER_BRANCH)
build-base-%: IMAGE_TAG = base-$(word 3,$(subst -, ,$@))-$(LTS_KERNEL)-$(KERNEL_FLAVOR)-$(DRIVER_BRANCH)
$(BASE_BUILD_TARGETS):
DOCKER_BUILDKIT=1 \
$(DOCKER) $(BUILDX) build --pull --no-cache \
Expand All @@ -215,7 +218,7 @@ $(BASE_BUILD_TARGETS):
$(CURDIR)/base

push-base-%: TARGET = $(word 3,$(subst -, ,$@))
push-base-%: IMAGE_TAG = base-$(word 3,$(subst -, ,$@))-$(KERNEL_FLAVOR)-$(DRIVER_BRANCH)
push-base-%: IMAGE_TAG = base-$(word 3,$(subst -, ,$@))-$(LTS_KERNEL)-$(KERNEL_FLAVOR)-$(DRIVER_BRANCH)
push-base-%: OUT_IMAGE_TAG = ${IMAGE_TAG}
$(BASE_PUSH_TARGETS):
regctl \
Expand Down
4 changes: 2 additions & 2 deletions scripts/precompiled.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ function sourceVersions(){
fi

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