forked from NVIDIA/gpu-feature-discovery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
142 lines (124 loc) · 3.32 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include:
- local: '.common-ci.yml'
- project: nvidia/container-infrastructure/aws-kube-ci
file: aws-kube-ci.yml
ref: 23.09.12
build-dev-image:
stage: image
script:
- apk --no-cache add make bash
- make .build-image
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- make .push-build-image
.requires-build-image:
image: "${BUILDIMAGE}"
.go-check:
extends:
- .requires-build-image
stage: go-checks
fmt:
extends:
- .go-check
script:
- make assert-fmt
vet:
extends:
- .go-check
script:
- make vet
lint:
extends:
- .go-check
script:
- make lint
allow_failure: true
ineffassign:
extends:
- .go-check
script:
- make ineffassign
allow_failure: true
misspell:
extends:
- .go-check
script:
- make misspell
go-build:
extends:
- .requires-build-image
stage: go-build
script:
- make build
unit-tests:
extends:
- .requires-build-image
stage: unit-tests
script:
- make coverage
# Define the image build targets
.image-build:
stage: image-build
variables:
IMAGE_NAME: "${CI_REGISTRY_IMAGE}"
VERSION: "${CI_COMMIT_SHORT_SHA}"
PUSH_ON_BUILD: "true"
before_script:
- !reference [.buildx-setup, before_script]
- apk add --no-cache bash make
- 'echo "Logging in to CI registry ${CI_REGISTRY}"'
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
script:
- make -f deployments/container/Makefile build-${DIST}
image-ubi8:
extends:
- .image-build
- .dist-ubi8
# The integration and end-to-end test targets
aws_kube_setup:
extends: .aws_kube_setup
except:
- schedules
aws_kube_clean:
extends: .aws_kube_clean
except:
- schedules
integration_tests:
stage: integration_tests
image: alpine
variables:
DIST: "ubi8"
VERSION: "${CI_COMMIT_SHORT_SHA}"
script:
- source aws-kube-ci/hostname
- apk add --no-cache openssh-client
- scp -i aws-kube-ci/key -r -o StrictHostKeyChecking=no ${CI_PROJECT_DIR} "${instance_hostname}:~/project"
- ssh -i aws-kube-ci/key ${instance_hostname} \
"cd ~/project/tests && ./ci-run-integration.sh ${CI_REGISTRY_IMAGE}:${VERSION}-${DIST}"
dependencies:
- aws_kube_setup
e2e_tests:
stage: e2e_tests
variables:
DIST: "ubi8"
VERSION: "${CI_COMMIT_SHORT_SHA}"
script:
- source aws-kube-ci/hostname
- apk add --no-cache openssh-client
- scp -i aws-kube-ci/key -r -o StrictHostKeyChecking=no ${CI_PROJECT_DIR} "${instance_hostname}:~/project"
- ssh -i aws-kube-ci/key ${instance_hostname} \
"cd ~/project/tests && ./ci-run-e2e.sh ${CI_REGISTRY_IMAGE} ${VERSION}-${DIST} ${CI_COMMIT_TAG}"
dependencies:
- aws_kube_setup