@@ -46,7 +46,6 @@ stages:
4646 - pull
4747 - scan
4848 - release
49- - sign
5049
5150.pipeline-trigger-rules :
5251 rules :
@@ -266,64 +265,3 @@ release-images-dummy:
266265 rules :
267266 - if : $CI_COMMIT_TAG == null || $CI_COMMIT_TAG == ""
268267
269- # .sign-images forms the base of the jobs which sign images in the NGC registry.
270- .sign-images :
271- stage : sign
272- image : ubuntu:latest
273- parallel :
274- matrix :
275- - TAG_SUFFIX : ["", "-packaging"]
276- variables :
277- IMAGE_NAME : " ${NGC_REGISTRY_IMAGE}"
278- IMAGE_TAG : " ${CI_COMMIT_TAG}"
279- NGC_CLI : " ngc-cli/ngc"
280- before_script :
281- - !reference [.ngccli-setup, before_script]
282- script :
283- - |
284- # We ensure that the IMAGE_NAME and IMAGE_TAG is set
285- echo Image Name: ${IMAGE_NAME} && [[ -n "${IMAGE_NAME}" ]] || exit 1
286- echo Image Tag: ${IMAGE_TAG} && [[ -n "${IMAGE_TAG}" ]] || exit 1
287-
288- export IMAGE=${IMAGE_NAME}:${IMAGE_TAG}${TAG_SUFFIX}
289- echo "Signing the image ${IMAGE}"
290- ${NGC_CLI} registry image publish --source ${IMAGE} ${IMAGE} --public --discoverable --allow-guest --sign --org nvidia
291-
292- # Define the external image signing steps for NGC
293- # Download the ngc cli binary for use in the sign steps
294- .ngccli-setup :
295- before_script :
296- - apt-get update && apt-get install -y curl unzip jq
297- - |
298- if [ -z "${NGCCLI_VERSION}" ]; then
299- NGC_VERSION_URL="https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions"
300- # Extract the latest version from the JSON data using jq
301- export NGCCLI_VERSION=$(curl -s $NGC_VERSION_URL | jq -r '.recipe.latestVersionIdStr')
302- fi
303- echo "NGCCLI_VERSION ${NGCCLI_VERSION}"
304- - curl -sSLo ngccli_linux.zip https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions/${NGCCLI_VERSION}/files/ngccli_linux.zip
305- - unzip ngccli_linux.zip
306- - chmod u+x ngc-cli/ngc
307-
308- sign-ngc-images :
309- extends :
310- - .sign-images
311- needs :
312- - release-images-to-ngc
313- rules :
314- - if : $CI_COMMIT_TAG
315- variables :
316- NGC_CLI_API_KEY : " ${NGC_REGISTRY_TOKEN}"
317- retry :
318- max : 2
319-
320- sign-images-dummy :
321- extends :
322- - .sign-images
323- needs :
324- - release-images-dummy
325- variables :
326- NGC_CLI : " echo [DUMMY] ngc-cli/ngc"
327- IMAGE_TAG : " ${CI_COMMIT_SHORT_SHA}"
328- rules :
329- - if : $CI_COMMIT_TAG == null || $CI_COMMIT_TAG == ""
0 commit comments