1
1
name : Crystal Specs
2
2
on :
3
3
push :
4
- paths :
4
+ branches :
5
+ - main
6
+ tags :
5
7
- ' **'
6
- - ' !**.md'
7
- - ' !docs/*'
8
- - ' !doc-lint/*'
9
8
pull_request :
10
9
paths :
11
10
- ' **'
61
60
fail-fast : false
62
61
matrix : ${{fromJson(needs.tests.outputs.matrix)}}
63
62
steps :
63
+ - name : Login to Docker Hub
64
+ uses : docker/login-action@v3
65
+ with :
66
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
67
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
64
68
- name : Cleanup Tmp DIR
65
69
run : |
66
70
sudo rm -rf /tmp/*
@@ -153,26 +157,23 @@ jobs:
153
157
- name : Run Crystal Spec
154
158
env :
155
159
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
156
- DOCKERHUB_USERNAMES : ${{ secrets.DOCKERHUB_USERNAMES }}
157
- DOCKERHUB_PASSWORDS : ${{ secrets.DOCKERHUB_PASSWORDS }}
160
+ DOCKERHUB_USERNAME : ${{ secrets.DOCKERHUB_USERNAME }}
161
+ DOCKERHUB_PASSWORD : ${{ secrets.DOCKERHUB_PASSWORD }}
158
162
DOCKERHUB_EMAIL : ${{ secrets.DOCKERHUB_EMAIL }}
159
163
IMAGE_REPO : ${{ secrets.IMAGE_REPO }}
160
164
run : |
161
- USERNAME_ARRAY=($DOCKERHUB_USERNAMES)
162
- PASSWORD_ARRAY=($DOCKERHUB_PASSWORDS)
163
165
EMAIL_ARRAY=($DOCKERHUB_EMAIL)
164
166
IMAGE_ARRAY=($IMAGE_REPO)
165
-
166
167
RANDOMIZER=$(( 0 + $RANDOM % 3 ))
167
-
168
- export DOCKERHUB_USERNAME=${USERNAME_ARRAY[$RANDOMIZER]}
169
- export DOCKERHUB_PASSWORD=${PASSWORD_ARRAY[$RANDOMIZER]}
170
-
171
168
export PROTECTED_DOCKERHUB_USERNAME=$DOCKERHUB_USERNAME
172
169
export PROTECTED_DOCKERHUB_PASSWORD=$DOCKERHUB_PASSWORD
173
170
export PROTECTED_DOCKERHUB_EMAIL=${EMAIL_ARRAY[$RANDOMIZER]}
174
171
export PROTECTED_IMAGE_REPO=${IMAGE_ARRAY[$RANDOMIZER]}
175
172
173
+ echo get ratelimit anonymously
174
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
175
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
176
+
176
177
source cluster.env
177
178
export KUBECONFIG=$(pwd)/$CLUSTER.conf
178
179
until [[ $(kubectl get pods -l app=local-path-provisioner --namespace=local-path-storage -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') == "True" ]]; do
@@ -186,10 +187,13 @@ jobs:
186
187
#done
187
188
crystal build src/cnf-testsuite.cr
188
189
./cnf-testsuite setup
189
-
190
190
LOG_LEVEL=info crystal spec --warnings none --tag ${{ matrix.spec }} -v
191
-
192
-
191
+ echo get ratelimit anonymously
192
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
193
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
194
+ echo get ratelimit with a user account $DOCKERHUB_USERNAME
195
+ TOKEN=$(curl --user "$DOCKERHUB_USERNAME:$DOCKERHUB_PASSWORD" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
196
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
193
197
- name : Delete Cluster
194
198
if : ${{ always() }}
195
199
run : |
@@ -200,6 +204,7 @@ jobs:
200
204
kubectl get all -A || true
201
205
kind delete cluster --name $CLUSTER --verbosity 1
202
206
continue-on-error : true
207
+
203
208
- name : upload artifact
204
209
if : ${{ always() }}
205
210
uses : actions/upload-artifact@v4
@@ -216,6 +221,11 @@ jobs:
216
221
matrix :
217
222
tag : ["pod_delete", "pod_io_stress", "pod_memory_hog", "pod_network_latency", "disk_fill", "pod_network_corruption", "pod_network_duplication", "zombie", "oran"]
218
223
steps :
224
+ - name : Login to Docker Hub
225
+ uses : docker/login-action@v3
226
+ with :
227
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
228
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
219
229
- name : Checkout code
220
230
uses : actions/checkout@v4
221
231
with :
@@ -274,14 +284,20 @@ jobs:
274
284
echo "RUNNER: $RUNNER_NAME"
275
285
- name : Run Crystal Spec
276
286
run : |
277
- echo "Current path: $(echo pwd)"
287
+ echo get ratelimit anonymously
288
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
289
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
290
+
278
291
source cluster.env
279
292
export KUBECONFIG=$(pwd)/$CLUSTER.conf
280
293
until [[ $(kubectl get pods -l app=kindnet --namespace=kube-system -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') == "True" ]]; do
281
294
echo "Waiting for kindnet"
282
295
sleep 1
283
296
done
284
297
LOG_LEVEL=info crystal spec --warnings none --tag ${{ matrix.tag }} -v
298
+ echo get ratelimit anonymously
299
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
300
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
285
301
- name : Delete Cluster
286
302
if : ${{ always() }}
287
303
run : |
@@ -304,7 +320,12 @@ jobs:
304
320
runs-on : ubuntu-24.04
305
321
env :
306
322
CRYSTAL_IMAGE : " conformance/crystal:1.6.2-alpine"
307
- steps :
323
+ steps :
324
+ - name : Login to Docker Hub
325
+ uses : docker/login-action@v3
326
+ with :
327
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
328
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
308
329
- name : Checkout code
309
330
uses : actions/checkout@v4
310
331
with :
@@ -332,7 +353,12 @@ jobs:
332
353
test_binary_configuration_lifecycle :
333
354
name : Test Binary Without Source(config_lifecycle)
334
355
runs-on : [v1.0.0]
335
- steps :
356
+ steps :
357
+ - name : Login to Docker Hub
358
+ uses : docker/login-action@v3
359
+ with :
360
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
361
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
336
362
- name : Cleanup Tmp DIR
337
363
run : |
338
364
sudo rm -rf /tmp/*
@@ -383,6 +409,10 @@ jobs:
383
409
kubectl get nodes
384
410
- name : Run Test Suite without source(config_lifecycle)
385
411
run : |
412
+ echo get ratelimit anonymously
413
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
414
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
415
+
386
416
source cluster.env
387
417
echo "SHARDS_INSTALL_PATH: $SHARDS_INSTALL_PATH"
388
418
export KUBECONFIG=/tmp/$CLUSTER.conf
@@ -396,6 +426,9 @@ jobs:
396
426
wget -O cnf-testsuite.yml https://raw.githubusercontent.com/cnti-testcatalog/testsuite/${GITHUB_SHA}/example-cnfs/coredns/cnf-testsuite.yml
397
427
./cnf-testsuite cnf_install cnf-config=./cnf-testsuite.yml
398
428
LOG_LEVEL=info ./cnf-testsuite all ~compatibility ~resilience ~reasonable_startup_time ~reasonable_image_size ~platform ~increase_capacity ~decrease_capacity ~install_script_helm ~helm_chart_valid ~helm_chart_published verbose
429
+ echo get ratelimit anonymously
430
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
431
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
399
432
- name : Delete Cluster
400
433
if : ${{ always() }}
401
434
run : |
@@ -416,7 +449,12 @@ jobs:
416
449
test_binary_microservice :
417
450
name : Test Binary Without Source(microservice)
418
451
runs-on : [v1.0.0]
419
- steps :
452
+ steps :
453
+ - name : Login to Docker Hub
454
+ uses : docker/login-action@v3
455
+ with :
456
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
457
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
420
458
- name : Cleanup Tmp DIR
421
459
run : |
422
460
sudo rm -rf /tmp/*
@@ -464,6 +502,10 @@ jobs:
464
502
kubectl get nodes
465
503
- name : Run Test Suite without source(microservice)
466
504
run : |
505
+ echo get ratelimit anonymously
506
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
507
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
508
+
467
509
source cluster.env
468
510
export KUBECONFIG=/tmp/$CLUSTER.conf
469
511
helm repo add stable https://cncf.gitlab.io/stable
@@ -476,6 +518,9 @@ jobs:
476
518
wget -O cnf-testsuite.yml https://raw.githubusercontent.com/cnti-testcatalog/testsuite/${GITHUB_SHA}/example-cnfs/coredns/cnf-testsuite.yml
477
519
./cnf-testsuite cnf_install cnf-config=./cnf-testsuite.yml
478
520
LOG_LEVEL=info ./cnf-testsuite all ~resilience ~compatibility ~pod_network_latency ~platform ~increase_capacity ~decrease_capacity ~liveness ~readiness ~rolling_update ~rolling_downgrade ~rolling_version_change ~nodeport_not_used ~hostport_not_used ~hardcoded_ip_addresses_in_k8s_runtime_configuration ~install_script_helm ~helm_chart_valid ~helm_chart_published ~rollback ~secrets_used ~immutable_configmap verbose
521
+ echo get ratelimit anonymously
522
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
523
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
479
524
- name : Delete Cluster
480
525
if : ${{ always() }}
481
526
run : |
@@ -496,7 +541,12 @@ jobs:
496
541
test_binary_all :
497
542
name : Test Binary Without Source(all)
498
543
runs-on : [v1.0.0]
499
- steps :
544
+ steps :
545
+ - name : Login to Docker Hub
546
+ uses : docker/login-action@v3
547
+ with :
548
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
549
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
500
550
- name : Cleanup Tmp DIR
501
551
run : |
502
552
sudo rm -rf /tmp/*
@@ -544,6 +594,10 @@ jobs:
544
594
kubectl get nodes
545
595
- name : Run Test Suite without source(all)
546
596
run : |
597
+ echo get ratelimit anonymously
598
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
599
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
600
+
547
601
source cluster.env
548
602
export KUBECONFIG=/tmp/$CLUSTER.conf
549
603
helm repo add stable https://cncf.gitlab.io/stable
@@ -556,6 +610,9 @@ jobs:
556
610
wget -O cnf-testsuite.yml https://raw.githubusercontent.com/cnti-testcatalog/testsuite/${GITHUB_SHA}/example-cnfs/coredns/cnf-testsuite.yml
557
611
./cnf-testsuite cnf_install cnf-config=./cnf-testsuite.yml
558
612
LOG_LEVEL=info ./cnf-testsuite all ~resilience ~platform ~liveness ~readiness ~rolling_update ~rolling_downgrade ~rolling_version_change ~nodeport_not_used ~hostport_not_used ~hardcoded_ip_addresses_in_k8s_runtime_configuration ~rollback ~secrets_used ~immutable_configmap ~reasonable_startup_time ~reasonable_image_size verbose
613
+ echo get ratelimit anonymously
614
+ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
615
+ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
559
616
- name : Delete Cluster
560
617
if : ${{ always() }}
561
618
run : |
@@ -577,7 +634,7 @@ jobs:
577
634
name : Publish Release
578
635
needs : [spec, build]
579
636
runs-on : ubuntu-24.04
580
- steps :
637
+ steps :
581
638
- name : Checkout code
582
639
uses : actions/checkout@v4
583
640
with :
0 commit comments