@@ -101,72 +101,3 @@ image-ubi9:
101101 - vulns.json
102102 - policy_evaluation.json
103103
104- # Define external release helpers
105- .release:ngc :
106- extends :
107- - .release:external
108- variables :
109- OUT_REGISTRY_USER : " ${NGC_REGISTRY_USER}"
110- OUT_REGISTRY_TOKEN : " ${NGC_REGISTRY_TOKEN}"
111- OUT_REGISTRY : " ${NGC_REGISTRY}"
112- OUT_IMAGE_NAME : " ${NGC_REGISTRY_IMAGE}"
113-
114- # Define the external release targets
115- # Release to NGC
116- release:ngc-ubi9 :
117- extends :
118- - .release:ngc
119- - .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