@@ -105,86 +105,3 @@ image-ubuntu20.04:
105105 - sbom.json
106106 - vulns.json
107107 - policy_evaluation.json
108-
109- # Define external release helpers
110- .release:ngc :
111- extends :
112- - .release:external
113- variables :
114- OUT_REGISTRY_USER : " ${NGC_REGISTRY_USER}"
115- OUT_REGISTRY_TOKEN : " ${NGC_REGISTRY_TOKEN}"
116- OUT_REGISTRY : " ${NGC_REGISTRY}"
117- OUT_IMAGE_NAME : " ${NGC_REGISTRY_IMAGE}"
118-
119- # Define the external release targets
120- # Release to NGC
121- release:ngc-ubuntu20.04 :
122- extends :
123- - .release:ngc
124- - .dist-ubuntu20.04
125-
126- release:ngc-ubi9 :
127- extends :
128- - .release:ngc
129- - .dist-ubi9
130-
131-
132- # Define the external image signing steps for NGC
133- # Download the ngc cli binary for use in the sign steps
134- .ngccli-setup :
135- before_script :
136- - apt-get update && apt-get install -y curl unzip jq
137- - |
138- if [ -z "${NGCCLI_VERSION}" ]; then
139- NGC_VERSION_URL="https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions"
140- # Extract the latest version from the JSON data using jq
141- export NGCCLI_VERSION=$(curl -s $NGC_VERSION_URL | jq -r '.recipe.latestVersionIdStr')
142- fi
143- echo "NGCCLI_VERSION ${NGCCLI_VERSION}"
144- - curl -sSLo ngccli_linux.zip https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions/${NGCCLI_VERSION}/files/ngccli_linux.zip
145- - unzip ngccli_linux.zip
146- - chmod u+x ngc-cli/ngc
147-
148- # .sign forms the base of the deployment jobs which signs images in the CI registry.
149- # This is extended with the image name and version to be deployed.
150- .sign:ngc :
151- image : ubuntu:latest
152- stage : sign
153- rules :
154- - if : $CI_COMMIT_TAG
155- variables :
156- NGC_CLI_API_KEY : " ${NGC_REGISTRY_TOKEN}"
157- IMAGE_NAME : " ${NGC_REGISTRY_IMAGE}"
158- IMAGE_TAG : " ${CI_COMMIT_TAG}-${DIST}"
159- retry :
160- max : 2
161- before_script :
162- - !reference [.ngccli-setup, before_script]
163- # We ensure that the IMAGE_NAME and IMAGE_TAG is set
164- - ' echo Image Name: ${IMAGE_NAME} && [[ -n "${IMAGE_NAME}" ]] || exit 1'
165- - ' echo Image Tag: ${IMAGE_TAG} && [[ -n "${IMAGE_TAG}" ]] || exit 1'
166- script :
167- - ' echo "Signing the image ${IMAGE_NAME}:${IMAGE_TAG}"'
168- - ngc-cli/ngc registry image publish --source ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_NAME}:${IMAGE_TAG} --public --discoverable --allow-guest --sign --org nvidia
169-
170- sign:ngc-short-tag :
171- extends :
172- - .sign:ngc
173- variables :
174- IMAGE_TAG : " ${CI_COMMIT_TAG}"
175- needs :
176- - release:ngc-ubuntu20.04
177-
178- sign:ngc-ubuntu20.04 :
179- extends :
180- - .dist-ubuntu20.04
181- - .sign:ngc
182- needs :
183- - release:ngc-ubuntu20.04
184-
185- sign:ngc-ubi9 :
186- extends :
187- - .dist-ubi9
188- - .sign:ngc
189- needs :
190- - release:ngc-ubi9
0 commit comments