@@ -116,30 +116,60 @@ scan:gpu-operator-arm64:
116116 needs :
117117 - scan:gpu-operator-amd64
118118
119- # Define the external release steps for NGC and Dockerhub
120- .release:ngc :
121- extends : .release:external
119+ .ngc-publish-variables :
120+ before_script :
121+ - |
122+ if [ -n "${CI_COMMIT_TAG}" ]; then
123+ echo "${CI_COMMIT_SHORT_SHA} ${CI_COMMIT_TAG}" > build-info-${CI_PIPELINE_ID}.txt
124+ else
125+ echo "${CI_COMMIT_SHORT_SHA} ${CI_COMMIT_SHORT_SHA}" > build-info-${CI_PIPELINE_ID}.txt
126+ fi
127+
128+ .update-nspect :
129+ stage : ngc-publish
130+ needs :
131+ - job : release:staging-gpu-operator
132+ extends :
133+ - .ngc-publish-variables
134+ image :
135+ name : " ${CNT_NGC_PUBLISH_IMAGE}"
136+ pull_policy : always
122137 variables :
123- OUT_REGISTRY_USER : " ${NGC_REGISTRY_USER}"
124- OUT_REGISTRY_TOKEN : " ${NGC_REGISTRY_TOKEN}"
125- OUT_REGISTRY : " ${NGC_REGISTRY}"
138+ PROJECT_NAME : " gpu-operator"
139+ REPO_URL : " https://github.com/NVIDIA/gpu-operator.git"
126140 script :
127- - echo "${VERSION} ${OUT_IMAGE_VERSION}" > build-info-${CI_PIPELINE_ID}.txt
128- - echo "Printing source and target image tags"
129- - cat build-info-${CI_PIPELINE_ID}.txt
130- artifacts :
131- paths :
132- - build-info-${CI_PIPELINE_ID}.txt
141+ - |
142+ cnt-ngc-publish nspect --versions-file "build-info-${CI_PIPELINE_ID}.txt"
133143
134- release:ngc-gpu-operator :
144+ # Update the nspect staging environment to test the nspect publishing logic
145+ update-nspect-staging :
135146 extends :
136- - .release:ngc
137- - .target-gpu-operator
147+ - .update-nspect
148+ except :
149+ - tags
150+ variables :
151+ ENV : " stage"
152+ RELEASE_VERSION : " test"
153+ NSPECT_CLIENT_ID : " ${NSPECT_STAGING_CLIENT_ID}"
154+ NSPECT_CLIENT_SECRET : " ${NSPECT_STAGING_CLIENT_SECRET}"
138155
139- raise-publishing-merge-request :
140- stage : ngc-publish
156+ # Update the nspect production environment with the new release
157+ update-nspect :
158+ extends :
159+ - .update-nspect
141160 rules :
142161 - if : $CI_COMMIT_TAG
162+ variables :
163+ OSRB_BUG_ID : " ${OSRB_BUG_ID}"
164+ ENV : " prod"
165+ RELEASE_VERSION : " ${CI_COMMIT_TAG}"
166+ NSPECT_CLIENT_ID : " ${NSPECT_PROD_CLIENT_ID}"
167+ NSPECT_CLIENT_SECRET : " ${NSPECT_PROD_CLIENT_SECRET}"
168+
169+ .publish-images :
170+ stage : ngc-publish
171+ extends :
172+ - .ngc-publish-variables
143173 image :
144174 name : " ${CNT_NGC_PUBLISH_IMAGE}"
145175 pull_policy : always
@@ -149,6 +179,28 @@ raise-publishing-merge-request:
149179 - cnt-ngc-publish render --project-name "gpu-operator" --versions-file "build-info-${CI_PIPELINE_ID}.txt" --output gpu-operator.yaml
150180 - cnt-ngc-publish merge-request --files "gpu-operator.yaml"
151181
182+ # Raise an MR to publish the image to NGC
183+ ngc-image-publish :
184+ extends :
185+ - .publish-images
186+ rules :
187+ - if : $CI_COMMIT_TAG
188+ needs :
189+ - job : update-nspect
190+ variables :
191+ NGC_PUBLISHING_PROJECT_PATH : " ${NGC_PUBLISHING_PROD_PROJECT_PATH}"
192+
193+ # Create a dummy MR that exercises the publishing logic
194+ mock-image-publish :
195+ extends :
196+ - .publish-images
197+ except :
198+ - tags
199+ needs :
200+ - job : update-nspect-staging
201+ variables :
202+ NGC_PUBLISHING_PROJECT_PATH : " ${NGC_PUBLISHING_TEST_PROJECT_PATH}"
203+
152204.schedule_defaults :
153205 rules :
154206 - if : $CI_PIPELINE_SOURCE == "schedule"
0 commit comments