Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: resource tuning for faster runs #1967

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions: read-all
jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ jobs:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, darwin, freebsd]
arch: [amd64, arm64]
steps:
- name: Check out source code
uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- name: Install go
uses: actions/setup-go@v4
with:
Expand Down Expand Up @@ -72,17 +71,15 @@ jobs:
curl -Lo notation.tar.gz https://github.com/notaryproject/notation/releases/download/v1.0.0-rc.4/notation_1.0.0-rc.4_linux_amd64.tar.gz
sudo tar xvzf notation.tar.gz -C /usr/bin notation
rm -f notation.tar.gz
- uses: ./.github/actions/check-diskspace
- name: Run build
timeout-minutes: 80
timeout-minutes: 10
run: |
echo "Building for $OS:$ARCH"
cd $GITHUB_WORKSPACE
make binary binary-minimal binary-debug cli bench exporter-minimal
env:
OS: ${{ matrix.os }}
ARCH: ${{ matrix.arch }}
- uses: ./.github/actions/check-diskspace

- name: Generate GraphQL Introspection JSON on Release
if: github.event_name == 'release' && github.event.action == 'published' && matrix.os == 'linux' && matrix.arch == 'amd64'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions: read-all
jobs:
client-tools:
name: Stateless zot with shared reliable storage
runs-on: ubuntu-latest
runs-on: ubuntu-latest-4-cores
# services:
# minio:
# image: minio/minio:edge-cicd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ permissions: read-all
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
runs-on: ubuntu-latest-4-cores
permissions:
actions: read
contents: read
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ecosystem-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ permissions: read-all
jobs:
client-tools:
name: Check client tools
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- uses: actions/setup-go@v4
with:
cache: false
Expand Down Expand Up @@ -53,7 +52,6 @@ jobs:
make bin/dex
./bin/dex serve $GITHUB_WORKSPACE/test/dex/config-dev.yaml &
cd $GITHUB_WORKSPACE
- uses: ./.github/actions/check-diskspace
- name: Run CI tests
run: |
make run-blackbox-ci
Expand All @@ -79,5 +77,4 @@ jobs:
env:
AWS_ACCESS_KEY_ID: fake
AWS_SECRET_ACCESS_KEY: fake
- uses: ./.github/actions/check-diskspace
- uses: ./.github/actions/teardown-localstack
12 changes: 4 additions & 8 deletions .github/workflows/gc-stress-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ permissions: read-all
jobs:
gc-referrers-stress-local:
name: GC(with referrers) on filesystem with short interval
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- uses: actions/setup-go@v4
with:
cache: false
Expand Down Expand Up @@ -46,10 +45,9 @@ jobs:

gc-stress-local:
name: GC(without referrers) on filesystem with short interval
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- uses: actions/setup-go@v4
with:
cache: false
Expand Down Expand Up @@ -78,10 +76,9 @@ jobs:

gc-referrers-stress-s3:
name: GC(with referrers) on S3(minio) with short interval
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- uses: actions/setup-go@v4
with:
cache: false
Expand Down Expand Up @@ -154,10 +151,9 @@ jobs:

gc-stress-s3:
name: GC(without referrers) on S3(minio) with short interval
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- uses: actions/setup-go@v4
with:
cache: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/setup-go@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gqlgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions: read-all
jobs:
gqlgen:
name: Check GQL generation
runs-on: ubuntu-latest
runs-on: ubuntu-latest-4-cores
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions: read-all
jobs:
dedupe:
name: Dedupe/restore blobs
runs-on: ubuntu-latest-8-cores
runs-on: ubuntu-latest-4-cores
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:

sync:
name: Sync harness
runs-on: ubuntu-latest-8-cores
runs-on: ubuntu-latest-4-cores
steps:
- name: Check out source code
uses: actions/checkout@v4
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:

docker-image:
name: Build docker image (for users still using Docker environments)
runs-on: ubuntu-latest-4-cores
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out source code
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- name: Install go
uses: actions/setup-go@v4
with:
Expand All @@ -38,7 +37,6 @@ jobs:
cd $GITHUB_WORKSPACE
go mod download
- uses: ./.github/actions/setup-localstack
- uses: ./.github/actions/check-diskspace
- name: run zot minimal tests
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -53,14 +51,12 @@ jobs:
with:
name: coverage-minimal
path: coverage-minimal.txt
- uses: ./.github/actions/check-diskspace
- uses: ./.github/actions/teardown-localstack
test-run-extensions:
name: Run zot with extensions tests
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- uses: actions/setup-go@v4
with:
cache: false
Expand Down Expand Up @@ -94,14 +90,12 @@ jobs:
with:
name: coverage-extended
path: coverage-extended.txt
- uses: ./.github/actions/check-diskspace
- uses: ./.github/actions/teardown-localstack
test-run-devmode:
name: Running privileged tests on Linux
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-runner
- uses: actions/setup-go@v4
with:
cache: false
Expand All @@ -120,7 +114,6 @@ jobs:
run: |
cd $GITHUB_WORKSPACE
go mod download
- uses: ./.github/actions/check-diskspace
- name: run zot development-mode unit tests (possibly using failure injection)
run: make test-devmode
- name: run zot privileged tests
Expand All @@ -130,7 +123,6 @@ jobs:
with:
name: coverage-devmode
path: coverage-dev-*.txt
- uses: ./.github/actions/check-diskspace
test-coverage:
name: Collect all test coverage
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:

jobs:
zap_scan:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-4-cores
name: Scan ZOT using ZAP
strategy:
matrix:
Expand Down
20 changes: 2 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -486,24 +486,8 @@ run-blackbox-tests: $(BATS_TEST_FILE_PATH) check-blackbox-prerequisites binary b

.PHONY: run-blackbox-ci
run-blackbox-ci: check-blackbox-prerequisites binary binary-minimal cli
# ideally we would run a single bats command but too much disk space would be used at once
echo running CI bats tests; \
$(BATS) $(BATS_FLAGS) test/blackbox/pushpull.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/pushpull_authn.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/delete_images.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/referrers.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/metadata.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/anonymous_policy.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/annotations.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/detect_manifest_collision.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/cve.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/sync.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/sync_docker.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/sync_replica_cluster.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/scrub.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/garbage_collect.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/metrics.bats && \
$(BATS) $(BATS_FLAGS) test/blackbox/metrics_minimal.bats
echo running CI bats tests concurently
BATS_FLAGS="$(BATS_FLAGS)" test/blackbox/ci.sh

.PHONY: run-blackbox-cloud-ci
run-blackbox-cloud-ci: check-blackbox-prerequisites check-awslocal binary $(BATS)
Expand Down
Loading
Loading