forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yml
More file actions
976 lines (925 loc) · 30.3 KB
/
Copy pathconfig.yml
File metadata and controls
976 lines (925 loc) · 30.3 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
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
version: "2.1"
orbs:
aws-s3: circleci/aws-s3@2.0.0
terraform: circleci/terraform@2.1.0
parameters:
cross-container-tag:
type: string
default: go1.23.9-latest
workflow:
type: string
default: build
executors:
cross-builder:
docker:
# NOTE: To upgrade the Go version, first push the upgrade to the cross-builder Dockerfile
# in the edge repo, then update the version here to match.
- image: quay.io/influxdb/cross-builder:<< pipeline.parameters.cross-container-tag >>
resource_class: large
linux-amd64:
machine:
image: ubuntu-2204:current
resource_class: large
linux-arm64:
machine:
image: ubuntu-2204:current
resource_class: arm.large
darwin:
resource_class: macos.m1.medium.gen1
macos:
xcode: 15.0.0
shell: /bin/bash -eo pipefail
windows:
machine:
image: windows-server-2019-vs2019:stable
resource_class: windows.medium
shell: bash.exe -eo pipefail
# Unlike when a commit is pushed to a branch, CircleCI does not automatically
# execute a workflow when a tag is pushed to a repository. These filters
# allow the corresponding workflow to execute on any branch or tag.
any_filter: &any_filter
filters:
tags:
only: /.*/
branches:
only: /.*/
release_filter: &release_filter
filters:
tags:
# This regex matches what is found in 'scripts/get-version' with the
# '[[:digit:]]' transformed into '\d'. This also excludes release
# candidate detection, because this filter only matches against
# full releases.
only: /^v(\d+)(?:\.(\d+))?(?:\.(\d+))?$/
branches:
ignore: /.*/
nofork_filter: &nofork_filter
filters:
branches:
ignore: /pull\/[0-9]+/
workflows:
version: 2
build:
when:
equal: [ << pipeline.parameters.workflow >>, build ]
jobs:
- test-race:
<<: *any_filter
- test-build:
<<: *any_filter
name: test-build-<< matrix.os >>-<< matrix.arch >>
matrix:
parameters:
os: [ linux, darwin, windows ]
arch: [ amd64, arm64 ]
exclude:
- { os: darwin, arch: arm64 }
- { os: windows, arch: arm64 }
# linux/amd64 can be tested directly from our cross-builder image
# to save time & enable running with the race detector.
- { os: linux, arch: amd64 }
- test-prebuilt:
<<: *any_filter
name: test-linux-arm64
executor: linux-arm64
requires:
- test-build-linux-arm64
- test-prebuilt:
<<: *any_filter
name: test-darwin
executor: darwin
requires:
- test-build-darwin-amd64
- test-prebuilt:
<<: *any_filter
name: test-windows
executor: windows
requires:
- test-build-windows-amd64
- fluxtest:
<<: *any_filter
- tlstest:
<<: *any_filter
- lint:
<<: *any_filter
- build:
<<: *any_filter
name: build-<< matrix.os >>-<< matrix.arch >>
build-type: snapshot
matrix:
parameters:
os: [ linux, darwin, windows ]
arch: [ amd64, arm64 ]
exclude:
- { os: darwin, arch: arm64 }
- { os: windows, arch: arm64 }
- build-packages:
<<: *any_filter
requires:
- build-linux-amd64
- build-linux-arm64
- build-darwin-amd64
- build-windows-amd64
- check_package_deb_amd64:
requires:
- build-packages
- check_package_deb_arm64:
requires:
- build-packages
- check_package_rpm:
<<: *nofork_filter
name:
check_package_rpm-<< matrix.arch >>
matrix:
parameters:
arch: [ x86_64, aarch64 ]
requires:
- build-packages
- test-downgrade:
<<: *any_filter
requires:
- build-linux-amd64
- e2e-monitor-ci:
<<: *nofork_filter
requires:
- build-linux-amd64
- test-linux-packages:
<<: *nofork_filter
requires:
- build-packages
- sign-packages:
<<: *release_filter
requires:
- build-packages
- s3-publish-packages:
<<: *release_filter
requires:
- test-linux-packages
- build-packages
- sign-packages
- changelog:
<<: *release_filter
workflow: release
- changelog-upload:
<<: *release_filter
workflow: release
requires:
- changelog
- perf-test:
record_results: true
requires:
- build-packages
filters:
branches:
only:
- master
- grace-test:
<<: *any_filter
requires:
- build-linux-amd64
- litmus-smoke-test:
<<: *any_filter
requires:
- build-linux-amd64
- litmus-full-test:
requires:
- build-linux-amd64
filters:
branches:
only: master
- share-testing-image:
filters:
branches:
only:
- master
requires:
- e2e-monitor-ci
aws-destroy-daily:
triggers:
- schedule:
# run every day at 10pm -- note: use spaces, not tabs
cron: "0 22 * * *"
filters:
branches:
only:
- "master"
jobs:
- aws-destroy-by-date
nightly:
when:
and:
# This requires a pipeline trigger with a custom "workflow" parameter
# set to "nightly". Since we want to trigger this workflow on several
# branches, we cannot use the trigger name as suggested by the
# documentation.
#
# For more information:
# https://circleci.com/docs/scheduled-pipelines/
- equal: [ << pipeline.trigger_source >>, scheduled_pipeline ]
- equal: [ << pipeline.parameters.workflow >>, nightly ]
jobs:
- changelog:
workflow: nightly
- changelog-upload:
workflow: nightly
requires:
- changelog
- test-race
- test-build:
name: test-build-<< matrix.os >>-<< matrix.arch >>
matrix:
parameters:
os: [ linux, darwin, windows ]
arch: [ amd64, arm64 ]
exclude:
- { os: darwin, arch: arm64 }
- { os: windows, arch: arm64 }
# linux/amd64 can be tested directly from our cross-builder image
# to save time & enable running with the race detector.
- { os: linux, arch: amd64 }
- test-prebuilt:
name: test-linux-arm64
executor: linux-arm64
requires:
- test-build-linux-arm64
- test-prebuilt:
name: test-darwin
executor: darwin
requires:
- test-build-darwin-amd64
- test-prebuilt:
name: test-windows
executor: windows
requires:
- test-build-windows-amd64
- lint
- fluxtest
- tlstest
- build:
name: build-nightly-<< matrix.os >>-<< matrix.arch >>
build-type: nightly
matrix:
parameters:
os: [ linux, darwin, windows ]
arch: [ amd64, arm64 ]
exclude:
- { os: darwin, arch: arm64 }
- { os: windows, arch: arm64 }
- build-docker-nightly:
name: build-docker-nightly-arm64
resource_class: arm.medium
arch: arm64
arch_docker: arm64v8
requires:
- build-nightly-linux-arm64
- build-docker-nightly:
name: build-docker-nightly-amd64
resource_class: medium
arch: amd64
arch_docker: amd64
requires:
- build-nightly-linux-amd64
- docker-nightly-manifest:
requires:
- build-docker-nightly-amd64
- build-docker-nightly-arm64
- build-packages:
requires:
- build-nightly-linux-amd64
- build-nightly-linux-arm64
- build-nightly-darwin-amd64
- build-nightly-windows-amd64
- litmus-full-test:
requires:
- build-nightly-linux-amd64
- grace-test:
requires:
- build-nightly-linux-amd64
commands:
quay_login:
steps:
- run:
name: Log in to Quay
command: docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
jobs:
lint:
executor: cross-builder
steps:
- checkout
- run:
name: Check go version
command: ./scripts/ci/check-system-go-matches-go-mod.sh
when: always
- run:
name: Check flag generation
command: ./scripts/ci/lint/flags.bash
when: always
- run:
name: Check SQL migrations
command: make checksqlmigrations
when: always
- run:
name: Check formatting
command: make checkfmt
when: always
- run:
name: Check codegen
command: make checkgenerate
when: always
- run:
name: vet
command: make vet
when: always
- run:
name: staticcheck
command: |
go install honnef.co/go/tools/cmd/staticcheck@2024.1.1
staticcheck ./...
when: always
test-race:
executor: cross-builder
parallelism: 8
steps:
- checkout
- run:
name: Run race tests
command: ./scripts/ci/run-race-tests.sh $(pwd)/test-results
- store_test_results:
path: ./test-results
- store_artifacts:
path: ./test-results
destination: raw-test-results
test-build:
executor: cross-builder
resource_class: large
parameters:
os:
type: string
arch:
type: string
steps:
- checkout
- run:
name: Build test binaries
environment:
GOOS: << parameters.os >>
GOARCH: << parameters.arch >>
command: ./scripts/ci/build-tests.sh ./test-bin
- persist_to_workspace:
root: .
paths:
- test-bin
test-prebuilt:
parameters:
executor:
type: executor
executor: << parameters.executor >>
parallelism: 8
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Install Rosetta
command: .circleci/scripts/install-rosetta
- run:
name: Run tests
command: ./scripts/ci/run-prebuilt-tests.sh $(pwd)/test-bin $(pwd)/test-results
- store_test_results:
path: ./test-results
- store_artifacts:
path: ./test-results
destination: raw-test-results
fluxtest:
executor: cross-builder
steps:
- checkout
- run: make test-flux
tlstest:
executor: cross-builder
steps:
- checkout
- run: make test-tls
build:
executor: cross-builder
parameters:
os:
type: string
arch:
type: string
build-type:
type: string
steps:
- checkout
- run:
name: Install Package Dependencies
command: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install --yes git
- run:
name: Get InfluxDB Version
command: |
PREFIX=2.x .circleci/scripts/get-version
- run:
name: Generate UI assets
command: make generate-web-assets
- run:
name: Build binaries
command: |
build_type="<< parameters.build-type >>"
# release builds occur from the "build" pipeline
if [[ ${build_type} == snapshot ]]
then
# `get-version` determines whether this is a release build. If
# this is a release build, ensure that the proper version is
# templated into the go binary.
if [[ ${RELEASE:-} ]]
then
build_type=release
fi
fi
export GOOS=<< parameters.os >>
export GOARCH=<< parameters.arch >>
./scripts/ci/build.sh "bin/influxd_$(go env GOOS)_$(go env GOARCH)" "${build_type}" ./cmd/influxd
- store_artifacts:
path: bin
- persist_to_workspace:
root: .
paths:
- bin
build-packages:
machine:
image: ubuntu-2204:current
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run: |
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get install --no-install-recommends --yes \
asciidoc \
build-essential \
git \
python3 \
rpm \
ruby-dev \
xmlto
sudo gem install fpm
python3 -m pip install -r .circleci/scripts/package/requirements.txt
# Unfortunately, this must be executed as root. This is so permission
# modifying commands (chown, chmod, etc.) succeed.
sudo --preserve-env=CIRCLE_TAG,CIRCLE_SHA1 .circleci/scripts/package/build.py
- store_artifacts:
path: artifacts/
- persist_to_workspace:
root: .
paths:
- artifacts
sign-packages:
circleci_ip_ranges: true
docker:
- image: quay.io/influxdb/rsign:latest
auth:
username: $QUAY_RSIGN_USERNAME
password: $QUAY_RSIGN_PASSWORD
steps:
- add_ssh_keys:
fingerprints:
- fc:7b:6e:a6:38:7c:63:5a:13:be:cb:bb:fa:33:b3:3c
- attach_workspace:
at: /tmp/workspace
- run: |
for target in /tmp/workspace/artifacts/*
do
case "${target}"
in
# rsign is shipped on Alpine Linux which uses "busybox ash" instead
# of bash. ash is somewhat more posix compliant and is missing some
# extensions and niceties from bash.
*.deb|*.rpm|*.tar.gz|*.zip)
rsign "${target}"
;;
esac
if [ -f "${target}" ]
then
# Since all artifacts are present, sign them here. This saves Circle
# credits over spinning up another instance just to separate out the
# checksum job. Individual checksums are written by the
# "build_packages" script.
sha256sum "${target}" >> "/tmp/workspace/artifacts/influxdb2.${CIRCLE_TAG}.digests"
fi
done
- persist_to_workspace:
root: /tmp/workspace
paths:
- artifacts
- store_artifacts:
path: /tmp/workspace/artifacts
s3-publish-packages:
docker:
- image: ubuntu:latest
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: Publish Packages to S3
command: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install --yes awscli git
PREFIX=2.x .circleci/scripts/get-version
source "${BASH_ENV}"
# required for sha256sum generate the correct paths
pushd /tmp/workspace/artifacts
# Since the artifacts are generated in parallel, the checksums
# cannot be calculated until all artifacts are complete. This
# excludes `CHANGELOG.md`. Historically, `CHANGELOG.md` was
# not included in the checksums.
sha256sum * | tee influxdb.${VERSION}.sha256
aws s3 sync . 's3://dl.influxdata.com/influxdb/releases'
build-docker-nightly:
parameters:
resource_class:
type: string
arch:
type: string
arch_docker:
type: string
machine:
image: ubuntu-2004:current
resource_class: << parameters.resource_class >>
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- quay_login
- run:
name: Install Dependencies
command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y docker
- run:
name: Build Docker Container
command: |
# The Dockerfile requires `influxd` to build the container. This
# is written into `/tmp/workspace/bin/` by `build-binaries`. For
# the Dockerfile to build successfully, copy `influxd` to
# the current directory.
cp /tmp/workspace/bin/influxd_linux_<< parameters.arch >>/influxd .
docker build -f docker/influxd/Dockerfile -t quay.io/influxdb/influxdb-<< parameters.arch_docker >>:nightly .
docker push quay.io/influxdb/influxdb-<< parameters.arch_docker >>:nightly
docker-nightly-manifest:
machine:
image: ubuntu-2004:current
steps:
- run:
name: Install Dependencies
command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y docker
- quay_login
- run:
name: Update Docker Manifests
command: |
docker manifest create \
quay.io/influxdb/influxdb:nightly \
quay.io/influxdb/influxdb-amd64:nightly \
quay.io/influxdb/influxdb-arm64v8:nightly
docker manifest push \
quay.io/influxdb/influxdb:nightly
test-linux-packages:
executor: terraform/default
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- add_ssh_keys:
fingerprints:
- 3a:d1:7a:b7:57:d7:85:0b:76:79:85:51:38:f3:e4:67
- terraform/validate:
path: scripts/ci/
- run:
name: Terraform apply
command: |
set -x
export DEBNAME="$(find /tmp/workspace/artifacts/influxdb2*amd64.deb)"
terraform -chdir=scripts/ci init -input=false
AWS_ACCESS_KEY_ID=$TEST_AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$TEST_AWS_SECRET_ACCESS_KEY terraform \
-chdir=scripts/ci \
apply \
-auto-approve \
-var package_path=${DEBNAME} \
-var instance_name=circleci-terraform-${CIRCLE_SHA1} \
-var additional_files_dir=${PWD}/scripts/ci/tests/
- run:
name: Install deb
command: |
set -x
export ec2_ip=$(terraform -chdir=scripts/ci output -raw test_node_ssh)
ssh -o "StrictHostKeyChecking=no" ubuntu@$ec2_ip \<< EOF
sudo apt-get update && sudo apt-get install -y /home/ubuntu/influxdb.deb
EOF
- run:
name: Run tests
command: |
set -x
export ec2_ip=$(terraform -chdir=scripts/ci output -raw test_node_ssh)
files=$(ssh -o "StrictHostKeyChecking=no" ubuntu@$ec2_ip 'find /home/ubuntu/files/ -maxdepth 1 -mindepth 1 | sort')
for file in $files; do
ssh -o "StrictHostKeyChecking=no" ubuntu@$ec2_ip "sudo $file"
done
- run:
name: Terraform destroy
when: always
command: |
AWS_ACCESS_KEY_ID=$TEST_AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$TEST_AWS_SECRET_ACCESS_KEY terraform \
-chdir=scripts/ci \
destroy \
-auto-approve
perf-test:
docker:
- image: cimg/base:2022.04
resource_class: small
parameters:
record_results:
type: boolean
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
# To ssh into aws without failing host key checks
- add_ssh_keys:
fingerprints:
- 3a:d1:7a:b7:57:d7:85:0b:76:79:85:51:38:f3:e4:67
- run:
name: Set up AWS CLI
command: |
./scripts/ci/install-aws-cli.sh
echo "export AWS_ACCESS_KEY_ID=${TEST_AWS_ACCESS_KEY_ID}" >> vars.sh
echo "export AWS_SECRET_ACCESS_KEY=${TEST_AWS_SECRET_ACCESS_KEY}" >> vars.sh
echo "export TEST_RECORD_RESULTS=<< parameters.record_results >>" >> vars.sh
echo 'export DATA_I_TYPE="r5.2xlarge"' >> vars.sh
- run:
name: Set up AWS instance
command: |
scripts/ci/perf_test.sh
- run:
name: Run perf test
no_output_timeout: 20m
command: |
source vars.sh
set -x
ssh "ubuntu@$EC2_IP" "sudo ./run_perftest.sh"
- run:
name: Tear down AWS instance
when: always
command: |
source vars.sh
set -x
if [[ -n "$EC2_INSTANCE_ID" ]] ; then
aws --region us-west-2 ec2 terminate-instances --instance-ids "$EC2_INSTANCE_ID"
fi
aws-destroy-by-date:
executor: linux-amd64
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- add_ssh_keys:
fingerprints:
- 3a:d1:7a:b7:57:d7:85:0b:76:79:85:51:38:f3:e4:67
- run:
name: Destroy AWS instances with datestring more than a day old
no_output_timeout: 20m
command: |
set -x
yesterday_date=$(date --date "yesterday" +%Y%m%d)
instance_info=$(AWS_ACCESS_KEY_ID=${TEST_AWS_ACCESS_KEY_ID} \
AWS_SECRET_ACCESS_KEY=${TEST_AWS_SECRET_ACCESS_KEY} \
aws --region us-west-2 ec2 describe-instances \
--filters "Name=tag:Name,Values=oss-perftest-*" \
--query "Reservations[].Instances[].[InstanceId, Tags[?Key=='Name']|[0].Value]" \
--output text)
while [ -n "$instance_info" ]; do
instance_id=$(echo $instance_info | tr -s ' ' | cut -d ' ' -f1)
name=$(echo $instance_info | tr -s ' ' | cut -d ' ' -f2)
instance_info=$(echo $instance_info | tr -s ' ' | cut -d ' ' -f3-)
date=$(echo $name | cut -d '-' -f3)
if [ $date -le $yesterday_date ]; then
AWS_ACCESS_KEY_ID=${TEST_AWS_ACCESS_KEY_ID} AWS_SECRET_ACCESS_KEY=${TEST_AWS_SECRET_ACCESS_KEY} aws --region us-west-2 ec2 terminate-instances --instance-ids $instance_id
fi
done
e2e-monitor-ci:
docker:
- image: cimg/base:stable
steps:
- checkout
- attach_workspace:
at: .
- setup_remote_docker
- quay_login
- run:
name: Build and push candidate docker image
command: |
cp bin/influxd_linux_amd64/influxd .
docker build -f docker/influxd/Dockerfile -t quay.io/influxdb/oss-acceptance:${CIRCLE_SHA1} .
docker push quay.io/influxdb/oss-acceptance:${CIRCLE_SHA1}
- run:
name: Run the tests
command: API_KEY=${MONITOR_CI_API_KEY} MONITOR_CI_BRANCH="master" OSS_SHA=${CIRCLE_SHA1} RUN_WORKFLOW="build_oss" ./scripts/ci/run-monitor-ci-tests.bash
- store_artifacts:
path: monitor-ci/test-artifacts/results/build-oss-image
destination: test_artifacts/results/build-oss-image
- store_artifacts:
path: monitor-ci/test-artifacts/results/oss-e2e
destination: test_artifacts/results/oss-e2e
- store_artifacts:
path: monitor-ci/test-artifacts/results/shared
destination: test_artifacts/results/shared
litmus-smoke-test:
executor: linux-amd64
steps:
- attach_workspace:
at: ~/project
- run: docker run --entrypoint "./run_litmus_tests_oss.sh" -e ONE_TEST=src/cloud/rest_api/smoke/test_smoke.py -e BINARYPATH=/Litmus/result/bin/influxd_linux_amd64/influxd -e BOLTPATH=/Litmus/result/influxd_test/influxd.bolt -e ENGINEPATH=/Litmus/result/influxd_test --net host -v /var/run/docker.sock:/var/run/docker.sock -v ~/project:/Litmus/result quay.io/influxdb/litmus:latest
- store_artifacts:
path: ~/project
destination: raw-daily-output
- store_test_results:
path: ~/project
litmus-full-test:
executor: linux-amd64
steps:
- attach_workspace:
at: ~/project
- run: docker run --entrypoint "./run_litmus_tests_oss.sh" -e TEST_LIST=tests_lists/gateway_api_tests.list -e BINARYPATH=/Litmus/result/bin/influxd_linux_amd64/influxd -e BOLTPATH=/tmp/influxd_test/influxd.bolt -e ENGINEPATH=/tmp/influxd_test --net host -v /var/run/docker.sock:/var/run/docker.sock -v ~/project:/Litmus/result quay.io/influxdb/litmus:latest
- store_artifacts:
path: ~/project
destination: raw-daily-output
- store_test_results:
path: ~/project
grace-test:
executor: linux-amd64
steps:
- attach_workspace:
at: ~/project
- run:
command: ./bin/influxd_linux_amd64/influxd --store=memory --log-level=debug
background: true
- run: mkdir -p ~/project/results
- run:
name: Wait for influxd to bind HTTP port
command: |
attempts=0
max_attempts=30
while ! curl localhost:8086/health; do
attempts=$((attempts+1))
if [[ $attempts = $max_attempts ]]; then
>&2 echo influxd "didn't" start in time
exit 1
fi
sleep 1
done
- run:
name: Run grace test driver
command: |
docker run -v ~/project/results:/grace/test-results/grace-results \
--env GRACE_BASE_URL="http://172.17.0.1:8086" \
--env GRACE_ORG_NAME="daily-org" \
--env GRACE_BUCKET_NAME="daily-bucket" \
--env GRACE_USER="daily@influxdata.com" \
--env GRACE_PASS="dailyPassword" \
--env GRACE_VALIDATE_OPENAPI=1 \
quay.io/influxdb/grace:latest-cd
- store_artifacts:
path: ~/project/results
- store_test_results:
path: ~/project/results
test-downgrade:
executor: cross-builder
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Run downgrade tests
command: |
./scripts/ci/test-downgrade.sh $(pwd)/bin/influxd_linux_amd64/influxd
share-testing-image:
docker:
- image: cimg/base:stable
steps:
- setup_remote_docker
- quay_login
- run:
name: Push the image to Quay
command: |
docker pull quay.io/influxdb/oss-acceptance:${CIRCLE_SHA1}
docker tag quay.io/influxdb/oss-acceptance:${CIRCLE_SHA1} quay.io/influxdb/oss-acceptance:latest
docker push quay.io/influxdb/oss-acceptance:latest
changelog:
parameters:
workflow:
type: string
docker:
- image: quay.io/influxdb/changelogger:latest
steps:
- checkout
- when:
condition:
or:
- equal: [ << parameters.workflow >>, nightly ]
- equal: [ << parameters.workflow >>, snapshot ]
steps:
- run: changelogger --product OSS
- when:
condition:
equal: [ << parameters.workflow >>, release ]
steps:
- run: |
export DESCRIPTION="In addition to the list of changes below, please also see the [official release \
notes](https://docs.influxdata.com/influxdb/${CIRCLE_BRANCH}/reference/release-notes/influxdb/) for \
other important information about this release."
changelogger --product OSS --release "<< pipeline.git.tag >>" --description "${DESCRIPTION}"
- store_artifacts:
path: changelog_artifacts/
- persist_to_workspace:
root: changelog_artifacts/
paths:
- .
changelog-upload:
parameters:
workflow:
type: string
docker:
- image: cimg/python:3.6
steps:
- attach_workspace:
at: /tmp/workspace
- when:
condition:
equal: [ << parameters.workflow >>, release ]
steps:
- aws-s3/copy:
aws-region: AWS_S3_REGION
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
to: "s3://dl.influxdata.com/influxdb/releases/CHANGELOG.<< pipeline.git.tag >>.md"
from: /tmp/workspace/CHANGELOG.md
- when:
condition:
equal: [ << parameters.workflow >>, nightly ]
steps:
- aws-s3/copy:
aws-region: AWS_S3_REGION
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
to: "s3://dl.influxdata.com/platform/nightlies/<< pipeline.git.branch >>/CHANGELOG.md"
from: /tmp/workspace/CHANGELOG.md
check_package_deb_amd64:
machine:
image: ubuntu-2204:current
resource_class: medium
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: Validate Debian Package (AMD64)
command: |
sudo .circleci/scripts/package-validation/debian \
/tmp/workspace/artifacts/influxdb2*amd64.deb
check_package_deb_arm64:
machine:
image: ubuntu-2204:current
resource_class: arm.medium
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: Validate Debian Package (ARM64)
command: |
sudo .circleci/scripts/package-validation/debian \
/tmp/workspace/artifacts/influxdb2*arm64.deb
check_package_rpm:
executor: linux-amd64
parameters:
arch:
type: string
steps:
- attach_workspace:
at: /tmp/workspace
- add_ssh_keys:
fingerprints:
- 3a:d1:7a:b7:57:d7:85:0b:76:79:85:51:38:f3:e4:67
- checkout
- run: |
AWS_ACCESS_KEY_ID=$TEST_AWS_ACCESS_KEY_ID \
AWS_SECRET_ACCESS_KEY=$TEST_AWS_SECRET_ACCESS_KEY \
.circleci/scripts/package-validation/redhat << parameters.arch >> /tmp/workspace/artifacts/influxdb2*.<< parameters.arch >>.rpm