Skip to content

Precompiled images #1879

Precompiled images

Precompiled images #1879

Workflow file for this run

# Copyright 2024 NVIDIA CORPORATION
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Run this workflow on a schedule
name: Precompiled images
on:
schedule:
- cron: '00 09 * * *'
workflow_dispatch:
concurrency:
group: precompiled-driver-build-${{ github.ref }}
cancel-in-progress: false
jobs:
set-driver-version-matrix:
runs-on: linux-amd64-cpu4
outputs:
driver_branch: ${{ steps.generate_matrix_config.outputs.driver_branch }}
exclude_build_matrix_pairs: ${{ steps.generate_matrix_config.outputs.exclude_build_matrix_pairs }}
exclude_precompiled_build_matrix: ${{ steps.generate_matrix_config.outputs.exclude_precompiled_build_matrix }}
exclude_precompiled_e2e_matrix: ${{ steps.generate_matrix_config.outputs.exclude_precompiled_e2e_matrix }}
kernel_flavors: ${{ steps.generate_matrix_config.outputs.kernel_flavors }}
dist: ${{ steps.generate_matrix_config.outputs.dist }}
lts_kernel: ${{ steps.generate_matrix_config.outputs.lts_kernel }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Read driver versions
id: generate_matrix_config
run: |
CONFIG_FILE=.github/precompiled-matrix-config.json
echo "driver_branch=$(jq -c '.driver_branch' "$CONFIG_FILE")" >> "$GITHUB_OUTPUT"
echo "kernel_flavors=$(jq -c '.kernel_flavors' "$CONFIG_FILE")" >> "$GITHUB_OUTPUT"
echo "dist=$(jq -c '.dist' "$CONFIG_FILE")" >> "$GITHUB_OUTPUT"
echo "lts_kernel=$(jq -c '.lts_kernel' "$CONFIG_FILE")" >> "$GITHUB_OUTPUT"
echo "exclude_build_matrix_pairs=$(jq -c '.exclude_build_matrix_pairs' "$CONFIG_FILE")" >> "$GITHUB_OUTPUT"
echo "exclude_precompiled_build_matrix=$(jq -c '.exclude_precompiled_build_matrix' "$CONFIG_FILE")" >> "$GITHUB_OUTPUT"
echo "exclude_precompiled_e2e_matrix=$(jq -c '.exclude_precompiled_e2e_matrix' "$CONFIG_FILE")" >> "$GITHUB_OUTPUT"
precompiled-build-image:
needs: set-driver-version-matrix
runs-on: linux-amd64-cpu4
strategy:
matrix:
driver_branch: ${{ fromJson(needs.set-driver-version-matrix.outputs.driver_branch) }}
flavor: ${{ fromJson(needs.set-driver-version-matrix.outputs.kernel_flavors) }}
dist: ${{ fromJson(needs.set-driver-version-matrix.outputs.dist) }}
lts_kernel: ${{ fromJson(needs.set-driver-version-matrix.outputs.lts_kernel) }}
exclude: ${{ fromJson(needs.set-driver-version-matrix.outputs.exclude_precompiled_build_matrix) }}
max-parallel: 20
steps:
- uses: actions/checkout@v6
name: Check out code
- name: Calculate build vars
id: vars
run: |
echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
REPO_FULL_NAME="${{ github.repository }}"
echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV
GENERATE_ARTIFACTS="false"
echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
echo "BUILD_MULTI_ARCH_IMAGES=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
- name: Set CVE updates
uses: ./.github/actions/set-cve-updates
with:
dist: ${{ matrix.dist }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
image: tonistiigi/binfmt:qemu-v6.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build base image and get kernel version
env:
IMAGE_NAME: ghcr.io/nvidia/driver
LTS_KERNEL: ${{ matrix.lts_kernel }}
run: |
if [[ "${{ matrix.dist }}" == "ubuntu22.04" ]]; then
BASE_TARGET="jammy"
elif [[ "${{ matrix.dist }}" == "ubuntu24.04" ]]; then
BASE_TARGET="noble"
elif [[ "${{ matrix.dist }}" == "ubuntu26.04" ]]; then
BASE_TARGET="resolute"
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
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
sleep 10
done
- name: Build image
env:
IMAGE_NAME: ghcr.io/nvidia/driver
PRECOMPILED: "true"
DIST: signed_${{ matrix.dist }}
run: |
source kernel_version.txt && \
make DRIVER_VERSIONS=${DRIVER_VERSIONS} DRIVER_BRANCH=${{ matrix.driver_branch }} build-${DIST}-${DRIVER_VERSION}
- name: Save base image, build image and kernel version file
env:
DIST: ${{ matrix.dist }}
PRIVATE_REGISTRY: "ghcr.io"
LTS_KERNEL: ${{ matrix.lts_kernel }}
run: |
source kernel_version.txt
if [[ "${{ matrix.dist }}" == "ubuntu22.04" ]]; then
BASE_TARGET="jammy"
elif [[ "${{ matrix.dist }}" == "ubuntu24.04" ]]; then
BASE_TARGET="noble"
elif [[ "${{ matrix.dist }}" == "ubuntu26.04" ]]; then
BASE_TARGET="resolute"
fi
tar -cvf kernel-version-${{ matrix.driver_branch }}-${KERNEL_VERSION}-${DIST}.tar kernel_version.txt
docker save "${PRIVATE_REGISTRY}/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${{ matrix.flavor }}-${{ matrix.driver_branch }}" \
-o ./base-images-${{ matrix.driver_branch }}-${KERNEL_VERSION}-${DIST}.tar
docker save "${PRIVATE_REGISTRY}/nvidia/driver:${{ matrix.driver_branch }}-${KERNEL_VERSION}-${DIST}" \
-o ./driver-images-${{ matrix.driver_branch }}-${KERNEL_VERSION}-${DIST}.tar
# set env for artifacts upload
echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV
echo "DIST=$DIST" >> $GITHUB_ENV
- name: Upload base image as an artifact
uses: actions/upload-artifact@v7
with:
name: base-images-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}
path: ./base-images-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}.tar
retention-days: 1
- name: Upload build image as an artifact
uses: actions/upload-artifact@v7
with:
name: driver-images-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}
path: ./driver-images-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}.tar
retention-days: 1
- name: Upload kernel version as an artifact
uses: actions/upload-artifact@v7
with:
name: kernel-version-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}
path: ./kernel-version-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}.tar
retention-days: 1
determine-e2e-test-matrix:
runs-on: linux-amd64-cpu4
strategy:
matrix:
dist: ${{ fromJson(needs.set-driver-version-matrix.outputs.dist) }}
lts_kernel: ${{ fromJson(needs.set-driver-version-matrix.outputs.lts_kernel) }}
exclude: ${{ fromJson(needs.set-driver-version-matrix.outputs.exclude_precompiled_e2e_matrix) }}
needs:
- precompiled-build-image
- set-driver-version-matrix
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download all kernel-version artifacts
uses: actions/download-artifact@v8
with:
pattern: kernel-version-*
path: ./kernel-version-artifacts
merge-multiple: false
- name: Set kernel version
env:
DIST: ${{ matrix.dist }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LTS_KERNEL: ${{ matrix.lts_kernel }}
run: |
kernel_flavors_json='${{ needs.set-driver-version-matrix.outputs.kernel_flavors }}'
KERNEL_FLAVORS=($(echo "$kernel_flavors_json" | jq -r '.[]'))
driver_branch_json='${{ needs.set-driver-version-matrix.outputs.driver_branch }}'
exclude_pairs_json='${{ needs.set-driver-version-matrix.outputs.exclude_build_matrix_pairs }}'
DRIVER_BRANCHES=()
for branch in $(echo "$driver_branch_json" | jq -r '.[]'); do
if ! echo "$exclude_pairs_json" | jq -e --arg dist "$DIST" --arg driver_branch "$branch" \
'any(.[]; .dist == $dist and .driver_branch == $driver_branch)' > /dev/null; then
DRIVER_BRANCHES+=("$branch")
fi
done
source ./tests/scripts/ci-precompiled-helpers.sh
KERNEL_VERSIONS=($(get_kernel_versions_to_test KERNEL_FLAVORS[@] DRIVER_BRANCHES[@] $DIST $LTS_KERNEL))
if [ -z "$KERNEL_VERSIONS" ]; then
# no new kernel release
echo "Skipping e2e tests"
exit 0
fi
# Convert array to JSON format and assign
echo "[]" > ./matrix_values_${{ matrix.dist }}_${{ matrix.lts_kernel }}.json
printf '%s\n' "${KERNEL_VERSIONS[@]}" | jq -R . | jq -s . > ./matrix_values_${{ matrix.dist }}_${{ matrix.lts_kernel }}.json
- name: Upload kernel matrix values as artifacts
uses: actions/upload-artifact@v7
with:
name: matrix-values-${{ matrix.dist }}-${{ matrix.lts_kernel }}
path: ./matrix_values_${{ matrix.dist }}_${{ matrix.lts_kernel }}.json
retention-days: 1
collect-e2e-test-matrix:
runs-on: linux-amd64-cpu4
needs:
- determine-e2e-test-matrix
- set-driver-version-matrix
outputs:
matrix_values_not_empty: ${{ steps.set_kernel_version.outputs.matrix_values_not_empty }}
matrix_values: ${{ steps.set_kernel_version.outputs.matrix_values }}
exclude_matrix_values: ${{ steps.set_kernel_version.outputs.exclude_matrix_values }}
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Download all matrix artifacts
uses: actions/download-artifact@v8
with:
pattern: matrix-values-*
path: ./matrix-values-artifacts
merge-multiple: false
- name: Set and append matrix values for ubuntu
id: set_kernel_version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "matrix_values_not_empty=0" >> $GITHUB_OUTPUT
kernel_versions=()
# Read and merge kernel_version values from dist files
dist_json='${{ needs.set-driver-version-matrix.outputs.dist }}'
DIST=($(echo "$dist_json" | jq -r '.[]'))
lts_kernel_json='${{ needs.set-driver-version-matrix.outputs.lts_kernel }}'
LTS_KERNEL=($(echo "$lts_kernel_json" | jq -r '.[]'))
for dist in "${DIST[@]}"; do
for kernel in "${LTS_KERNEL[@]}"; do
artifact_name="matrix-values-${dist}-${kernel}"
file_path="./matrix-values-artifacts/${artifact_name}/matrix_values_${dist}_${kernel}.json"
flat_path="./matrix-values-artifacts/matrix_values_${dist}_${kernel}.json"
if [ -f "$file_path" ]; then
echo "Successfully found artifact: $artifact_name at $file_path"
value=$(jq -r '.[]' "$file_path")
kernel_versions+=($value)
echo "matrix_values_not_empty=1" >> $GITHUB_OUTPUT
elif [ -f "$flat_path" ]; then
echo "Successfully found artifact: $artifact_name at $flat_path"
value=$(jq -r '.[]' "$flat_path")
kernel_versions+=($value)
echo "matrix_values_not_empty=1" >> $GITHUB_OUTPUT
else
echo "Artifact not found: $artifact_name"
fi
done
done
echo "Collected Kernel Versions: ${kernel_versions[@]}"
combined_values=$(printf '%s\n' "${kernel_versions[@]}" | jq -R . | jq -s -c . | tr -d ' \n')
echo "Combined Kernel Versions JSON: $combined_values"
# FIXME -- remove once azure kernel upgrade starts working
exclude_combined_values=$(printf '%s\n' "${kernel_versions[@]}" | jq -R . | jq -s -c 'map(select(test("azure")))')
exclude_combined_values=$(echo "$exclude_combined_values" | jq -c '[.[] | {kernel_version: .}]')
echo "exclude_combined_values Kernel Versions : $exclude_combined_values"
# If all collected kernel versions are excluded, treat the matrix as empty so a standalone azure kernel release does not trigger e2e tests.
all_matched=$(echo "$combined_values" | jq -r --argjson exclude "$exclude_combined_values" 'all(. == ($exclude[].kernel_version))')
if [ "$all_matched" = "true" ]; then
echo "matrix_values_not_empty=0" >> $GITHUB_OUTPUT
fi
echo "matrix_values=$combined_values" >> $GITHUB_OUTPUT
echo "exclude_matrix_values=$exclude_combined_values" >> $GITHUB_OUTPUT
published_kernels=$(printf " %s " "${kernel_versions[@]}")
echo "published_kernels=${published_kernels}" >> $GITHUB_OUTPUT
# slack notification for new kernel release before e2e tests starts
# as e2e tests may fail for new kernel release
- name: Slack notification
if: ${{ steps.set_kernel_version.outputs.matrix_values_not_empty == '1' && github.ref == 'refs/heads/main' }}
uses: slackapi/slack-github-action@v3.0.3
with:
token: ${{ secrets.SLACK_BOT_TOKEN }}
method: chat.postMessage
payload: |
{
"channel": "${{ secrets.SLACK_CHANNEL_ID }}",
"text": "${{ secrets.DETECTED_PRECOMPILED_KERNEL_MESSAGE }} ${{ steps.set_kernel_version.outputs.published_kernels }} \n
Details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
e2e-tests-nvidiadriver:
runs-on: linux-amd64-cpu4
needs:
- collect-e2e-test-matrix
- set-driver-version-matrix
if: ${{ needs.collect-e2e-test-matrix.outputs.matrix_values_not_empty == '1' }}
strategy:
matrix:
kernel_version: ${{ fromJson(needs.collect-e2e-test-matrix.outputs.matrix_values) }}
exclude: ${{ fromJson(needs.collect-e2e-test-matrix.outputs.exclude_matrix_values) }}
max-parallel: 5
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download all driver image artifacts
uses: actions/download-artifact@v8
with:
pattern: driver-images-*-${{ matrix.kernel_version }}
path: ./tests/
merge-multiple: true
- name: Set and Calculate test vars
run: |
echo "private_key=${{ github.workspace }}/key.pem" >> $GITHUB_ENV
echo "${{ secrets.AWS_SSH_KEY }}" > ${{ github.workspace }}/key.pem && chmod 400 ${{ github.workspace }}/key.pem
echo "PRIVATE_REGISTRY=ghcr.io" >> $GITHUB_ENV
KERNEL_VERSION="${{ matrix.kernel_version }}"
# Extract the last segment after the last dash
DIST=${KERNEL_VERSION##*-}
echo "DIST=$DIST" >> $GITHUB_ENV
KERNEL_VERSION=${KERNEL_VERSION%-*}
echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV
- name: Configure Holodeck e2e test config (kernel, instance)
run: |
yq eval '.spec += {"kernel": {"version": strenv(KERNEL_VERSION)}}' -i tests/holodeck_ubuntu.yaml
if [[ "$DIST" == "ubuntu24.04" ]]; then
yq eval '.spec.instance.os = "ubuntu-24.04"' -i tests/holodeck_ubuntu.yaml
fi
if [[ "$DIST" == "ubuntu26.04" ]]; then
yq eval '.spec.instance.os = "ubuntu-26.04"' -i tests/holodeck_ubuntu.yaml
fi
- name: Set up Holodeck
uses: NVIDIA/holodeck@v0.3.4
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SSH_KEY: ${{ secrets.AWS_SSH_KEY }}
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_ssh_key: ${{ secrets.AWS_SSH_KEY }}
holodeck_config: "tests/holodeck_ubuntu.yaml"
- name: Get public dns name
id: get_public_dns_name
uses: mikefarah/yq@master
with:
cmd: yq '.status.properties[] | select(.name == "public-dns-name") | .value' /github/workspace/.cache/holodeck.yaml
- name: Calculate holodeck instance hostname
run: |
echo "instance_hostname=ubuntu@${{ steps.get_public_dns_name.outputs.result }}" >> $GITHUB_ENV
- name: Install GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh
- name: Precompiled e2e test gpu driver validation
env:
TEST_CASE: "./tests/cases/nvidia-driver.sh"
GPU_OPERATOR_OPTIONS: "--set driver.repository=${{ env.PRIVATE_REGISTRY }}/nvidia --set driver.usePrecompiled=true \
--set driver.imagePullPolicy=Never"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rc=0
DRIVER_BRANCHES=($(echo '${{ needs.set-driver-version-matrix.outputs.driver_branch }}' | jq -r '.[]'))
EXCLUDE_PAIRS='${{ needs.set-driver-version-matrix.outputs.exclude_build_matrix_pairs }}'
for DRIVER_VERSION in "${DRIVER_BRANCHES[@]}"; do
if echo "$EXCLUDE_PAIRS" | jq -e --arg dist "$DIST" --arg driver_branch "$DRIVER_VERSION" \
'any(.[]; .dist == $dist and .driver_branch == $driver_branch)' > /dev/null; then
continue
fi
echo "Running e2e for DRIVER_VERSION=$DRIVER_VERSION"
status=0
TEST_CASE_ARGS="${GPU_OPERATOR_OPTIONS} --set driver.version=${DRIVER_VERSION}"
# add escape character for space
TEST_CASE_ARGS=$(printf '%q ' "$TEST_CASE_ARGS")
IMAGE_PATH="./tests/driver-images-${DRIVER_VERSION}-${KERNEL_VERSION}-${DIST}.tar"
./tests/ci-run-e2e.sh "${TEST_CASE}" "${TEST_CASE_ARGS}" ${IMAGE_PATH} || status=$?
if [ $status -eq 1 ]; then
echo "e2e validation failed for driver version $DRIVER_VERSION with status $status"
rc=$status
fi
rm -f $IMAGE_PATH
done
./tests/scripts/pull.sh /tmp/logs logs
exit $rc
- name: Archive test logs
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: nvidiadriver-Precompiled-e2e-test-logs
path: ./logs/
retention-days: 15
publish-precompiled-image:
runs-on: linux-amd64-cpu4
needs:
- set-driver-version-matrix
- collect-e2e-test-matrix
- e2e-tests-nvidiadriver
strategy:
matrix:
driver_branch: ${{ fromJson(needs.set-driver-version-matrix.outputs.driver_branch) }}
kernel_version: ${{ fromJson(needs.collect-e2e-test-matrix.outputs.matrix_values) }}
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set image vars
id: set_image_vars
run: |
echo "PRIVATE_REGISTRY=ghcr.io" >> $GITHUB_ENV
KERNEL_VERSION="${{ matrix.kernel_version }}"
DIST="${KERNEL_VERSION##*-}"
echo "run_publish=true" >> $GITHUB_OUTPUT
if echo '${{ needs.set-driver-version-matrix.outputs.exclude_build_matrix_pairs }}' | jq -e \
--arg dist "$DIST" --arg driver_branch "${{ matrix.driver_branch }}" \
'any(.[]; .dist == $dist and .driver_branch == $driver_branch)' > /dev/null; then
echo "run_publish=false" >> $GITHUB_OUTPUT
fi
- name: Download base image artifact
if: steps.set_image_vars.outputs.run_publish == 'true'
uses: actions/download-artifact@v8
with:
name: base-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}
path: ./
- name: Publish base image
if: steps.set_image_vars.outputs.run_publish == 'true'
run: |
LTS_KERNEL=$(echo "${{ matrix.kernel_version }}" | sed -E 's/^([0-9]+\.[0-9]+)\..*/\1/')
KERNEL_FLAVOR=$(echo "${{ matrix.kernel_version }}" | sed -E 's/^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+-(.*)-ubuntu[0-9]+\.[0-9]+$/\1/')
DIST=$(echo "${{ matrix.kernel_version }}" | sed -E 's/^.*-(ubuntu[0-9]+\.[0-9]+)$/\1/')
if [[ "${DIST}" == "ubuntu22.04" ]]; then
BASE_TARGET="jammy"
elif [[ "${DIST}" == "ubuntu24.04" ]]; then
BASE_TARGET="noble"
elif [[ "${DIST}" == "ubuntu26.04" ]]; then
BASE_TARGET="resolute"
fi
image_path="./base-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}.tar"
echo "uploading $image_path"
docker load -i $image_path
if [[ "${{ github.ref == 'refs/heads/main' }}" == "true" ]]; then
docker push ${PRIVATE_REGISTRY}/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${KERNEL_FLAVOR}-${{ matrix.driver_branch }}
else
echo "Skipping base image push for non-main branch ${{ github.ref }}"
fi
- name: Download built image artifact
if: steps.set_image_vars.outputs.run_publish == 'true'
uses: actions/download-artifact@v8
with:
name: driver-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}
path: ./
- name: Publish image
if: steps.set_image_vars.outputs.run_publish == 'true'
run: |
image_path="./driver-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}.tar"
echo "uploading $image_path"
docker load -i $image_path
if [[ "${{ github.ref == 'refs/heads/main' }}" == "true" ]]; then
docker push ${PRIVATE_REGISTRY}/nvidia/driver:${{ matrix.driver_branch }}-${{ matrix.kernel_version }}
else
echo "Skipping image push for non-main branch ${{ github.ref }}"
fi
- name: Slack notification
if: ${{ steps.set_image_vars.outputs.run_publish == 'true' && github.ref == 'refs/heads/main' }}
uses: slackapi/slack-github-action@v3.0.3
with:
token: ${{ secrets.SLACK_BOT_TOKEN }}
method: chat.postMessage
payload: |
{
"channel": "${{ secrets.SLACK_CHANNEL_ID }}",
"text": "${{ secrets.PUBLISHED_PRECOMPILED_IMAGE_MESSAGE }} ${{ env.PRIVATE_REGISTRY }}/nvidia/driver:${{ matrix.driver_branch }}-${{ matrix.kernel_version }}"
}