-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
937 lines (869 loc) · 29.5 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
937 lines (869 loc) · 29.5 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
variables:
MODE: debug # run aistore and tests with debug asserts enabled
CI_IMAGE: aistorage/gitlab-ci:latest
RUNNER_TAG: "ais-ci"
SCRIPTS_DIR: "./scripts"
NUM_TARGET:
value: "6"
description: "Number of targets."
NUM_PROXY:
value: "6"
description: "Number of proxies."
FS_CNT:
value: "4"
description: "Number of mountpaths (disks) in each target."
CLOUD_BCKS:
value: "aws://ais-blossom gs://ais-ci-kube oc://ais-ci-long" # NOTE: additionally used: aws://ais-cicd and aws://ais-ci-python
description: "Set of buckets used when running cloud tests."
GOOGLE_APPLICATION_CREDENTIALS:
value: "$GCP_JSON_FILE"
description: "GitLab file variable containing credentials for GCP"
ORACLE_PRIVATE_KEY:
value: "$OCI_PRIVATE_KEY_FILE"
description: "GitLab file variable containing private key for OCI"
image: $CI_IMAGE
stages:
- build
- test-short
- test-long
# Rules
.changes_rules:
rules:
- &etl_changes_rule
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- "**/etl/**/*"
- "**/*etl*.py"
- "**/*etl*.go"
- 'api/apc/*'
- 'cmn/k8s/*'
- 'core/lom*'
- 'core/ldp.go'
- 'core/xaction.go'
- 'xact/xreg/*'
- 'xact/xs/tcb.go'
- 'xact/xs/tcobjs.go'
- &authn_changes_rule
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- "**/authn/**/*"
- '**/*authn*.go'
- '**/*authn*.py'
- 'api/apc/*'
- &auth_labels_rule
if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*authn?.*/'
- &python_req_changes_rule
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- 'python/aistore/common_requirements'
- &pytorch_label_rule
if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*pytorch.*/'
- &pytorch_changes_rule
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- 'python/aistore/pytorch/**/*'
- 'python/tests/unit/pytorch/**/*'
- 'python/tests/integration/pytorch/**/*'
.default_rules: &default_rules
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: manual
allow_failure: true
.default_test_rules: &default_test_rules
rules:
- !reference [.default_rules, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
.default_run_rules: &default_run_rules
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
.skip_scheduled_rules: &skip_scheduled_rules
rules:
- !reference [.default_rules, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual
allow_failure: true
# Templates
.gather_logs_template: &gather_logs_def
after_script:
- make kill # To make sure that nodes flushed the logs.
- mkdir -p $CI_PROJECT_DIR/logs $CI_PROJECT_DIR/logs/remote
- find /tmp/ais -type f -name "*\.INFO\.*" -exec cp {} $CI_PROJECT_DIR/logs/ \; 2>/dev/null || true
- find /tmp/ais_next -type f -name "*\.INFO\.*" -exec cp {} $CI_PROJECT_DIR/logs/remote/ \; 2>/dev/null || true
artifacts:
when: on_failure
paths: [ logs/ ]
expire_in: 1 days
.test_short_template: &test_short_def
stage: test-short
tags:
- $RUNNER_TAG
timeout: 53m
rules:
<<: *gather_logs_def
<<: *default_test_rules
.test_short_skip_scheduled_template: &test_short_skip_scheduled_def
stage: test-short
tags:
- $RUNNER_TAG
timeout: 53m
<<: *gather_logs_def
<<: *skip_scheduled_rules
.test_short_optional_template: &test_short_optional_def
stage: test-short
tags:
- $RUNNER_TAG
timeout: 53m
rules:
- !reference [.default_test_rules, rules]
- if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual
allow_failure: true
<<: *gather_logs_def
.test_long_template: &test_long_def
stage: test-long
tags:
- $RUNNER_TAG
timeout: 6h
rules:
- !reference [.default_test_rules, rules]
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "web"'
when: manual
allow_failure: true
<<: *gather_logs_def
.test_long_skip_scheduled_template: &test_long_skip_scheduled_def
stage: test-long
tags:
- $RUNNER_TAG
timeout: 6h
<<: *skip_scheduled_rules
<<: *gather_logs_def
# Stages
build:linux:
stage: build
tags:
- $RUNNER_TAG
timeout: 10m
rules:
- !reference [.default_rules, rules]
- !reference [.default_run_rules, rules]
script:
- MODE="" make node # Build node without backends in production mode.
- MODE="debug" make node # Build node without backends in debug mode.
- AIS_BACKEND_PROVIDERS="aws azure gcp oci" MODE="" make node # Build with all Cloud backends (production mode).
- AIS_BACKEND_PROVIDERS="aws azure gcp oci ht" MODE="debug" make node # Build with all backends (debug mode).
- MEM_PROFILE="/tmp/mem" CPU_PROFILE="/tmp/cpu" make node # Build with profile.
- TAGS="nethttp" make node # Build with net/http transport support (fasthttp is used by default).
- TAGS="oteltracing" make node # Build with oteltracing (disabled by default).
- make authn
- make cli
- make aisloader
security:sonarqube:
stage: build
tags:
- $RUNNER_TAG
- gp-vm
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
GIT_DEPTH: "0"
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
allow_failure: true
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- !reference [.default_run_rules, rules]
script:
- sonar-scanner
build:k8s:
stage: build
tags:
- $RUNNER_TAG
variables:
# Assuming runners are using overlayfs, we must use vfs to avoid layered overlayfs
STORAGE_DRIVER: vfs
before_script:
- buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN $CI_REGISTRY
- buildah login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN docker.io
script:
- make -C deploy/prod/k8s/aisnode_container ci
- make -C deploy/prod/k8s/aisinit_container ci
rules:
- !reference [.test_k8s_short_template, rules]
- *python_req_changes_rule
lint:fmt:
stage: build
tags:
- $RUNNER_TAG
timeout: 10m
rules:
- !reference [ .default_rules, rules ]
- !reference [ .default_run_rules, rules ]
script:
- make fmt-check
- make spell-check
lint:go:
stage: build
tags:
- $RUNNER_TAG
timeout: 10m
rules:
- !reference [.default_rules, rules]
- !reference [.default_run_rules, rules]
script:
- golangci-lint config verify
- make lint
lint:python:
stage: build
tags:
- $RUNNER_TAG
timeout: 10m
rules:
- !reference [.default_rules, rules]
- !reference [.default_run_rules, rules]
script:
- make lint-python
lint:tags:
stage: build
tags:
- $RUNNER_TAG
timeout: 10m
rules:
- !reference [.default_rules, rules]
- !reference [.default_run_rules, rules]
script:
- TAGS="dsort nethttp debug oteltracing oci aws gcp azure" make lint-scoped
build:gendocs:
stage: build
tags:
- $RUNNER_TAG
timeout: 10m
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*website.*/'
variables:
GENERATOR_IMG: docker.io/openapitools/openapi-generator-cli:v7.14.0
script:
- go run ./tools/gendocs
- podman run --rm -v "${PWD}:/work:z" "${GENERATOR_IMG}" generate -i /work/.docs/openapi.yaml -g markdown -o /work/docs-generated --template-dir /work/markdown-template
- ./scripts/website-preprocess.sh
# Runs cluster with 5 proxies and 5 targets (each with 6 mountpaths).
test:short:
<<: *test_short_def
rules:
- !reference [.test_short_template, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*python-tests-only.*/'
when: manual
allow_failure: true
- !reference [.default_run_rules, rules]
variables:
BUCKET: "ais://test"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all
- make test-short
- make test-tracing-unit
test:short:aisloader:
<<: *test_short_def
timeout: 20m
rules:
- !reference [.test_short_template, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*python-tests-only.*/'
when: manual
allow_failure: true
- !reference [.default_run_rules, rules]
script:
- make aisloader
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all
- FLAGS="--duration=2m" make test-aisloader
test:short:python-changelog-check:
<<: *test_short_def
rules:
- !reference [.test_short_template, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-python-changelog-check.*/'
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- python/aistore/sdk/**/*
- python/aistore/version.py
script:
- git fetch origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
- CHANGED_FILES=$(git diff --name-only "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"...HEAD)
- echo "Changed files are:"
- echo "$CHANGED_FILES"
- echo "$CHANGED_FILES" | grep -qx 'python/CHANGELOG.md' || exit 1
test:short:python-unit:
<<: *test_short_def
rules:
- !reference [.test_short_template, rules]
- !reference [.default_run_rules, rules]
variables:
PIP: "uv pip"
script:
- cd python
- |
set -e
for ver in 3.8 3.9 3.10 3.11 3.12 3.13 3.14; do
uv venv --python "$ver" .venv
source .venv/bin/activate
make python_sdk_unit_tests
make python_unit_tests_scenario_gen
make python_botocore_unit_tests
make python_mcp_unit_tests
deactivate || true
rm -rf .venv
done
# Runs cluster with 5 proxies and 5 targets (each with 6 mountpaths).
test:short:python-integration:
<<: *test_short_def
rules:
- !reference [.test_short_template, rules]
- !reference [.default_run_rules, rules]
variables:
AIS_ENDPOINT: "http://localhost:8080"
BUCKET: "aws://ais-ci-python"
PIP: "uv pip"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all --aws
- cd python
- |
set -e
for ver in 3.8 3.9 3.14; do
uv venv --python "$ver" .venv
source .venv/bin/activate
make python_botocore_integration_tests
# TODO: For now, only run full SDK integration on 3.14
if [ "$ver" = "3.14" ]; then make python_sdk_integration_tests; fi
deactivate || true
rm -rf .venv
done
test:short:pytorch:
<<: *test_short_optional_def
variables:
AIS_ENDPOINT: "http://localhost:8080"
BUCKET: "aws://ais-ci-python"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all --aws
- cd python
- make python_pytorch_tests
rules:
- !reference [.test_short_template, rules]
- *pytorch_label_rule
- *pytorch_changes_rule
- !reference [.test_short_optional_template, rules]
test:short:python-authn:
stage: test-short
tags:
- $RUNNER_TAG
timeout: 20m
<<: *gather_logs_def
variables:
AIS_AUTHN_DEPLOY: "true"
AIS_AUTHN_ENABLED: "true"
AIS_AUTHN_SU_NAME: "admin"
AIS_AUTHN_SU_PASS: "admin"
AIS_AUTHN_SECRET_KEY: "gitlabCISigningKey"
AIS_AUTHN_URL: "http://localhost:52001"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT
- cd python/
- make python_authn_tests
rules:
- !reference [.test_short_template, rules]
- *auth_labels_rule
- *python_req_changes_rule
- *authn_changes_rule
# Runs cluster with 1 proxy and 1 target (with 6 mountpaths).
test:short:minimal:
<<: *test_short_def
variables:
BUCKET: "ais://test"
rules:
- !reference [.test_short_template, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*python-tests-only.*/'
when: manual
allow_failure: true
- !reference [.default_run_rules, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt 1 --proxy-cnt 1 --mountpath-cnt $FS_CNT --deployment all
- NUM_PROXY=1 NUM_TARGET=1 make test-short
test:short:chunks:
<<: *test_short_def
variables:
BUCKET: "ais://test"
NUM_CHUNKS: "4"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*chunks.*/'
- !reference [.test_short_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all
- make test-short
test:short:sign_hmac:
<<: *test_short_def
variables:
BUCKET: "ais://test"
SIGN_HMAC: "true"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*sign_hmac.*/'
- !reference [.test_short_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all
- make test-short
test:short:rand_ns:
<<: *test_short_def
variables:
BUCKET: "ais://test"
RAND_NS: "true"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*sign_rand_ns.*/'
- !reference [.test_short_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all
- make test-short
test:short:s3-compat:
<<: *test_short_def
tags:
- $RUNNER_TAG
variables:
# Run only s3 compat tests we know should pass
S3_COMPAT_RUN_ALL:
value: "False"
# Fail on first failure
S3_COMPAT_STRICT:
value: "True"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all
- ais config cluster features S3-API-via-Root
- ais config cluster checksum.type=md5
- cd python
- make python_s3_compat_test
rules:
- !reference [.test_short_template, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS !~ /.*s3-compat.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
test:short:authn:
<<: *test_short_optional_def
variables:
AIS_AUTHN_DEPLOY: "true"
AIS_AUTHN_ENABLED: "true"
AIS_AUTHN_SU_NAME: "admin"
AIS_AUTHN_SU_PASS: "admin"
AIS_AUTHN_SECRET_KEY: "gitlabCISigningKey"
AIS_AUTHN_URL: "http://localhost:52001"
BUCKET: "ais://test"
RE: "TestAuth"
TEST_RACE: "true"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT
- ais auth login $AIS_AUTHN_SU_NAME -p $AIS_AUTHN_SU_PASS
- make test-run
- ais auth logout
rules:
- !reference [ .default_test_rules, rules ]
- *auth_labels_rule
- *authn_changes_rule
- if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual
allow_failure: true
test:short:https:
<<: *test_short_def
variables:
AIS_USE_HTTPS: "true"
AIS_SKIP_VERIFY_CRT: "true"
AIS_SERVER_CRT: "$CI_PROJECT_DIR/localhost.crt"
AIS_SERVER_KEY: "$CI_PROJECT_DIR/localhost.key"
AIS_ENDPOINT: "https://localhost:8080"
BUCKET: "ais://ais-ci"
script:
- openssl req -x509 -out $AIS_SERVER_CRT -keyout $AIS_SERVER_KEY -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -extensions EXT -config <( printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all --https
- make test-short
rules:
- !reference [.test_short_template, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*https.*/'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS !~ /.*https.*/'
when: manual
allow_failure: true
test:short:ipv6:
<<: *test_short_def
variables:
AIS_USE_IPv6: "true"
BUCKET: "ais://ais-ci"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*ipv6.*/'
- !reference [.test_short_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT
- make test-short
test:short:aws:
<<: *test_short_skip_scheduled_def
variables:
BUCKET: "aws://ais-cicd"
timeout: 70m
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*aws.*/'
- !reference [.test_short_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --aws
- make test-short
test:short:gcp:
<<: *test_short_skip_scheduled_def
variables:
BUCKET: "gs://ais-ci"
timeout: 70m
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*gcp.*/'
- !reference [.test_short_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --gcp
- make test-short
test:short:azure:
<<: *test_short_skip_scheduled_def
variables:
BUCKET: "az://ais-ci"
timeout: 70m
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*azure.*/'
- !reference [.test_short_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --azure
- make test-short
test:short:oci:
<<: *test_short_skip_scheduled_def
variables:
BUCKET: "oc://ais-ci"
timeout: 2h
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*oci.*/'
- !reference [.test_short_skip_scheduled_template, rules]
script:
- . ais/test/oci/mp_tuning.env && ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --oci
- . ais/test/oci/mp_tuning.env && make test-short
test:long:
<<: *test_long_skip_scheduled_def
variables:
BUCKET: "ais://ais-ci"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --ht --deployment all
- make test-long
test:long:python-extended:
<<: *test_long_def
variables:
AIS_ENDPOINT: "http://localhost:8080"
BUCKET: "aws://ais-ci-python"
PIP: "uv pip"
timeout: 35m
before_script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --deployment all --aws
script:
- cd python
- uv venv --python 3.14 .venv
- source .venv/bin/activate
- make python_sdk_extended_tests
- deactivate || true
- rm -rf .venv
test:long:aws:
<<: *test_long_def
variables:
BUCKET: "aws://ais-cicd"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*aws.*/'
- !reference [.test_long_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --aws --ht --deployment all
- make test-long
test:long:gcp:
<<: *test_long_def
variables:
BUCKET: "gs://ais-ci"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*gcp.*/'
- !reference [.test_long_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --gcp --ht --deployment all
- make test-long
test:long:azure:
<<: *test_long_def
variables:
BUCKET: "az://ais-ci"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*azure.*/'
- !reference [.test_long_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --azure --ht --deployment all
- make test-long
test:long:oci:
<<: *test_long_def
variables:
BUCKET: "oc://ais-ci"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*oci.*/'
- !reference [.test_long_skip_scheduled_template, rules]
script:
- . ais/test/oci/mp_tuning.env && ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT --oci --ht --deployment all
- . ais/test/oci/mp_tuning.env && make test-long
test:long:aisloader:
stage: test-long
tags:
- $RUNNER_TAG
timeout: 15m
variables:
AIS_ENDPOINT: "http://localhost:8080"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT
- sleep 10 # make sure that cluster properly starts
- FLAGS="--duration=5m" make test-aisloader
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main"'
when: manual
allow_failure: true
test:long:pyaisloader:
stage: test-long
tags:
- $RUNNER_TAG
timeout: 15m
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT
- sleep 10 # make sure that cluster properly starts
- make -C python/pyaisloader ci-long
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main"'
when: manual
allow_failure: true
test:long:ishard:
stage: test-long
tags:
- $RUNNER_TAG
timeout: 1h
variables:
AIS_ENDPOINT: "http://localhost:8080"
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT
- sleep 10 # make sure that cluster properly starts
- cd ./cmd/ishard/ishard; go test -v -timeout=10h -run=^TestIshard
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main"'
when: manual
allow_failure: true
test:long:chunks:
<<: *test_long_def
variables:
BUCKET: "ais://test"
NUM_CHUNKS: "4"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*skip-ci.*/'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*chunks.*/'
- !reference [.test_long_skip_scheduled_template, rules]
script:
- ${SCRIPTS_DIR}/clean_deploy.sh --target-cnt $NUM_TARGET --proxy-cnt $NUM_PROXY --mountpath-cnt $FS_CNT
- make test-long
#
# Kubernetes stages
#
.test_k8s:
tags:
- $RUNNER_TAG
variables:
BUCKET: "gs://ais-ci-kube"
TESTS_DIR: "ais/test"
AISNODE_IMAGE: "$CI_REGISTRY_IMAGE/aisnode"
AISINIT_IMAGE: "$CI_REGISTRY_IMAGE/ais-init"
FS_CNT: 6
RE: "TestETL|TestConfig|TestMountpath|TestBlobDownload"
AIS_BACKEND_PROVIDERS: "gcp aws oci"
rules:
- !reference [.default_test_rules, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*k8s-ci.*/'
before_script:
- cd deploy/dev/k8s
- ./utils/ci/generate_kind_config.sh > kind_config.yml
- kind create cluster --config=kind_config.yml --wait=5m
- kubectl cluster-info # wait for k8s
- make gitlab-ci
- source ./export_endpoint.sh
- cd ../../..
- make cli
after_script:
- mkdir $CI_PROJECT_DIR/logs
- cp -r /ais/log $CI_PROJECT_DIR/logs
artifacts:
when: on_failure
paths: [ logs/ ]
expire_in: 1 days
.test_k8s_short_template:
stage: test-short
extends: .test_k8s
variables:
NUM_PROXY: 1
NUM_TARGET: 3
rules:
- !reference [.test_k8s, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*etl.*/'
- *etl_changes_rule
.test_k8s_long_template:
stage: test-long
extends: .test_k8s
variables:
NUM_PROXY: 1
NUM_TARGET: 3
rules:
- !reference [.default_rules, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual
allow_failure: true
test:short:k8s:
extends: .test_k8s_short_template
timeout: 1h
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /.*python-tests-only.*/'
when: manual
allow_failure: true
- !reference [.test_k8s_short_template, rules]
variables:
RE: "TestETL|TestConfig|TestMountpath|TestBlobDownload"
script:
- make test-short
test:short:python-etl:
extends: .test_k8s_short_template
rules:
- !reference [.test_k8s_short_template, rules]
- *python_req_changes_rule
retry:
max: 2
when:
- unknown_failure
- api_failure
- stuck_or_timeout_failure
- runner_system_failure
- job_execution_timeout
variables:
PIP: "uv pip"
script:
- cd python
- uv venv --python 3.13 .venv
- source .venv/bin/activate
- make python_etl_tests
- deactivate || true
- rm -rf .venv
# e.g. RE: "ETLBucket|ETLFQN" (or any other regex to select tests)
test:short:assorted:k8s:
extends: .test_k8s_short_template
timeout: 35m
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main"'
when: manual
allow_failure: true
variables:
RE: "ETLAnyToAny|ETLMultiObj"
script:
- make test-run
test:long:k8s:
extends: .test_k8s_long_template
timeout: 6h
rules:
- !reference [.test_k8s_long_template, rules]
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
allow_failure: true
script:
- make test-run
test:long:k8s:single-target:
extends: .test_k8s_long_template
timeout: 6h
variables:
NUM_TARGET: 1
script:
- make test-run
test:long:k8s:aisloader:
extends: .test_k8s_long_template
timeout: 15m
script:
- sleep 10 # Give some time for the cluster to stabilize.
- make aisloader
- BUCKET="ais://test" FLAGS="--duration=2m --etl" make test-aisloader
test:long:k8s:pyaisloader:
extends: .test_k8s_long_template
timeout: 15m
script:
- sleep 10 # Give some time for the cluster to stabilize.
- make -C python/pyaisloader ci-etl
test:long:k8s:all:
extends: .test_k8s_long_template
timeout: 6h
variables:
AIS_BACKEND_PROVIDERS: "gcp aws oci"
before_script:
- make aisloader
- cd deploy/dev/k8s
- ./utils/ci/generate_kind_config.sh > kind_config.yml
- kind create cluster --config=kind_config.yml
- kubectl cluster-info # wait for k8s
- make gitlab-ci
- source ./export_endpoint.sh
- cd ../../..
# Make sure that metrics collection is enabled.
- git clone https://github.com/prometheus-operator/kube-prometheus.git
- kubectl apply -f kube-prometheus/manifests/setup && kubectl apply -f kube-prometheus/manifests && rm -rf kube-prometheus
script:
- |
echo "----- RUNNING K8S TESTS -----"
BUCKET="aws://ais-blossom" RE="TestETL|TestConfig|TestMountpath|TestBlobDownload" make test-run
exit_code=$?
result=$((result + exit_code))
echo "----- K8S TESTS FINISHED WITH: ${exit_code} -----"
- |
for bucket in ${CLOUD_BCKS}; do
echo "----- RUNNING LONG TESTS WITH: ${bucket} -----"
BUCKET=${bucket} make test-long && make test-aisloader
exit_code=$?
result=$((result + exit_code))
echo "----- LONG TESTS FINISHED WITH: ${exit_code} -----"
done