From 9a26454a8eaab85df513eb381ed9dc7e54817ec0 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 13 Mar 2024 12:18:36 +0100 Subject: [PATCH 1/3] Migrate to ghcr Issue: BB-578 --- .github/workflows/release.yaml | 23 +++++++++++------------ .github/workflows/tests.yaml | 6 +++--- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1089edf6d..b08a71686 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,6 @@ on: required: true env: - REGISTRY_NAME: registry.scality.com PROJECT_NAME: ${{ github.event.repository.name }} jobs: @@ -23,20 +22,20 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: - registry: ${{ env.REGISTRY_NAME }} - username: ${{ secrets.REGISTRY_LOGIN }} - password: ${{ secrets.REGISTRY_PASSWORD }} + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} - name: Push dashboards into the production namespace run: | - oras push ${{ env.REGISTRY_NAME }}/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}-dashboards:${{ github.event.inputs.tag }} \ - ingestion/ingestion-processor-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-producer-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-global-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-processor-alert.yaml:application/prometheus-alerts+yaml \ - ingestion/ingestion-producer-alert.yaml:application/prometheus-alerts+yaml + oras push ghcr.io/${{ github.repository }}/${{ env.PROJECT_NAME }}-dashboards:${{ github.event.inputs.tag }} \ + ingestion/ingestion-processor-dashboard.json:application/grafana-dashboard+json \ + ingestion/ingestion-producer-dashboard.json:application/grafana-dashboard+json \ + ingestion/ingestion-global-dashboard.json:application/grafana-dashboard+json \ + ingestion/ingestion-processor-alert.yaml:application/prometheus-alerts+yaml \ + ingestion/ingestion-producer-alert.yaml:application/prometheus-alerts+yaml working-directory: monitoring - name: Build and push @@ -44,7 +43,7 @@ jobs: with: context: . push: true - tags: ${{ env.REGISTRY_NAME }}/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}:${{ github.event.inputs.tag }} + tags: ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }} cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 33b248ce1..22fabeda7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,14 +32,14 @@ jobs: with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ github.token }} - name: Build and push kafka uses: docker/build-push-action@v2 with: push: true context: .github/dockerfiles/kafka - tags: "ghcr.io/scality/backbeat/ci-kafka:${{ github.sha }}" + tags: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max @@ -60,7 +60,7 @@ jobs: ports: - 6379:6379 kafka: - image: ghcr.io/scality/backbeat/ci-kafka:${{ github.sha }} + image: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }} credentials: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} From 8d74ea40548d563715c439e7fd3873712870294e Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Tue, 9 Apr 2024 11:31:17 +0200 Subject: [PATCH 2/3] Upgrade actions - checkout@v4 - setup-buildx@v3 - login@v3 - build-push@v5 - gh-release@v2 - setup-go@v5 - setup-node@v4 Issue: BB-578 --- .github/workflows/release.yaml | 10 ++++----- .github/workflows/tests.yaml | 39 ++++++++++------------------------ 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b08a71686..50b69c23e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,13 +16,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildk - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -39,7 +39,7 @@ jobs: working-directory: monitoring - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: true @@ -48,7 +48,7 @@ jobs: cache-to: type=gha,mode=max - name: Create Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 22fabeda7..67c197041 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,41 +15,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- + uses: actions/checkout@v4 - name: Set up Docker Buildk - uses: docker/setup-buildx-action@v1 - with: - buildkitd-flags: --debug + uses: docker/setup-buildx-action@v3 - name: Login to Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ github.token }} - - name: Build and push kafka - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: push: true context: .github/dockerfiles/kafka tags: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - # Temp fix - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + cache-from: type=gha,scope=ci-kafka + cache-to: type=gha,mode=max,scope=ci-kafka tests: needs: build @@ -63,7 +45,7 @@ jobs: image: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }} credentials: username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ github.token }} ports: - 2181:2181 - 9092:9092 @@ -73,15 +55,16 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get update sudo apt-get install -y build-essential - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: '1.16.2' - - uses: actions/setup-node@v2 + cache-dependency-path: ./bucket-scanner/go.sum + - uses: actions/setup-node@v4 with: node-version: '16' cache: yarn From a781423c0ae2820ac744f96255039c829891d79e Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Mon, 15 Apr 2024 18:57:29 +0200 Subject: [PATCH 3/3] Do not build dashboards in 7.x The dashboards are not in the code... Issue: BB-578 --- .github/workflows/release.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 50b69c23e..13279ce46 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,16 +28,6 @@ jobs: username: ${{ github.repository_owner }} password: ${{ github.token }} - - name: Push dashboards into the production namespace - run: | - oras push ghcr.io/${{ github.repository }}/${{ env.PROJECT_NAME }}-dashboards:${{ github.event.inputs.tag }} \ - ingestion/ingestion-processor-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-producer-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-global-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-processor-alert.yaml:application/prometheus-alerts+yaml \ - ingestion/ingestion-producer-alert.yaml:application/prometheus-alerts+yaml - working-directory: monitoring - - name: Build and push uses: docker/build-push-action@v5 with: