Skip to content

Commit f31d7a5

Browse files
authored
Merge pull request #218 from NVIDIA/tagcommittshaimage
Add the commit SHA tag during building of precompiled image
2 parents da308fd + b00fe8d commit f31d7a5

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

.github/workflows/precompiled.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ jobs:
7676
env:
7777
DIST: ${{ matrix.dist }}
7878
run: |
79-
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
8079
echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
8180
REPO_FULL_NAME="${{ github.repository }}"
8281
echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV
@@ -103,7 +102,6 @@ jobs:
103102
- name: Build base image and get kernel version
104103
env:
105104
IMAGE_NAME: ghcr.io/nvidia/driver
106-
VERSION: ${COMMIT_SHORT_SHA}
107105
BASE_TARGET: ${{ needs.set-driver-version-matrix.outputs[env.VAR_NAME_BASE_TARGET] }}
108106
LTS_KERNEL: ${{ needs.set-driver-version-matrix.outputs[env.VAR_NAME_LTS_KERNEL] }}
109107
run: |
@@ -119,7 +117,6 @@ jobs:
119117
- name: Build image
120118
env:
121119
IMAGE_NAME: ghcr.io/nvidia/driver
122-
VERSION: ${COMMIT_SHORT_SHA}
123120
PRECOMPILED: "true"
124121
DIST: signed_${{ matrix.dist }}
125122
run: |
@@ -285,7 +282,6 @@ jobs:
285282
run: |
286283
echo "private_key=${{ github.workspace }}/key.pem" >> $GITHUB_ENV
287284
echo "${{ secrets.AWS_SSH_KEY }}" > ${{ github.workspace }}/key.pem && chmod 400 ${{ github.workspace }}/key.pem
288-
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
289285
echo "PRIVATE_REGISTRY=ghcr.io" >> $GITHUB_ENV
290286
KERNEL_VERSION="${{ matrix.kernel_version }}"
291287
# Extract the last segment after the last dash

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ pull-signed_ubuntu20.04%: DRIVER_TAG = $(DRIVER_BRANCH)
9090

9191
pull-signed_ubuntu22.04%: DIST = ubuntu22.04
9292
pull-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
93-
pull-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
93+
pull-signed_ubuntu22.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
9494

9595
pull-signed_ubuntu24.04%: DIST = ubuntu24.04
9696
pull-signed_ubuntu24.04%: DRIVER_TAG = $(DRIVER_BRANCH)
97-
pull-signed_ubuntu24.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
97+
pull-signed_ubuntu24.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
9898

9999
PLATFORM ?= linux/amd64
100100
$(DRIVER_PULL_TARGETS): pull-%:
@@ -111,11 +111,11 @@ archive-signed_ubuntu20.04%: DRIVER_TAG = $(DRIVER_BRANCH)
111111

112112
archive-signed_ubuntu22.04%: DIST = ubuntu22.04
113113
archive-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
114-
archive-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
114+
archive-signed_ubuntu22.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
115115

116116
archive-signed_ubuntu24.04%: DIST = ubuntu24.04
117117
archive-signed_ubuntu24.04%: DRIVER_TAG = $(DRIVER_BRANCH)
118-
archive-signed_ubuntu24.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
118+
archive-signed_ubuntu24.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
119119

120120
$(DRIVER_ARCHIVE_TARGETS): archive-%:
121121
$(DOCKER) save "$(IMAGE)" -o "archive.tar"
@@ -135,13 +135,13 @@ push-signed_ubuntu20.04%: DRIVER_TAG = $(DRIVER_BRANCH)
135135

136136
push-signed_ubuntu22.04%: DIST = ubuntu22.04
137137
push-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
138-
push-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
139-
push-signed_ubuntu22.04%: OUT_IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
138+
push-signed_ubuntu22.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
139+
push-signed_ubuntu22.04%: OUT_IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
140140

141141
push-signed_ubuntu24.04%: DIST = ubuntu24.04
142142
push-signed_ubuntu24.04%: DRIVER_TAG = $(DRIVER_BRANCH)
143-
push-signed_ubuntu24.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
144-
push-signed_ubuntu24.04%: OUT_IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
143+
push-signed_ubuntu24.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
144+
push-signed_ubuntu24.04%: OUT_IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
145145

146146
# $(DRIVER_BUILD_TARGETS) is in the form of build-$(DIST)-$(DRIVER_VERSION)
147147
# Parse the target to set the required variables.
@@ -186,14 +186,14 @@ build-signed_ubuntu20.04%: DRIVER_TAG = $(DRIVER_BRANCH)
186186
build-signed_ubuntu22.04%: DIST = ubuntu22.04
187187
build-signed_ubuntu22.04%: SUBDIR = ubuntu22.04/precompiled
188188
build-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
189-
build-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
189+
build-signed_ubuntu22.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
190190
build-signed_ubuntu22.04%: DOCKER_BUILD_ARGS = --build-arg KERNEL_VERSION="$(KERNEL_VERSION)"
191191

192192
# ubuntu24.04 Precompiled Driver
193193
build-signed_ubuntu24.04%: DIST = ubuntu24.04
194194
build-signed_ubuntu24.04%: SUBDIR = ubuntu24.04/precompiled
195195
build-signed_ubuntu24.04%: DRIVER_TAG = $(DRIVER_BRANCH)
196-
build-signed_ubuntu24.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
196+
build-signed_ubuntu24.04%: IMAGE_TAG = $(if $(VERSION),$(VERSION)-)$(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
197197
build-signed_ubuntu24.04%: DOCKER_BUILD_ARGS = --build-arg KERNEL_VERSION="$(KERNEL_VERSION)"
198198

199199
# base is an image used to poll Canonical for the latest kernel version

0 commit comments

Comments
 (0)