diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 6a936f90..d84c1f0d 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -14,10 +14,9 @@ permissions: read-all jobs: dedupe: name: Dedupe/restore blobs - runs-on: ubuntu-latest-16-cores + runs-on: ubuntu-latest-8-cores steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/clean-runner - uses: actions/setup-go@v3 with: go-version: 1.20.x @@ -62,11 +61,10 @@ jobs: sync: name: Sync harness - runs-on: ubuntu-latest-16-cores + runs-on: ubuntu-latest-8-cores steps: - name: Check out source code uses: actions/checkout@v4 - - uses: ./.github/actions/clean-runner - uses: actions/setup-go@v3 with: go-version: 1.20.x @@ -84,7 +82,6 @@ jobs: runs-on: ubuntu-latest-16-cores steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/clean-runner - uses: actions/setup-go@v4 with: cache: false @@ -92,6 +89,7 @@ jobs: - uses: ./.github/actions/setup-localstack - name: Run zb + timeout-minutes: 240 id: bench run: | make binary @@ -121,7 +119,6 @@ jobs: runs-on: ubuntu-latest-16-cores steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/clean-runner - uses: actions/setup-go@v4 with: cache: false @@ -129,6 +126,7 @@ jobs: - uses: ./.github/actions/setup-localstack - name: Run zb + timeout-minutes: 240 id: bench run: | make binary @@ -155,12 +153,41 @@ jobs: docker-image: name: Build docker image (for users still using Docker environments) - runs-on: ubuntu-latest-16-cores + runs-on: ubuntu-latest-4-cores steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/clean-runner - name: Check out source code uses: actions/checkout@v4 - name: Build image run: | make docker-image + + kind-setup: + name: Prometheus setup + runs-on: ubuntu-latest-8-cores + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v3 + with: + go-version: 1.20.x + - 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 diff --git a/examples/kind/kind-ci.sh b/examples/kind/kind-ci.sh new file mode 100755 index 00000000..7ccf8a86 --- /dev/null +++ b/examples/kind/kind-ci.sh @@ -0,0 +1,108 @@ +#!/bin/sh +set -o errexit + +# Reference: https://kind.sigs.k8s.io/docs/user/local-registry/ + +# set no_proxy if applicable +if [ ! -z "${no_proxy}" ]; then + echo "Updating no_proxy env var"; + export no_proxy=${no_proxy},kind-registry; + export NO_PROXY=${no_proxy}; +fi + +# create registry container unless it already exists +reg_name='kind-registry' +reg_port='5001' +if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then + docker run \ + -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \ + ghcr.io/project-zot/zot-minimal-linux-amd64:latest +fi + +CLUSTER_NAME=kind +## Delete the cluster if it already exist +kind get clusters | grep ${CLUSTER_NAME} && kind delete cluster --name ${CLUSTER_NAME} + +# create a cluster with the local registry enabled in containerd +cat <