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