From 71468261268822ae63ffbbb4d81391479a95fcc7 Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani <45800463+rchincha@users.noreply.github.com> Date: Fri, 19 Apr 2024 00:08:36 -0700 Subject: [PATCH] ci: upgrade localstack to v3.3.0 (#2390) There are performance improvements in recent releases of localstack. 1) install localstack via "pip install" and requires python 3.11 2) also pull a recently pushed localstack docker image to ghcr.io Signed-off-by: Ramkumar Chinchani --- .github/actions/setup-localstack/action.yaml | 7 ++++-- .github/workflows/ecosystem-tools.yaml | 7 ++++-- .github/workflows/nightly.yaml | 7 ++++-- .github/workflows/sync-3rdparty-images.yaml | 23 ++++++++++++++++++++ 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-localstack/action.yaml b/.github/actions/setup-localstack/action.yaml index 69d41737..ee503fe9 100644 --- a/.github/actions/setup-localstack/action.yaml +++ b/.github/actions/setup-localstack/action.yaml @@ -18,11 +18,14 @@ runs: registry: ghcr.io username: ${{ inputs.username }} password: ${{ inputs.password }} + - uses: actions/setup-python@v5 + with: + python-version: '3.11' - shell: bash run: | - pip install localstack==2.3.1 # Install LocalStack cli + pip install localstack==3.3.0 # Install LocalStack cli # Below image was copied manually from localstack/localstack:2.2 and uploaded to ghcr - docker pull ghcr.io/project-zot/ci-images/localstack:2.3.1 # Make sure to pull a working version of the image + 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 diff --git a/.github/workflows/ecosystem-tools.yaml b/.github/workflows/ecosystem-tools.yaml index 89ced4d7..05dd8c71 100644 --- a/.github/workflows/ecosystem-tools.yaml +++ b/.github/workflows/ecosystem-tools.yaml @@ -61,11 +61,14 @@ jobs: 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==2.3.1 awscli-local[ver1] # install LocalStack cli and awslocal - docker pull ghcr.io/project-zot/ci-images/localstack:2.3.1 # Make sure to pull a working version of the image + 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 diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 7034af52..3df6e3b2 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -39,11 +39,14 @@ jobs: 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==2.3.1 awscli-local[ver1] # install LocalStack cli and awslocal - docker pull ghcr.io/project-zot/ci-images/localstack:2.3.1 # Make sure to pull the latest version of the image + 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 localstack start -d # Start LocalStack in the background echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container diff --git a/.github/workflows/sync-3rdparty-images.yaml b/.github/workflows/sync-3rdparty-images.yaml index c2f3b715..99bc76db 100644 --- a/.github/workflows/sync-3rdparty-images.yaml +++ b/.github/workflows/sync-3rdparty-images.yaml @@ -44,3 +44,26 @@ jobs: run: | oras login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io oras copy ghcr.io/aquasecurity/trivy-db:2 ghcr.io/${{ github.repository_owner }}/trivy-db:2 + sync-localstack: + name: 'localstack' + permissions: + contents: read + packages: write + strategy: + matrix: + localstack_version: + - "3.3.0" + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Docker Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Tag and push localstack to ghcr + run: | + docker trust inspect localstack:${{ matrix.localstack_version }} + docker pull localstack:${{ matrix.localstack_version }} + docker tag localstack:${{ matrix.localstack_version }} ghcr.io/${{ github.repository_owner }}/ci-images/localstack:${{ matrix.localstack_version }} + docker push ghcr.io/${{ github.repository_owner }}/ci-images/localstack:${{ matrix.localstack_version }}