@@ -33,7 +33,7 @@ variables:
3333 # On the multi-arch builder we don't need the qemu setup.
3434 SKIP_QEMU_SETUP : " 1"
3535 # Define the public staging registry
36- STAGING_REGISTRY : registry.gitlab.com /nvidia/cloud-native/k8s-dra-driver-gpu/staging
36+ STAGING_REGISTRY : ghcr.io /nvidia
3737 STAGING_VERSION : ${CI_COMMIT_SHORT_SHA}
3838
3939.image-pull :
@@ -95,7 +95,7 @@ image-ubi9:
9595 when : always
9696 expire_in : 1 week
9797 paths :
98- - pulse-cli.log
98+ - pulse-cli.logs
9999 - licenses.json
100100 - sbom.json
101101 - vulns.json
@@ -117,3 +117,56 @@ release:ngc-ubi9:
117117 extends :
118118 - .release:ngc
119119 - .dist-ubi9
120+
121+ # Define the external image signing steps for NGC
122+ # Download the ngc cli binary for use in the sign steps
123+ .ngccli-setup :
124+ before_script :
125+ - apt-get update && apt-get install -y curl unzip jq
126+ - |
127+ if [ -z "${NGCCLI_VERSION}" ]; then
128+ NGC_VERSION_URL="https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions"
129+ # Extract the latest version from the JSON data using jq
130+ export NGCCLI_VERSION=$(curl -s $NGC_VERSION_URL | jq -r '.recipe.latestVersionIdStr')
131+ fi
132+ echo "NGCCLI_VERSION ${NGCCLI_VERSION}"
133+ - curl -sSLo ngccli_linux.zip https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions/${NGCCLI_VERSION}/files/ngccli_linux.zip
134+ - unzip ngccli_linux.zip
135+ - chmod u+x ngc-cli/ngc
136+
137+ # .sign forms the base of the deployment jobs which signs images in the CI registry.
138+ # This is extended with the image name and version to be deployed.
139+ .sign:ngc :
140+ image : ubuntu:latest
141+ stage : sign
142+ rules :
143+ - if : $CI_COMMIT_TAG
144+ variables :
145+ NGC_CLI_API_KEY : " ${NGC_REGISTRY_TOKEN}"
146+ IMAGE_NAME : " ${NGC_REGISTRY_IMAGE}"
147+ IMAGE_TAG : " ${CI_COMMIT_TAG}-${DIST}"
148+ retry :
149+ max : 2
150+ before_script :
151+ - !reference [.ngccli-setup, before_script]
152+ # We ensure that the IMAGE_NAME and IMAGE_TAG is set
153+ - ' echo Image Name: ${IMAGE_NAME} && [[ -n "${IMAGE_NAME}" ]] || exit 1'
154+ - ' echo Image Tag: ${IMAGE_TAG} && [[ -n "${IMAGE_TAG}" ]] || exit 1'
155+ script :
156+ - ' echo "Signing the image ${IMAGE_NAME}:${IMAGE_TAG}"'
157+ - ngc-cli/ngc registry image publish --source ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_NAME}:${IMAGE_TAG} --public --discoverable --allow-guest --sign --org nvidia
158+
159+ sign:ngc-short-tag :
160+ extends :
161+ - .sign:ngc
162+ needs :
163+ - release:ngc-ubi9
164+ variables :
165+ IMAGE_TAG : " ${CI_COMMIT_TAG}"
166+
167+ sign:ngc-ubi9 :
168+ extends :
169+ - .dist-ubi9
170+ - .sign:ngc
171+ needs :
172+ - release:ngc-ubi9
0 commit comments