Skip to content

Commit a9cabcf

Browse files
[no-relnote] Fix GitLab Pipeline files
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent 5474519 commit a9cabcf

File tree

3 files changed

+63
-98
lines changed

3 files changed

+63
-98
lines changed

.common-ci.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,23 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
default:
15-
image: docker:stable
15+
image: docker:24.0.6
1616
services:
17-
- name: docker:dind
17+
- name: docker:24.0.6-dind
1818
command: ["--experimental"]
1919

2020
variables:
2121
GIT_SUBMODULE_STRATEGY: recursive
22-
BUILDIMAGE: "${CI_REGISTRY_IMAGE}/build:${CI_COMMIT_SHORT_SHA}"
23-
# TODO: For now we only build amd64 images to speed up development
24-
BUILD_MULTI_ARCH_IMAGES: "false"
22+
BUILD_MULTI_ARCH_IMAGES: "true"
2523

2624
stages:
2725
- trigger
28-
- image
29-
- lint
30-
- go-checks
31-
- go-build
32-
- unit-tests
3326
- package-build
3427
- image-build
3528
- test
3629
- scan
3730
- release
31+
- sign
3832

3933
.pipeline-trigger-rules:
4034
rules:
@@ -83,14 +77,10 @@ trigger-pipeline:
8377
.platform-amd64:
8478
variables:
8579
PLATFORM: linux/amd64
86-
PLATFORM_ARCH: amd64
8780

8881
.platform-arm64:
8982
variables:
9083
PLATFORM: linux/arm64
91-
PLATFORM_ARCH: arm64
92-
rules:
93-
- if: $BUILD_MULTI_ARCH_IMAGES == "true"
9484

9585
# Make buildx available as a docker CLI plugin
9686
.buildx-setup:
@@ -112,7 +102,10 @@ trigger-pipeline:
112102
stage: scan
113103
variables:
114104
IMAGE: "${CI_REGISTRY_IMAGE}/k8s-dra-driver-gpu:${CI_COMMIT_SHORT_SHA}-${DIST}"
115-
IMAGE_ARCHIVE: "k8s-dra-driver-gpu-${CI_COMMIT_SHORT_SHA}-${DIST}-${PLATFORM_ARCH}.tar"
105+
IMAGE_ARCHIVE: "k8s-dra-driver-gpu.tar"
106+
except:
107+
variables:
108+
- $SKIP_SCANS && $SKIP_SCANS == "yes"
116109
before_script:
117110
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
118111
- docker pull --platform="${PLATFORM}" "${IMAGE}"
@@ -209,9 +202,6 @@ scan-ubi9-arm64:
209202
- if: $CI_COMMIT_BRANCH == $RELEASE_DEVEL_BRANCH
210203
variables:
211204
OUT_IMAGE_VERSION: "${DEVEL_RELEASE_IMAGE_VERSION}"
212-
needs:
213-
- job: unit-tests
214-
optional:
215205

216206
release:staging-ubi9:
217207
extends:

.gitlab-ci.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.nvidia-ci.yml

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ variables:
3333
# On the multi-arch builder we don't need the qemu setup.
3434
SKIP_QEMU_SETUP: "1"
3535
# Define the public staging registry
36-
STAGING_REGISTRY: registry.gitlab.com/nvidia/cloud-native/k8s-dra-driver-gpu/staging
36+
STAGING_REGISTRY: ghcr.io/nvidia
3737
STAGING_VERSION: ${CI_COMMIT_SHORT_SHA}
3838

3939
.image-pull:
@@ -95,7 +95,7 @@ image-ubi9:
9595
when: always
9696
expire_in: 1 week
9797
paths:
98-
- pulse-cli.log
98+
- pulse-cli.logs
9999
- licenses.json
100100
- sbom.json
101101
- vulns.json
@@ -117,3 +117,56 @@ release:ngc-ubi9:
117117
extends:
118118
- .release:ngc
119119
- .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)