10000 gitlab-ci: transition to rules + refactoring · NVIDIA/aistore@d10f6ea · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit d10f6ea

Browse files
committed
gitlab-ci: transition to rules + refactoring
* Replace usage of [deprecated `only/except`](https://docs.gitlab.com/ci/yaml/#only--except) in favor of [newer `rules`](https://docs.gitlab.com/ci/yaml/#rules). * Update run on `main` to be of manual trigger and not automatic. * Update skipped jobs to still be manually triggerable. Signed-off-by: Ryan Koo <rbk65@cornell.edu>
1 parent 657f42d commit d10f6ea

File tree

1 file changed

+46
-39
lines changed

1 file changed

+46
-39
lines changed

.gitlab-ci.yml

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,31 @@ include:
4848
paths: [ logs/ ]
4949
expire_in: 1 days
5050

51-
.default_only_template: &default_only_def
52-
only:
53-
- main
54-
- merge_requests
55-
- schedules
56-
- webs
51+
.default_test_rules: &default_test_rules
52+
rules:
53+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
54+
when: manual
55+
allow_failure: true
56+
- !reference [.default_rules, rules]
57+
58+
.default_rules: &default_rules
59+
rules:
60+
- if: '$CI_COMMIT_BRANCH == "main"'
61+
when: manual
62+
allow_failure: true
63+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
64+
when: always
5765

5866
.test_short_template: &test_short_def
5967
stage: test-short
6068
tags:
6169
- $RUNNER_TAG
6270
timeout: 35m
63-
<<: *default_only_def
64-
except:
65-
variables:
66-
- $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/
67-
- $CI_MERGE_REQUEST_LABELS =~ /.*python-tests-only.*/
71+
rules:
72+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*python-tests-only.*/'
73+
when: manual
74+
allow_failure: true
75+
- !reference [.default_test_rules, rules]
6876
<<: *gather_logs_def
6977

7078
.test_short_skip_scheduled_template: &test_short_skip_scheduled_def
@@ -150,7 +158,7 @@ build:linux:
150158
tags:
151159
- $RUNNER_TAG
152160
timeout: 10m
153-
<<: *default_only_def
161+
<<: *default_rules
154162
script:
155163
- MODE="" make node # Build node without backends in production mode.
156164
- MODE="debug" make node # Build node without backends in debug mode.
@@ -190,7 +198,8 @@ build:k8s:
190198
- buildah push $FQ_AISINIT_IMAGE_NAME
191199
rules:
192200
- if: '$CI_COMMIT_BRANCH == "main"'
193-
allow_failure: false
201+
when: manual
202+
allow_failure: true
194203
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
195204
when: never
196205
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*etl.*/'
@@ -209,7 +218,7 @@ lint:linux:
209218
tags:
210219
- $RUNNER_TAG
211220
timeout: 10m
212-
<<: *default_only_def
221+
<<: *default_rules
213222
script:
214223
- make lint
215224
- TAGS="oteltracing statsd ht" make lint
@@ -229,15 +238,15 @@ test:short:
229238

230239
test:short:python-changelog-check:
231240
<<: *test_short_def
232-
only:
233-
refs:
234-
- merge_requests
235-
changes:
236-
- python/aistore/sdk/**/*
237-
- python/aistore/version.py
238-
except:
239-
variables:
240-
- $CI_MERGE_REQUEST_LABELS =~ /.*skip-python-changelog-check.*/
241+
rules:
242+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
243+
when: never
244+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-python-changelog-check.*/'
245+
when: never
246+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
247+
changes:
248+
- python/aistore/sdk/**/*
249+
- python/aistore/version.py
241250
script:
242251
- git fetch origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
243252
- CHANGED_FILES=$(git diff --name-only "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"...HEAD)
@@ -247,6 +256,7 @@ test:short:python-changelog-check:
247256

248257
test:short:python-unit:
249258
<<: *test_short_def
259+
<<: *default_test_rules
250260
variables:
251261
PIP: "uv pip"
252262
script:
@@ -262,13 +272,11 @@ test:short:python-unit:
262272
deactivate || true
263273
rm -rf .venv
264274
done
265-
except:
266-
variables:
267-
- $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/
268275
269276
# Runs cluster with 5 proxies and 5 targets (each with 6 mountpaths) 6D40 .
270277
test:short:python-integration:
271278
<<: *test_short_def
279+
<<: *default_test_rules
272280
variables:
273281
AIS_ENDPOINT: "http://localhost:8080"
274282
BUCKET: "aws://ais-ci-python"
@@ -287,9 +295,6 @@ test:short:python-integration:
287295
deactivate || true
288296
rm -rf .venv
289297
done
290-
except:
291-
variables:
292-
- $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/
293298
294299
test:long:python-extended:
295300
<<: *test_long_def
@@ -324,10 +329,11 @@ test:short:pytorch:
324329
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all --aws
325330
- cd python
326331
- make python_pytorch_tests
327-
except:
328-
variables:
329-
- $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/
330-
- $CI_MERGE_REQUEST_LABELS !~ /.*pytorch.*/
332+
rules:
333+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS !~ /.*pytorch.*/'
334+
when: manual
335+
allow_failure: true
336+
- !reference [.default_test_rules, rules]
331337

332338
test:short:python-authn:
333339
stage: test-short
@@ -379,18 +385,19 @@ test:short:s3-compat:
379385
# Fail on first failure
380386
S3_COMPAT_STRICT:
381387
value: "True"
382-
383388
script:
384389
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all
385390
- ais config cluster features S3-API-via-Root
386391
- ais config cluster checksum.type=md5
387392
- cd python
388393
- make python_s3_compat_test
389-
except:
390-
variables:
391-
- $CI_MERGE_REQUEST_LABELS !~ /.*s3-compat.*/
392-
- $CI_PIPELINE_SOURCE == "schedule"
393-
394+
rules:
395+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS !~ /.*s3-compat.*/'
396+
when: manual
397+
allow_failure: true
398+
- if: '$CI_PIPELINE_SOURCE == "schedule"'
399+
when: never
400+
- !reference [.default_test_rules, rules]
394401

395402
test:short:authn:
396403
<<: *test_short_optional_def

0 commit comments

Comments
 (0)
0