mirror of
https://github.com/project-zot/zot.git
synced 2026-06-15 11:37:56 +08:00
9aff5b8d08
* chore: fix dependabot alerts Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: fix dependabot alerts Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: fix dependabot alerts Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: fix golangci-lint findings from CI Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: fix golangci-lint gosec warnings Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: update code to use slices package and address gosec linting issues Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * build: fix makefile target Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: update tests to use context in HTTP requests and add gosec annotations Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: update tests to use context in HTTP requests Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: update tests to use context in HTTP requests Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: update tests to use context in HTTP requests Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: update tests to use context in HTTP requests Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: bump zui version Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: update test helpers and improve security settings in tests Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> * chore: add gosec linting directive for test path construction Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com> --------- Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
272 lines
8.0 KiB
YAML
272 lines
8.0 KiB
YAML
name: "GC stress test"
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches: [main]
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
gc-referrers-stress-local:
|
|
name: GC(with referrers) on filesystem with short interval
|
|
runs-on: oracle-vm-8cpu-32gb-x86-64
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
cache: false
|
|
check-latest: true
|
|
go-version: 1.26.x
|
|
|
|
- name: Run zb
|
|
id: bench
|
|
run: |
|
|
make binary
|
|
make bench
|
|
./bin/zot-linux-amd64 serve test/gc-stress/config-gc-referrers-bench-local.json &
|
|
sleep 10
|
|
bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080
|
|
|
|
killall -r zot-*
|
|
|
|
# clean zot storage
|
|
sudo rm -rf /tmp/zot
|
|
continue-on-error: true
|
|
|
|
- name: Upload zot logs
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: always()
|
|
with:
|
|
name: gc-referrers-bench-local
|
|
path: /tmp/gc-referrers-bench-local.log
|
|
if-no-files-found: error
|
|
|
|
- name: Check on failures
|
|
if: steps.bench.outcome != 'success'
|
|
run: |
|
|
cat /tmp/gc-referrers-bench-local.log
|
|
exit 1
|
|
|
|
gc-stress-local:
|
|
name: GC(without referrers) on filesystem with short interval
|
|
runs-on: oracle-vm-8cpu-32gb-x86-64
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
cache: false
|
|
check-latest: true
|
|
go-version: 1.26.x
|
|
|
|
- name: Run zb
|
|
id: bench
|
|
run: |
|
|
make binary
|
|
make bench
|
|
./bin/zot-linux-amd64 serve test/gc-stress/config-gc-bench-local.json &
|
|
sleep 10
|
|
bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080
|
|
|
|
killall -r zot-*
|
|
|
|
# clean zot storage
|
|
sudo rm -rf /tmp/zot
|
|
continue-on-error: true
|
|
|
|
- name: Upload zot logs
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: always()
|
|
with:
|
|
name: gc-bench-local
|
|
path: /tmp/gc-bench-local.log
|
|
if-no-files-found: error
|
|
|
|
- name: Check on failures
|
|
if: steps.bench.outcome != 'success'
|
|
run: |
|
|
cat /tmp/gc-bench-local.log
|
|
exit 1
|
|
|
|
gc-referrers-stress-s3:
|
|
name: GC(with referrers) on S3(minio) with short interval
|
|
runs-on: oracle-vm-8cpu-32gb-x86-64
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
cache: false
|
|
check-latest: true
|
|
go-version: 1.26.x
|
|
- uses: ./.github/actions/setup-localstack
|
|
- name: Setup minio service
|
|
run: |
|
|
docker run -d -p 9000:9000 --name minio \
|
|
-e "MINIO_ACCESS_KEY=minioadmin" \
|
|
-e "MINIO_SECRET_KEY=minioadmin" \
|
|
-v /tmp/data:/data \
|
|
-v /tmp/config:/root/.minio \
|
|
--health-cmd "curl http://localhost:9000/minio/health/live" \
|
|
minio/minio:RELEASE.2024-07-16T23-46-41Z server /data
|
|
- name: Install py minio
|
|
run: pip3 install minio==7.2.18
|
|
|
|
- name: Wait for minio to come up
|
|
run: |
|
|
sleep 10
|
|
curl --connect-timeout 5 \
|
|
--max-time 120 \
|
|
--retry 12 \
|
|
--retry-max-time 120 \
|
|
'http://localhost:9000/minio/health/live'
|
|
|
|
- name: Create minio bucket
|
|
run: |
|
|
python3 - <<'EOF'
|
|
from minio import Minio
|
|
|
|
try:
|
|
minio = Minio(
|
|
'localhost:9000',
|
|
access_key='minioadmin',
|
|
secret_key='minioadmin',
|
|
secure=False
|
|
)
|
|
except Exception as ex:
|
|
raise
|
|
|
|
minio.make_bucket('zot-storage')
|
|
print(f'{minio.list_buckets()}')
|
|
EOF
|
|
|
|
- name: Run zb
|
|
id: bench
|
|
run: |
|
|
make binary
|
|
make bench
|
|
./bin/zot-linux-amd64 serve test/gc-stress/config-gc-referrers-bench-s3-minio.json &
|
|
sleep 10
|
|
bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080
|
|
|
|
killall -r zot-*
|
|
|
|
# clean zot storage
|
|
sudo rm -rf /tmp/zot
|
|
env:
|
|
AWS_ACCESS_KEY_ID: fake
|
|
AWS_SECRET_ACCESS_KEY: fake
|
|
continue-on-error: true
|
|
|
|
- name: Upload zot logs
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: always()
|
|
with:
|
|
name: gc-referrers-bench-s3
|
|
path: /tmp/gc-referrers-bench-s3.log
|
|
if-no-files-found: error
|
|
|
|
- name: Check on failures
|
|
if: steps.bench.outcome != 'success'
|
|
run: |
|
|
cat /tmp/gc-referrers-bench-s3.log
|
|
exit 1
|
|
|
|
- uses: ./.github/actions/teardown-localstack
|
|
|
|
gc-stress-s3:
|
|
name: GC(without referrers) on S3(minio) with short interval
|
|
runs-on: oracle-vm-8cpu-32gb-x86-64
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
cache: false
|
|
check-latest: true
|
|
go-version: 1.26.x
|
|
- uses: ./.github/actions/setup-localstack
|
|
- name: Setup minio service
|
|
run: |
|
|
docker run -d -p 9000:9000 --name minio \
|
|
-e "MINIO_ACCESS_KEY=minioadmin" \
|
|
-e "MINIO_SECRET_KEY=minioadmin" \
|
|
-v /tmp/data:/data \
|
|
-v /tmp/config:/root/.minio \
|
|
--health-cmd "curl http://localhost:9000/minio/health/live" \
|
|
minio/minio:RELEASE.2024-07-16T23-46-41Z server /data
|
|
- name: Install py minio
|
|
run: pip3 install minio==7.2.18
|
|
|
|
- name: Wait for minio to come up
|
|
run: |
|
|
sleep 10
|
|
curl --connect-timeout 5 \
|
|
--max-time 120 \
|
|
--retry 12 \
|
|
--retry-max-time 120 \
|
|
'http://localhost:9000/minio/health/live'
|
|
|
|
- name: Create minio bucket
|
|
run: |
|
|
python3 - <<'EOF'
|
|
from minio import Minio
|
|
|
|
try:
|
|
minio = Minio(
|
|
'localhost:9000',
|
|
access_key='minioadmin',
|
|
secret_key='minioadmin',
|
|
secure=False
|
|
)
|
|
except Exception as ex:
|
|
raise
|
|
|
|
minio.make_bucket('zot-storage')
|
|
print(f'{minio.list_buckets()}')
|
|
EOF
|
|
|
|
- name: Run zb
|
|
id: bench
|
|
run: |
|
|
make binary
|
|
make bench
|
|
./bin/zot-linux-amd64 serve test/gc-stress/config-gc-bench-s3-minio.json &
|
|
sleep 10
|
|
bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080
|
|
|
|
killall -r zot-*
|
|
|
|
# clean zot storage
|
|
sudo rm -rf /tmp/zot
|
|
env:
|
|
AWS_ACCESS_KEY_ID: fake
|
|
AWS_SECRET_ACCESS_KEY: fake
|
|
continue-on-error: true
|
|
|
|
- name: Upload zot logs
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: always()
|
|
with:
|
|
name: gc-bench-s3
|
|
path: /tmp/gc-bench-s3.log
|
|
if-no-files-found: error
|
|
|
|
- name: Check on failures
|
|
if: steps.bench.outcome != 'success'
|
|
run: |
|
|
cat /tmp/gc-bench-s3.log
|
|
exit 1
|
|
|
|
- uses: ./.github/actions/teardown-localstack
|