Skip to content

Commit e0a461e

Browse files
authored
Merge pull request #1329 from elezar/update-internal-ci
Updated .release:staging to stage device-plugin images in nvstaging
2 parents 28e9def + 914be9a commit e0a461e

File tree

2 files changed

+6
-88
lines changed

2 files changed

+6
-88
lines changed

.common-ci.yml

Lines changed: 6 additions & 19 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:
@@ -160,8 +159,9 @@ scan-ubi9-arm64:
160159
before_script:
161160
- !reference [.regctl-setup, before_script]
162161

163-
# We ensure that the OUT_IMAGE_VERSION is set
162+
# We ensure that the OUT_IMAGE_VERSION and OUT_IMAGE_NAME are set
164163
- 'echo Version: ${OUT_IMAGE_VERSION} ; [[ -n "${OUT_IMAGE_VERSION}" ]] || exit 1'
164+
- 'echo Version: ${OUT_IMAGE_NAME} ; [[ -n "${OUT_IMAGE_NAME}" ]] || exit 1'
165165

166166
# In the case where we are deploying a different version to the CI_COMMIT_SHA, we
167167
# need to tag the image.
@@ -185,23 +185,10 @@ scan-ubi9-arm64:
185185
extends:
186186
- .release
187187
variables:
188-
OUT_REGISTRY_USER: "${CI_REGISTRY_USER}"
189-
OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}"
190-
OUT_REGISTRY: "${CI_REGISTRY}"
191-
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/staging/k8s-device-plugin"
192-
193-
# Define an external release step that pushes an image to an external repository.
194-
# This includes a devlopment image off main.
195-
.release:external:
196-
extends:
197-
- .release
198-
rules:
199-
- if: $CI_COMMIT_TAG
200-
variables:
201-
OUT_IMAGE_VERSION: "${CI_COMMIT_TAG}"
202-
- if: $CI_COMMIT_BRANCH == $RELEASE_DEVEL_BRANCH
203-
variables:
204-
OUT_IMAGE_VERSION: "${DEVEL_RELEASE_IMAGE_VERSION}"
188+
OUT_REGISTRY_USER: "${NGC_REGISTRY_USER}"
189+
OUT_REGISTRY_TOKEN: "${NGC_REGISTRY_TOKEN}"
190+
OUT_REGISTRY: "${NGC_REGISTRY}"
191+
OUT_IMAGE_NAME: "${NGC_STAGING_REGISTRY}/k8s-device-plugin"
205192

206193
release:staging-ubi9:
207194
extends:

.nvidia-ci.yml

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

Comments
 (0)