2023-04-07 11:49:24 -05:00
name : 'Nightly jobs'
on :
schedule :
- cron : '30 1 * * *'
workflow_dispatch :
2023-08-23 11:21:43 -05:00
2023-04-07 11:49:24 -05:00
permissions : read-all
2024-05-20 11:05:21 -05:00
# The following tests are run:
2023-04-07 11:49:24 -05:00
# 1. run zot with local storage and dedupe disabled, push images, restart zot with dedupe enabled
# task scheduler will start a dedupe all blobs process at zot startup and it shouldn't interfere with clients.
# 2. run zot with s3 storage and dynamodb and dedupe enabled, push images, restart zot with dedupe false and no cache
# task scheduler will start a restore all blobs process at zot startup, after it finishes all blobs should be restored to their original state (have content)
2024-05-20 11:05:21 -05:00
# 3. run many, many, many instances of zot with shared storage and metadata front-ended by HAProxy. start a long-running zb run with high concurrency and number of requests
# to achieve a long-running sustained load on the system. The system is expected to perform well without errors and return performance data after the test.
2023-04-07 11:49:24 -05:00
jobs :
2023-05-31 12:26:23 -05:00
dedupe :
2023-04-07 11:49:24 -05:00
name : Dedupe/restore blobs
2024-09-30 13:24:24 -05:00
runs-on : ubuntu-latest
2023-04-07 11:49:24 -05:00
steps :
2023-09-05 14:30:49 -05:00
- uses : actions/checkout@v4
2023-12-12 05:44:28 -05:00
- uses : actions/setup-go@v5
2023-04-07 11:49:24 -05:00
with :
2024-11-08 11:58:55 -05:00
go-version : 1.23 .x
2023-04-07 11:49:24 -05:00
- name : Install dependencies
run : |
cd $GITHUB_WORKSPACE
2024-02-07 13:54:28 -05:00
go install github.com/swaggo/swag/cmd/swag@v1.16.2
2023-04-07 11:49:24 -05:00
go mod download
sudo apt-get update
sudo apt-get install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config rpm uidmap
# install skopeo
2023-06-16 02:28:43 -05:00
git clone -b v1.12.0 https://github.com/containers/skopeo.git
2023-04-07 11:49:24 -05:00
cd skopeo
make bin/skopeo
sudo cp bin/skopeo /usr/bin
skopeo -v
2023-09-29 03:40:46 -05:00
- name : Log in to GitHub Docker Registry
uses : docker/login-action@v3
with :
registry : ghcr.io
username : ${{ github.actor }}
password : ${{ github.token }}
2024-04-19 02:08:36 -05:00
- uses : actions/setup-python@v5
with :
python-version : '3.11'
2023-04-07 11:49:24 -05:00
- name : Install localstack
run : |
pip install --upgrade pyopenssl
2024-04-19 02:08:36 -05:00
pip install localstack==3.3.0 awscli-local[ver1] # install LocalStack cli and awslocal
docker pull ghcr.io/project-zot/ci-images/localstack:3.3.0 # Make sure to pull the latest version of the image
2023-04-07 11:49:24 -05:00
localstack start -d # Start LocalStack in the background
2023-08-23 11:21:43 -05:00
2023-04-07 11:49:24 -05:00
echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container
2023-08-23 11:21:43 -05:00
localstack wait -t 30 # to become ready before timing out
echo "Startup complete"
2023-09-07 13:06:21 -05:00
- name : Run blackbox nightly dedupe tests
2023-04-07 11:49:24 -05:00
run : |
2023-09-07 13:06:21 -05:00
# test restoring s3 blobs after cache is deleted
# test deduping filesystem blobs after switching dedupe to enable
make run-blackbox-dedupe-nightly
2023-04-07 11:49:24 -05:00
env :
AWS_ACCESS_KEY_ID : fake
AWS_SECRET_ACCESS_KEY : fake
2023-09-28 13:59:52 -05:00
- uses : ./.github/actions/teardown-localstack
2023-05-31 12:26:23 -05:00
sync :
name : Sync harness
2024-09-30 13:24:24 -05:00
runs-on : ubuntu-latest
2023-05-31 12:26:23 -05:00
steps :
2023-07-06 08:50:12 -05:00
- name : Check out source code
2023-09-05 14:30:49 -05:00
uses : actions/checkout@v4
2023-12-12 05:44:28 -05:00
- uses : actions/setup-go@v5
2023-05-31 12:26:23 -05:00
with :
2024-11-08 11:58:55 -05:00
go-version : 1.23 .x
2023-05-31 12:26:23 -05:00
- name : Install dependencies
run : |
cd $GITHUB_WORKSPACE
2024-02-07 13:54:28 -05:00
go install github.com/swaggo/swag/cmd/swag@v1.16.2
2023-05-31 12:26:23 -05:00
go mod download
- name : Run sync harness
run : |
2023-09-07 13:06:21 -05:00
make run-blackbox-sync-nightly
2023-09-01 12:54:39 -05:00
gc-referrers-stress-s3 :
2023-09-20 11:25:06 -05:00
name : GC(with referrers) on S3(localstack) with short interval
2023-10-21 04:07:32 -05:00
runs-on : ubuntu-latest-16-cores
2023-09-01 12:54:39 -05:00
steps :
2023-09-05 14:30:49 -05:00
- uses : actions/checkout@v4
2023-12-12 05:44:28 -05:00
- uses : actions/setup-go@v5
2023-09-01 12:54:39 -05:00
with :
cache : false
2024-11-08 11:58:55 -05:00
go-version : 1.23 .x
2023-09-28 13:59:52 -05:00
- uses : ./.github/actions/setup-localstack
2023-09-20 11:25:06 -05:00
2023-09-01 12:54:39 -05:00
- name : Run zb
2023-11-15 12:51:03 -05:00
timeout-minutes : 240
2023-09-20 11:25:06 -05:00
id : bench
2023-09-01 12:54:39 -05:00
run : |
make binary
make bench
2023-09-20 11:25:06 -05:00
./bin/zot-linux-amd64 serve test/gc-stress/config-gc-referrers-bench-s3-localstack.json &
2023-09-01 12:54:39 -05:00
sleep 10
2023-10-12 08:42:07 -05:00
bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080 --skip-cleanup
2023-09-01 12:54:39 -05:00
killall -r zot-*
# clean zot storage
sudo rm -rf /tmp/zot
env :
AWS_ACCESS_KEY_ID : fake
AWS_SECRET_ACCESS_KEY : fake
2023-09-20 11:25:06 -05:00
continue-on-error : true
- name : Check on failures
if : steps.bench.outcome != 'success'
run : |
cat /tmp/gc-referrers-bench-s3.log
exit 1
2023-09-28 13:59:52 -05:00
- uses : ./.github/actions/teardown-localstack
2023-09-01 12:54:39 -05:00
gc-stress-s3 :
2023-09-20 11:25:06 -05:00
name : GC(without referrers) on S3(localstack) with short interval
2023-10-21 04:07:32 -05:00
runs-on : ubuntu-latest-16-cores
2023-09-01 12:54:39 -05:00
steps :
2023-09-05 14:30:49 -05:00
- uses : actions/checkout@v4
2023-12-12 05:44:28 -05:00
- uses : actions/setup-go@v5
2023-09-01 12:54:39 -05:00
with :
cache : false
2024-11-08 11:58:55 -05:00
go-version : 1.23 .x
2023-09-28 13:59:52 -05:00
- uses : ./.github/actions/setup-localstack
2023-09-20 11:25:06 -05:00
2023-09-01 12:54:39 -05:00
- name : Run zb
2023-11-15 12:51:03 -05:00
timeout-minutes : 240
2023-09-20 11:25:06 -05:00
id : bench
2023-09-01 12:54:39 -05:00
run : |
make binary
make bench
2023-09-20 11:25:06 -05:00
./bin/zot-linux-amd64 serve test/gc-stress/config-gc-bench-s3-localstack.json &
2023-09-01 12:54:39 -05:00
sleep 10
2023-10-12 08:42:07 -05:00
bin/zb-linux-amd64 -c 10 -n 100 -o ci-cd http://localhost:8080 --skip-cleanup
2023-09-01 12:54:39 -05:00
killall -r zot-*
# clean zot storage
sudo rm -rf /tmp/zot
env :
AWS_ACCESS_KEY_ID : fake
AWS_SECRET_ACCESS_KEY : fake
2023-09-20 11:25:06 -05:00
continue-on-error : true
- name : Check on failures
if : steps.bench.outcome != 'success'
run : |
cat /tmp/gc-bench-s3.log
exit 1
2023-09-28 13:59:52 -05:00
- uses : ./.github/actions/teardown-localstack
2023-10-04 11:12:56 -05:00
docker-image :
name : Build docker image (for users still using Docker environments)
2023-11-15 13:44:31 -05:00
runs-on : ubuntu-latest
2023-10-04 11:12:56 -05:00
steps :
- uses : actions/checkout@v4
- name : Check out source code
uses : actions/checkout@v4
2023-11-16 11:59:14 -05:00
- uses : ./.github/actions/clean-runner
2023-10-04 11:12:56 -05:00
- name : Build image
run : |
make docker-image
2023-11-15 12:51:03 -05:00
kind-setup :
name : Prometheus setup
runs-on : ubuntu-latest-8-cores
steps :
- uses : actions/checkout@v4
2023-12-12 05:44:28 -05:00
- uses : actions/setup-go@v5
2023-11-15 12:51:03 -05:00
with :
2024-11-08 11:58:55 -05:00
go-version : 1.23 .x
2023-11-15 12:51:03 -05:00
- name : Install dependencies
run : |
cd $GITHUB_WORKSPACE
go mod download
sudo apt-get update
sudo apt-get install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config rpm uidmap
# install skopeo
git clone -b v1.12.0 https://github.com/containers/skopeo.git
cd skopeo
make bin/skopeo
sudo cp bin/skopeo /usr/bin
skopeo -v
- name : Log in to GitHub Docker Registry
uses : docker/login-action@v3
with :
registry : ghcr.io
username : ${{ github.actor }}
password : ${{ github.token }}
- name : Run tests
run : |
./examples/kind/kind-ci.sh
2024-05-20 11:05:21 -05:00
cloud-scale-out :
name : s3+dynamodb scale-out
runs-on : ubuntu-latest-16-cores
steps :
- uses : actions/checkout@v4
- uses : actions/setup-go@v5
with :
cache : false
2024-11-08 11:58:55 -05:00
go-version : 1.23 .x
2024-05-20 11:05:21 -05:00
- name : Install dependencies
run : |
cd $GITHUB_WORKSPACE
go install github.com/swaggo/swag/cmd/swag@v1.16.2
go mod download
sudo apt-get update
sudo apt-get install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config rpm uidmap haproxy jq
# install skopeo
git clone -b v1.12.0 https://github.com/containers/skopeo.git
cd skopeo
make bin/skopeo
sudo cp bin/skopeo /usr/bin
skopeo -v
cd $GITHUB_WORKSPACE
- name : Log in to GitHub Docker Registry
uses : docker/login-action@v3
with :
registry : ghcr.io
username : ${{ github.actor }}
password : ${{ github.token }}
- uses : actions/setup-python@v5
with :
python-version : '3.11'
- name : Install localstack
run : |
pip install --upgrade pyopenssl
pip install localstack==3.3.0 awscli-local[ver1] # install LocalStack cli and awslocal
docker pull ghcr.io/project-zot/ci-images/localstack:3.3.0 # Make sure to pull a working version of the image
localstack start -d # Start LocalStack in the background
echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container
localstack wait -t 30 # to become ready before timing out
echo "Startup complete"
- name : Run cloud scale-out high scale performance tests
id : scale
run : |
make run-cloud-scale-out-high-scale-tests
env :
AWS_ACCESS_KEY_ID : fake
AWS_SECRET_ACCESS_KEY : fake
continue-on-error : true
- name : print service logs
run : |
sudo dmesg
cat /tmp/zot-logs/*.log
- name : multi-hop detection
id : multihop
run : |
if cat /tmp/zot-logs/*.log | grep 'cannot proxy an already proxied request'; then
echo "detected multi-hop"
exit 1
else
exit 0
fi
continue-on-error : true
- name : clean up logs
run : |
rm -r /tmp/zot-logs
- name : fail job if error
if : ${{ steps.scale.outcome != 'success' || steps.multihop.outcome != 'success' }}
run : |
exit 1
- name : Upload zb test results zip as build artifact
if : steps.scale.outcome == 'success'
uses : actions/upload-artifact@v4
with :
name : zb-cloud-scale-out-perf-results-${{ github.sha }}
path : ./zb-results/
- uses : ./.github/actions/teardown-localstack