diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 38c3751dcc..98fb48c0a4 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -1,5 +1,7 @@ name: 'Nightly jobs' on: + pull_request: + branches: [main] schedule: - cron: '30 1 * * *' workflow_dispatch: @@ -98,7 +100,7 @@ jobs: make bench ./bin/zot-linux-amd64 serve test/gc-stress/config-gc-referrers-bench-s3-localstack.json & sleep 10 - bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080 + bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080 --skip-cleanup killall -r zot-* @@ -135,7 +137,7 @@ jobs: make bench ./bin/zot-linux-amd64 serve test/gc-stress/config-gc-bench-s3-localstack.json & sleep 10 - bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080 + bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080 --skip-cleanup killall -r zot-* diff --git a/test/blackbox/helpers_zot.bash b/test/blackbox/helpers_zot.bash index 8428dddfdb..6168629251 100644 --- a/test/blackbox/helpers_zot.bash +++ b/test/blackbox/helpers_zot.bash @@ -31,7 +31,7 @@ function wait_zot_reachable() { --max-time 3 \ --retry 10 \ --retry-delay 0 \ - --retry-max-time 60 \ + --retry-max-time 120 \ --retry-connrefused \ ${zot_url} } diff --git a/test/blackbox/pushpull_running_dedupe.bats b/test/blackbox/pushpull_running_dedupe.bats index b18163a3e6..17d758b145 100644 --- a/test/blackbox/pushpull_running_dedupe.bats +++ b/test/blackbox/pushpull_running_dedupe.bats @@ -24,7 +24,7 @@ function setup_file() { exit 1 fi # Download test data to folder common for the entire suite, not just this file - skopeo --insecure-policy copy --format=oci docker://ghcr.io/project-zot/golang:1.20 oci:${TEST_DATA_DIR}/golang:1.20 + skopeo --insecure-policy copy --format=oci docker://ghcr.io/project-zot/test-images/alpine:3.17.3 oci:${TEST_DATA_DIR}/alpine:1 # Setup zot server local zot_root_dir=${BATS_FILE_TMPDIR}/zot local zot_config_file=${BATS_FILE_TMPDIR}/zot_config.json @@ -67,8 +67,8 @@ function teardown_file() { @test "push image - dedupe not running" { start=`date +%s` run skopeo --insecure-policy copy --dest-tls-verify=false \ - oci:${TEST_DATA_DIR}/golang:1.20 \ - docker://127.0.0.1:8080/golang:1.20 + oci:${TEST_DATA_DIR}/alpine:1 \ + docker://127.0.0.1:8080/alpine:1 [ "$status" -eq 0 ] end=`date +%s` @@ -77,34 +77,34 @@ function teardown_file() { run curl http://127.0.0.1:8080/v2/_catalog [ "$status" -eq 0 ] - [ $(echo "${lines[-1]}" | jq '.repositories[]') = '"golang"' ] - run curl http://127.0.0.1:8080/v2/golang/tags/list + [ $(echo "${lines[-1]}" | jq '.repositories[]') = '"alpine"' ] + run curl http://127.0.0.1:8080/v2/alpine/tags/list [ "$status" -eq 0 ] - [ $(echo "${lines[-1]}" | jq '.tags[]') = '"1.20"' ] + [ $(echo "${lines[-1]}" | jq '.tags[]') = '"1"' ] } @test "pull image - dedupe not running" { local oci_data_dir=${BATS_FILE_TMPDIR}/oci start=`date +%s` run skopeo --insecure-policy copy --src-tls-verify=false \ - docker://127.0.0.1:8080/golang:1.20 \ - oci:${oci_data_dir}/golang:1.20 + docker://127.0.0.1:8080/alpine:1 \ + oci:${oci_data_dir}/alpine:1 [ "$status" -eq 0 ] end=`date +%s` runtime=$((end-start)) echo "pull image exec time: $runtime sec" >&3 - run cat ${BATS_FILE_TMPDIR}/oci/golang/index.json + run cat ${BATS_FILE_TMPDIR}/oci/alpine/index.json [ "$status" -eq 0 ] - [ $(echo "${lines[-1]}" | jq '.manifests[].annotations."org.opencontainers.image.ref.name"') = '"1.20"' ] + [ $(echo "${lines[-1]}" | jq '.manifests[].annotations."org.opencontainers.image.ref.name"') = '"1"' ] } @test "push 50 images with dedupe disabled" { for i in {1..50} do run skopeo --insecure-policy copy --dest-tls-verify=false \ - oci:${TEST_DATA_DIR}/golang:1.20 \ - docker://127.0.0.1:8080/golang${i}:1.20 + oci:${TEST_DATA_DIR}/alpine:1 \ + docker://127.0.0.1:8080/alpine${i}:1 [ "$status" -eq 0 ] done } @@ -119,6 +119,7 @@ function teardown_file() { sed -i 's/false/true/g' ${zot_config_file} zot_serve ${ZOT_PATH} ${zot_config_file} + wait_zot_reachable 8080 # deduping will now run in background (task scheduler) while we push images, shouldn't interfere } @@ -126,8 +127,8 @@ function teardown_file() { @test "push image - dedupe running" { start=`date +%s` run skopeo --insecure-policy copy --dest-tls-verify=false \ - oci:${TEST_DATA_DIR}/golang:1.20 \ - docker://127.0.0.1:8080/dedupe/golang:1.20 + oci:${TEST_DATA_DIR}/alpine:1 \ + docker://127.0.0.1:8080/dedupe/alpine:1 [ "$status" -eq 0 ] end=`date +%s` @@ -142,8 +143,8 @@ function teardown_file() { start=`date +%s` run skopeo --insecure-policy copy --src-tls-verify=false \ - docker://127.0.0.1:8080/dedupe/golang:1.20 \ - oci:${oci_data_dir}/dedupe/golang:1.20 + docker://127.0.0.1:8080/dedupe/alpine:1 \ + oci:${oci_data_dir}/dedupe/alpine:1 [ "$status" -eq 0 ] end=`date +%s` runtime=$((end-start)) @@ -158,8 +159,8 @@ function teardown_file() { start=`date +%s` run skopeo --insecure-policy copy --src-tls-verify=false \ - docker://127.0.0.1:8080/golang2:1.20 \ - oci:${oci_data_dir}/dedupe/golang2:1.20 + docker://127.0.0.1:8080/alpine2:1 \ + oci:${oci_data_dir}/dedupe/alpine2:1 [ "$status" -eq 0 ] end=`date +%s` runtime=$((end-start)) @@ -179,9 +180,6 @@ function teardown_file() { runtime=$((end-start)) echo "push image index exec time: $runtime sec" >&3 - run curl http://127.0.0.1:8080/v2/_catalog - [ "$status" -eq 0 ] - [ $(echo "${lines[-1]}" | jq '.repositories[0]') = '"busybox"' ] run curl http://127.0.0.1:8080/v2/busybox/tags/list [ "$status" -eq 0 ] [ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ] @@ -243,16 +241,16 @@ function teardown_file() { # attach signature echo "{\"artifact\": \"\", \"signature\": \"pat hancock\"}" > ${BATS_FILE_TMPDIR}/signature.json start=`date +%s` - run oras attach --plain-http 127.0.0.1:8080/golang:1.20 --image-spec v1.1-image --artifact-type 'signature/example' ${BATS_FILE_TMPDIR}/signature.json:application/json + run oras attach --plain-http 127.0.0.1:8080/alpine:1 --image-spec v1.1-image --artifact-type 'signature/example' ${BATS_FILE_TMPDIR}/signature.json:application/json [ "$status" -eq 0 ] end=`date +%s` runtime=$((end-start)) echo "attach signature exec time: $runtime sec" >&3 # attach sbom - echo "{\"version\": \"0.0.0.0\", \"artifact\": \"'127.0.0.1:8080/golang:1.20'\", \"contents\": \"good\"}" > ${BATS_FILE_TMPDIR}/sbom.json + echo "{\"version\": \"0.0.0.0\", \"artifact\": \"'127.0.0.1:8080/alpine:1'\", \"contents\": \"good\"}" > ${BATS_FILE_TMPDIR}/sbom.json start=`date +%s` - run oras attach --plain-http 127.0.0.1:8080/golang:1.20 --image-spec v1.1-image --artifact-type 'sbom/example' ${BATS_FILE_TMPDIR}/sbom.json:application/json + run oras attach --plain-http 127.0.0.1:8080/alpine:1 --image-spec v1.1-image --artifact-type 'sbom/example' ${BATS_FILE_TMPDIR}/sbom.json:application/json [ "$status" -eq 0 ] end=`date +%s` runtime=$((end-start)) @@ -262,7 +260,7 @@ function teardown_file() { @test "discover oras artifacts - dedupe running" { start=`date +%s` - run oras discover --plain-http -o json 127.0.0.1:8080/golang:1.20 + run oras discover --plain-http -o json 127.0.0.1:8080/alpine:1 [ "$status" -eq 0 ] end=`date +%s` runtime=$((end-start)) @@ -299,7 +297,7 @@ function teardown_file() { run regctl registry set localhost:8080 --tls disabled [ "$status" -eq 0 ] start=`date +%s` - run regctl image copy ocidir://${TEST_DATA_DIR}/golang:1.20 localhost:8080/test-regclient + run regctl image copy ocidir://${TEST_DATA_DIR}/alpine:1 localhost:8080/test-regclient [ "$status" -eq 0 ] end=`date +%s` runtime=$((end-start)) diff --git a/test/blackbox/restore_s3_blobs.bats b/test/blackbox/restore_s3_blobs.bats index f9a95ccd96..1443bf1ad9 100644 --- a/test/blackbox/restore_s3_blobs.bats +++ b/test/blackbox/restore_s3_blobs.bats @@ -12,7 +12,7 @@ function setup_file() { fi # Download test data to folder common for the entire suite, not just this file - skopeo --insecure-policy copy --format=oci docker://ghcr.io/project-zot/golang:1.20 oci:${TEST_DATA_DIR}/golang:1.20 + skopeo --insecure-policy copy --format=oci docker://ghcr.io/project-zot/test-images/alpine:3.17.3 oci:${TEST_DATA_DIR}/alpine:1 # Setup zot server local zot_root_dir=${BATS_FILE_TMPDIR}/zot local zot_config_file_dedupe=${BATS_FILE_TMPDIR}/zot_config_dedupe.json @@ -20,6 +20,7 @@ function setup_file() { local ZOT_LOG_FILE_DEDUPE=${BATS_FILE_TMPDIR}/zot-log-dedupe.json local ZOT_LOG_FILE_NODEDUPE=${BATS_FILE_TMPDIR}/zot-log-nodedupe.json + touch ${ZOT_LOG_FILE_NODEDUPE} mkdir -p ${zot_root_dir} cat > ${zot_config_file_dedupe}<&3 - run wait_for_string "dedupe rebuild: finished" ${ZOT_LOG_FILE} "10m" + run wait_for_string "dedupe rebuild: finished" ${ZOT_LOG_FILE} "5m" [ "$status" -eq 0 ] end=`date +%s` @@ -138,18 +142,20 @@ function teardown_file() { } @test "pulling a previous deduped image should work" { - # golang1 should have original blobs already + wait_zot_reachable 8080 + + # alpine1 should have original blobs already echo "pulling first image" >&3 run skopeo --insecure-policy copy --src-tls-verify=false \ - docker://127.0.0.1:8080/golang1:1.20 \ - oci:${TEST_DATA_DIR}/golang1:1.20 + docker://127.0.0.1:8080/alpine1:1 \ + oci:${TEST_DATA_DIR}/alpine1:1 [ "$status" -eq 0 ] echo "pulling second image" >&3 - # golang2 should have original blobs after restoring blobs + # alpine2 should have original blobs after restoring blobs run skopeo --insecure-policy copy --src-tls-verify=false \ - docker://127.0.0.1:8080/golang2:1.20 \ - oci:${TEST_DATA_DIR}/golang2:1.20 + docker://127.0.0.1:8080/alpine2:1 \ + oci:${TEST_DATA_DIR}/alpine2:1 [ "$status" -eq 0 ] } diff --git a/test/gc-stress/config-gc-bench-s3-localstack.json b/test/gc-stress/config-gc-bench-s3-localstack.json index 11151bdce2..047a0256bb 100644 --- a/test/gc-stress/config-gc-bench-s3-localstack.json +++ b/test/gc-stress/config-gc-bench-s3-localstack.json @@ -4,9 +4,9 @@ "rootDirectory": "/tmp/zot/s3", "gc": true, "gcReferrers": false, - "gcDelay": "50m", - "untaggedImageRetentionDelay": "50m", - "gcInterval": "2m", + "gcDelay": "80m", + "untaggedImageRetentionDelay": "80m", + "gcInterval": "5m", "storageDriver": { "name": "s3", "rootdirectory": "/zot", diff --git a/test/gc-stress/config-gc-referrers-bench-s3-localstack.json b/test/gc-stress/config-gc-referrers-bench-s3-localstack.json index 98cee6bc48..74c372812e 100644 --- a/test/gc-stress/config-gc-referrers-bench-s3-localstack.json +++ b/test/gc-stress/config-gc-referrers-bench-s3-localstack.json @@ -4,9 +4,9 @@ "rootDirectory": "/tmp/zot/s3", "gc": true, "gcReferrers": true, - "gcDelay": "50m", - "untaggedImageRetentionDelay": "50m", - "gcInterval": "2m", + "gcDelay": "80m", + "untaggedImageRetentionDelay": "80m", + "gcInterval": "5m", "storageDriver": { "name": "s3", "rootdirectory": "/zot",