Skip to content
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
2 changes: 1 addition & 1 deletion .common-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ trigger-pipeline:
parallel:
matrix:
- DRIVER_BRANCH: [580, 595]
KERNEL_FLAVOR: [aws, azure, azure-fde, generic, nvidia, oracle]
KERNEL_FLAVOR: [aws, azure, azure-fde, generic, nvidia, nvidia-64k, oracle]
LTS_KERNEL: ["6.8"]

# Define the matrix of precompiled jobs that can be run in parallel for ubuntu26.04
Expand Down
7 changes: 5 additions & 2 deletions .github/precompiled-matrix-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"driver_branch": ["580", "595"],
"kernel_flavors": ["aws", "azure", "azure-fde", "generic", "nvidia", "oracle"],
"kernel_flavors": ["aws", "azure", "azure-fde", "generic", "nvidia", "nvidia-64k", "oracle"],
"dist": ["ubuntu22.04", "ubuntu24.04", "ubuntu26.04"],
"lts_kernel": ["5.15", "6.8", "7.0"],
"platforms": ["amd64", "arm64"],
Expand All @@ -14,7 +14,10 @@
{ "lts_kernel": "5.15", "dist": "ubuntu26.04" },
{ "lts_kernel": "6.8", "dist": "ubuntu26.04" },
{ "lts_kernel": "7.0", "dist": "ubuntu22.04" },
{ "flavor": "azure-fde", "dist": "ubuntu22.04" }
{ "flavor": "azure-fde", "dist": "ubuntu22.04" },
{ "flavor": "nvidia-64k", "dist": "ubuntu22.04" },
{ "flavor": "nvidia-64k", "dist": "ubuntu26.04" },
{ "flavor": "nvidia-64k", "lts_kernel": "5.15" }
],
"exclude_precompiled_e2e_matrix": [
{ "lts_kernel": "5.15", "dist": "ubuntu24.04" },
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/precompiled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ jobs:
BASE_TARGET="resolute"
fi
# kernel version is the same for amd64 and arm64, so base image is always built for amd64
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/amd64"
# nvidia-64k is arm64-only, so its base image must be built for arm64
if [[ "${{ matrix.flavor }}" == "nvidia-64k" ]]; then
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/arm64"
# --load is required for cross-platform builds so docker run can find the image locally for different host architectures(amd64)
export DOCKER_BUILD_OPTIONS="--load --provenance=false --sbom=false"
else
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/amd64"
fi
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
Expand Down
19 changes: 14 additions & 5 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils git curl && \
rm -rf /var/lib/apt/lists/*

RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble main universe" > /etc/apt/sources.list && \
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble-updates main universe" >> /etc/apt/sources.list && \
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble-security main universe" >> /etc/apt/sources.list && \
echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu noble-updates main restricted" >> /etc/apt/sources.list && \
echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu noble-security main restricted" >> /etc/apt/sources.list && \
RUN ARCH=$(dpkg --print-architecture) && \
# kernel version is the same for amd64 and arm64, so base image is always built for amd64 ( non-nvidia-64k)
# for nvidia-64k is arm64-only, so its base image must be built for arm64
if [ "$ARCH" = "arm64" ]; then \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe" > /etc/apt/sources.list && \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe" >> /etc/apt/sources.list && \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe" >> /etc/apt/sources.list; \
else \
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble main universe" > /etc/apt/sources.list && \
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble-updates main universe" >> /etc/apt/sources.list && \
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble-security main universe" >> /etc/apt/sources.list && \
echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu noble-updates main restricted" >> /etc/apt/sources.list && \
echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu noble-security main restricted" >> /etc/apt/sources.list; \
fi && \
usermod -o -u 0 -g 0 _apt

COPY generate-ci-config /usr/local/bin/generate-ci-config
Expand Down
7 changes: 6 additions & 1 deletion base/generate-ci-config
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ DRIVER_VERSION=$(apt-cache show nvidia-utils-${DRIVER_BRANCH}-server |grep Versi
# Get the latest kernel from linux-signatures-list and linux-images-list
# As list is already sorted , compare the kernel version and find exact match
# get the latest kernel version with tail
SK=$(grep -Fxf <(echo "$SUPPORTED_KERNELS_LINUX_SIGNATURES_LIST") <(echo "$SUPPORTED_KERNELS_LINUX_IMAGE_LIST") | tail -n1)
# linux-signatures-nvidia is not available for arm64 (e.g. nvidia-64k flavor); fall back to linux-image list only
if [ -n "$SUPPORTED_KERNELS_LINUX_SIGNATURES_LIST" ]; then
SK=$(grep -Fxf <(echo "$SUPPORTED_KERNELS_LINUX_SIGNATURES_LIST") <(echo "$SUPPORTED_KERNELS_LINUX_IMAGE_LIST") | tail -n1)
else
SK=$(echo "$SUPPORTED_KERNELS_LINUX_IMAGE_LIST" | tail -n1)
fi

# Write to file
echo "export KERNEL_VERSION=$SK DRIVER_VERSION=$DRIVER_VERSION DRIVER_VERSIONS=$DRIVER_VERSION" > /var/kernel_version.txt
Expand Down
6 changes: 4 additions & 2 deletions multi-arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ $(DRIVER_PUSH_TARGETS): push-%:
# No multi-arch support for the following distributions
build-signed_ubuntu22.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
build-signed_ubuntu26.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64

# nvidia-64k is arm64-only
ifeq ($(KERNEL_FLAVOR),nvidia-64k)
build-signed_ubuntu24.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/arm64
# arm64 does not support azure-fde
ifeq ($(KERNEL_FLAVOR),azure-fde)
else ifeq ($(KERNEL_FLAVOR),azure-fde)
build-signed_ubuntu24.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
endif
29 changes: 22 additions & 7 deletions scripts/precompiled.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,22 @@ function sourceVersions(){
}

function buildBaseImage(){
# Build the base image
# nvidia-64k is arm64-only; its base image must be built for arm64 to find arm64-only kernel packages
if [[ "${KERNEL_FLAVOR}" == "nvidia-64k" ]]; then
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/arm64"
fi
make DRIVER_BRANCH=${DRIVER_BRANCH} KERNEL_FLAVOR=${KERNEL_FLAVOR} build-base-${BASE_TARGET}
}

function buildImage(){
# Build the image. Build multi-arch (amd64+arm64) for ubuntu24.04 except azure-fde
# (linux-objects-nvidia-*-azure-fde is not available for arm64).
if [[ "$DIST" == "signed_ubuntu24.04" ]] && [[ "$KERNEL_FLAVOR" != "azure-fde" ]]; then
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/amd64,linux/arm64"
# Build multi-arch (amd64+arm64) for ubuntu24.04 except azure-fde and nvidia-64k.
# nvidia-64k is arm64-only; azure-fde is not available for arm64.
if [[ "$DIST" == "signed_ubuntu24.04" ]]; then
if [[ "$KERNEL_FLAVOR" == "nvidia-64k" ]]; then
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/arm64"
elif [[ "$KERNEL_FLAVOR" != "azure-fde" ]]; then
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/amd64,linux/arm64"
fi
fi
make DRIVER_VERSIONS=${DRIVER_VERSIONS} DRIVER_BRANCH=${DRIVER_BRANCH} build-${DIST}-${DRIVER_VERSION}
}
Expand Down Expand Up @@ -76,12 +83,20 @@ function pushImage(){
}

function pullImage(){
# pull the image
# nvidia-64k is arm64-only; skip if scanning for amd64
if [[ "${KERNEL_FLAVOR}" == "nvidia-64k" ]] && [[ "${PLATFORM}" == "linux/amd64" ]]; then
echo "nvidia-64k is arm64-only, skipping amd64 pull"
return 0
fi
make DRIVER_VERSIONS=${DRIVER_VERSIONS} DRIVER_BRANCH=${DRIVER_BRANCH} pull-${DIST}-${DRIVER_VERSION}
}

function archiveImage(){
# archive the image
# nvidia-64k is arm64-only; skip if scanning for amd64
if [[ "${KERNEL_FLAVOR}" == "nvidia-64k" ]] && [[ "${PLATFORM}" == "linux/amd64" ]]; then
echo "nvidia-64k is arm64-only, skipping amd64 archive"
return 0
fi
make DRIVER_VERSIONS=${DRIVER_VERSIONS} DRIVER_BRANCH=${DRIVER_BRANCH} archive-${DIST}-${DRIVER_VERSION}
}

Expand Down
8 changes: 7 additions & 1 deletion tests/scripts/build-kernel-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ for PLATFORM in "${PLATFORMS[@]}"; do
done
else
PLATFORM_SUFFIX=""
FLAVORS_FOR_PLATFORM=("${KERNEL_FLAVORS[@]}")
# nvidia-64k is arm64-only
FLAVORS_FOR_PLATFORM=()
for flavor in "${KERNEL_FLAVORS[@]}"; do
if [[ "$flavor" != "nvidia-64k" ]]; then
FLAVORS_FOR_PLATFORM+=("$flavor")
fi
done
fi
KERNEL_VERSIONS=($(get_kernel_versions_to_test FLAVORS_FOR_PLATFORM[@] DRIVER_BRANCHES[@] "$DIST" "$LTS_KERNEL" "$PLATFORM_SUFFIX"))
if [[ ${#KERNEL_VERSIONS[@]} -gt 0 ]]; then
Expand Down
Loading