Skip to content

Commit 5b85f11

Browse files
authored
Merge pull request #195 from JunAr7112/migrate_ngc_changes
Updated the .release:staging variables to stage images in nvstaging
2 parents 4eca068 + 4ff0e44 commit 5b85f11

File tree

2 files changed

+6
-103
lines changed

2 files changed

+6
-103
lines changed

.common-ci.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ stages:
2828
- test
2929
- scan
3030
- release
31-
- sign
3231

3332
.pipeline-trigger-rules:
3433
rules:
@@ -185,8 +184,8 @@ scan-ubi9-arm64:
185184
before_script:
186185
- !reference [.regctl-setup, before_script]
187186

188-
# We ensure that the OUT_IMAGE_VERSION is set
189-
- 'echo Version: ${OUT_IMAGE_VERSION} ; [[ -n "${OUT_IMAGE_VERSION}" ]] || exit 1'
187+
# We ensure that the OUT_IMAGE_VERSION and OUT_IMAGE_NAME is set
188+
- 'echo "Version: ${OUT_IMAGE_VERSION}, Image: ${OUT_IMAGE_NAME}" ; [[ -n "${OUT_IMAGE_VERSION}" && -n "${OUT_IMAGE_NAME}" ]] || exit 1'
190189

191190
# In the case where we are deploying a different version to the CI_COMMIT_SHA, we
192191
# need to tag the image.
@@ -210,23 +209,10 @@ scan-ubi9-arm64:
210209
extends:
211210
- .release
212211
variables:
213-
OUT_REGISTRY_USER: "${CI_REGISTRY_USER}"
214-
OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}"
215-
OUT_REGISTRY: "${CI_REGISTRY}"
216-
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/staging/k8s-mig-manager"
217-
218-
# Define an external release step that pushes an image to an external repository.
219-
# This includes a devlopment image off main.
220-
.release:external:
221-
extends:
222-
- .release
223-
rules:
224-
- if: $CI_COMMIT_TAG
225-
variables:
226-
OUT_IMAGE_VERSION: "${CI_COMMIT_TAG}"
227-
- if: $CI_COMMIT_BRANCH == $RELEASE_DEVEL_BRANCH
228-
variables:
229-
OUT_IMAGE_VERSION: "${DEVEL_RELEASE_IMAGE_VERSION}"
212+
OUT_REGISTRY_USER: "${NGC_REGISTRY_USER}"
213+
OUT_REGISTRY_TOKEN: "${NGC_REGISTRY_TOKEN}"
214+
OUT_REGISTRY: "${NGC_REGISTRY}"
215+
OUT_IMAGE_NAME: "${NGC_STAGING_REGISTRY}/k8s-mig-manager"
230216

231217
release:staging-ubi9:
232218
extends:

.nvidia-ci.yml

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)