From 9e1f14ed174f5659335ca00756fabd375d9612e2 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 17 Apr 2024 14:42:58 +0200 Subject: [PATCH 1/6] Migrate to ghcr Issue: UTAPI-99 --- .github/workflows/release.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 49b1b058..36c4caba 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,21 +23,21 @@ jobs: - name: Login to Registry uses: docker/login-action@v1 with: - registry: registry.scality.com - username: ${{ secrets.REGISTRY_LOGIN }} - password: ${{ secrets.REGISTRY_PASSWORD }} + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} - name: Build and push utapi image uses: docker/build-push-action@v2 with: context: . push: true - tags: "registry.scality.com/utapi/utapi:${{ github.event.inputs.tag }}" + tags: ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}" - name: Create Release uses: softprops/action-gh-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} with: name: Release ${{ github.event.inputs.tag }} tag_name: ${{ github.event.inputs.tag }} From 5976018d0e75ce4bc9b5b420421a0973774d7f56 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 17 Apr 2024 15:02:44 +0200 Subject: [PATCH 2/6] Bump github actions - checkout@v4 - setup-qemu@v3 - setup-buildx@v3 - setup-node@v4 - setup-python@v5 - login@v3 - build-push@v5 - gh-release@v2 Issue: UTAPI-99 --- .github/workflows/release.yaml | 12 ++++++------ .github/workflows/tests.yaml | 11 ++++------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 36c4caba..c415d11b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,30 +12,30 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - 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@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ github.token }} - name: Build and push utapi image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: true tags: ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}" - name: Create Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ github.token }} with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4eefafdb..a74f721a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -38,18 +38,15 @@ jobs: - 16379:16379 steps: - name: Checkout - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: '16.13.2' cache: 'yarn' - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: python-version: '3.9' - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip + cache: pip - name: Install python deps run: | pip install requests From 20916c6f0ee5cd69c14f265a294c6126abdc1324 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Thu, 18 Apr 2024 15:05:22 +0200 Subject: [PATCH 3/6] Fix caching of python packages Issue: UTAPI-99 --- .github/workflows/tests.yaml | 4 +--- requirements.txt | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a74f721a..6acd8e34 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -48,9 +48,7 @@ jobs: python-version: '3.9' cache: pip - name: Install python deps - run: | - pip install requests - pip install redis + run: pip install -r requirements.txt - name: install dependencies run: yarn install --frozen-lockfile - run: ${{ matrix.command }} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..d3bf589d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +redis==5.0.3 +requests==2.31.0 \ No newline at end of file From c4e786d6cd5eace2f49d736dbf2afbc9e087f7fe Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 17 Apr 2024 14:55:45 +0200 Subject: [PATCH 4/6] Migrate to ghcr Issue: UTAPI-99 --- .github/docker/vault/Dockerfile | 3 +-- .github/workflows/build-ci.yaml | 20 ++++---------------- .github/workflows/build-dev.yaml | 9 +++++---- .github/workflows/release-warp10.yaml | 4 +--- .github/workflows/tests.yaml | 3 --- images/nodesvc-base/Dockerfile | 2 +- images/warp10/Dockerfile | 2 +- 7 files changed, 13 insertions(+), 30 deletions(-) diff --git a/.github/docker/vault/Dockerfile b/.github/docker/vault/Dockerfile index 3e2478c9..976af0ce 100644 --- a/.github/docker/vault/Dockerfile +++ b/.github/docker/vault/Dockerfile @@ -1,8 +1,7 @@ -FROM registry.scality.com/vault-dev/vault:c2607856 +FROM ghcr.io/scality/vault:c2607856 ENV VAULT_DB_BACKEND LEVELDB RUN chmod 400 tests/utils/keyfile ENTRYPOINT yarn start - diff --git a/.github/workflows/build-ci.yaml b/.github/workflows/build-ci.yaml index 3310cec5..a687e006 100644 --- a/.github/workflows/build-ci.yaml +++ b/.github/workflows/build-ci.yaml @@ -2,18 +2,13 @@ name: build-ci-images on: workflow_call: - secrets: - REGISTRY_LOGIN: - required: true - REGISTRY_PASSWORD: - required: true jobs: warp10-ci: uses: scality/workflows/.github/workflows/docker-build.yaml@v1 secrets: REGISTRY_LOGIN: ${{ github.repository_owner }} - REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + REGISTRY_PASSWORD: ${{ github.token }} with: name: warp10-ci context: . @@ -24,7 +19,7 @@ jobs: uses: scality/workflows/.github/workflows/docker-build.yaml@v1 secrets: REGISTRY_LOGIN: ${{ github.repository_owner }} - REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + REGISTRY_PASSWORD: ${{ github.token }} with: name: redis-ci context: . @@ -36,7 +31,7 @@ jobs: - redis-ci secrets: REGISTRY_LOGIN: ${{ github.repository_owner }} - REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + REGISTRY_PASSWORD: ${{ github.token }} with: name: redis-replica-ci context: .github/docker/redis-replica @@ -58,14 +53,7 @@ jobs: with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to Scality Registry - uses: docker/login-action@v1.10.0 - with: - registry: registry.scality.com - username: ${{ secrets.REGISTRY_LOGIN }} - password: ${{ secrets.REGISTRY_PASSWORD }} + password: ${{ github.token }} - name: Build and push vault Image uses: docker/build-push-action@v2.7.0 diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index c6e83638..97ead80f 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -8,8 +8,9 @@ on: jobs: build-dev: uses: scality/workflows/.github/workflows/docker-build.yaml@v1 - secrets: inherit + secrets: + REGISTRY_LOGIN: ${{ github.repository_owner }} + REGISTRY_PASSWORD: ${{ github.token }} with: - registry: registry.scality.com - namespace: utapi-dev - name: utapi + namespace: ${{ github.repository_owner }} + name: ${{ github.event.repository.name }} diff --git a/.github/workflows/release-warp10.yaml b/.github/workflows/release-warp10.yaml index 3da6baab..644fd668 100644 --- a/.github/workflows/release-warp10.yaml +++ b/.github/workflows/release-warp10.yaml @@ -18,8 +18,6 @@ jobs: uses: scality/workflows/.github/workflows/docker-build.yaml@v1 secrets: inherit with: - registry: registry.scality.com - namespace: utapi name: warp10 context: . file: images/warp10/Dockerfile @@ -35,7 +33,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: Release registry.scality.com/utapi/warp10:${{ github.event.inputs.tag }}-warp10 + name: Release utapi/warp10:${{ github.event.inputs.tag }}-warp10 tag_name: ${{ github.event.inputs.tag }}-warp10 generate_release_notes: false target_commitish: ${{ github.sha }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 14debd8f..4fffac07 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,9 +21,6 @@ on: jobs: build-ci: uses: ./.github/workflows/build-ci.yaml - secrets: - REGISTRY_LOGIN: ${{ secrets.REGISTRY_LOGIN }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} lint: runs-on: ubuntu-latest diff --git a/images/nodesvc-base/Dockerfile b/images/nodesvc-base/Dockerfile index 8ac6ed0d..2f0fb3b6 100644 --- a/images/nodesvc-base/Dockerfile +++ b/images/nodesvc-base/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.scality.com/federation/nodesvc-base:7.10.5.0 +FROM ghcr.io/scality/federation/nodesvc-base:7.10.5.0 ENV UTAPI_CONFIG_FILE=${CONF_DIR}/config.json diff --git a/images/warp10/Dockerfile b/images/warp10/Dockerfile index d12feee0..c068914f 100644 --- a/images/warp10/Dockerfile +++ b/images/warp10/Dockerfile @@ -13,7 +13,7 @@ RUN apk add zip unzip build-base \ && cd .. \ && go build -a -o /usr/local/go/warp10_sensision_exporter -FROM registry.scality.com/utapi/warp10:2.8.1-95-g73e7de80 +FROM ghcr.io/scality/utapi/warp10:2.8.1-95-g73e7de80 # Override baked in version # Remove when updating to a numbered release From 4449f44c9af1807e6c881d41eddcf8c77c470f3f Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 17 Apr 2024 15:35:09 +0200 Subject: [PATCH 5/6] Bump github actions - docker-build@v2 - checkout@v4 - setup-buildx@v3 - setup-node@v4 - setup-python@v5 - login@v3 - build-push@v5 - gh-release@v2 - ssh-to-runner@1.7.0 Issue: UTAPI-99 --- .github/workflows/build-ci.yaml | 14 ++++++------- .github/workflows/build-dev.yaml | 2 +- .github/workflows/release-warp10.yaml | 4 ++-- .github/workflows/release.yaml | 2 +- .github/workflows/tests.yaml | 30 +++++++++++---------------- 5 files changed, 23 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-ci.yaml b/.github/workflows/build-ci.yaml index a687e006..3b413590 100644 --- a/.github/workflows/build-ci.yaml +++ b/.github/workflows/build-ci.yaml @@ -5,7 +5,7 @@ on: jobs: warp10-ci: - uses: scality/workflows/.github/workflows/docker-build.yaml@v1 + uses: scality/workflows/.github/workflows/docker-build.yaml@v2 secrets: REGISTRY_LOGIN: ${{ github.repository_owner }} REGISTRY_PASSWORD: ${{ github.token }} @@ -16,7 +16,7 @@ jobs: lfs: true redis-ci: - uses: scality/workflows/.github/workflows/docker-build.yaml@v1 + uses: scality/workflows/.github/workflows/docker-build.yaml@v2 secrets: REGISTRY_LOGIN: ${{ github.repository_owner }} REGISTRY_PASSWORD: ${{ github.token }} @@ -26,7 +26,7 @@ jobs: file: images/redis/Dockerfile redis-replica-ci: - uses: scality/workflows/.github/workflows/docker-build.yaml@v1 + uses: scality/workflows/.github/workflows/docker-build.yaml@v2 needs: - redis-ci secrets: @@ -42,21 +42,21 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v4 with: lfs: true - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1.6.0 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Registry - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ github.token }} - name: Build and push vault Image - uses: docker/build-push-action@v2.7.0 + uses: docker/build-push-action@v5 with: push: true context: .github/docker/vault diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 97ead80f..a87555c2 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -7,7 +7,7 @@ on: jobs: build-dev: - uses: scality/workflows/.github/workflows/docker-build.yaml@v1 + uses: scality/workflows/.github/workflows/docker-build.yaml@v2 secrets: REGISTRY_LOGIN: ${{ github.repository_owner }} REGISTRY_PASSWORD: ${{ github.token }} diff --git a/.github/workflows/release-warp10.yaml b/.github/workflows/release-warp10.yaml index 644fd668..6b3ac648 100644 --- a/.github/workflows/release-warp10.yaml +++ b/.github/workflows/release-warp10.yaml @@ -15,7 +15,7 @@ on: jobs: build: - uses: scality/workflows/.github/workflows/docker-build.yaml@v1 + uses: scality/workflows/.github/workflows/docker-build.yaml@v2 secrets: inherit with: name: warp10 @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fb917dd5..4ae5a668 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,7 +22,7 @@ on: jobs: build: - uses: scality/workflows/.github/workflows/docker-build.yaml@v1 + uses: scality/workflows/.github/workflows/docker-build.yaml@v2 secrets: inherit with: namespace: ${{ github.repository_owner }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4fffac07..64cc503d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -26,10 +26,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: lfs: true - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: node-version: '16.13.2' cache: yarn @@ -208,20 +208,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: lfs: true - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: node-version: '16.13.2' cache: yarn - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: python-version: '3.9' - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip + cache: pip - name: Install python deps run: | pip install requests @@ -238,7 +235,7 @@ jobs: UTAPI_LOG_LEVEL: trace SETUP_CMD: "run start_v2:server" - name: 'Debug: SSH to runner' - uses: scality/actions/action-ssh-to-runner@1.6.0 + uses: scality/actions/action-ssh-to-runner@1.7.0 timeout-minutes: ${{ fromJSON(github.event.inputs.connection-timeout-m) }} continue-on-error: true with: @@ -334,20 +331,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: lfs: true - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: node-version: '16.13.2' cache: yarn - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: python-version: '3.9' - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip + cache: pip - name: Install python deps run: | pip install requests @@ -360,7 +354,7 @@ jobs: run: ${{ matrix.test.command }} env: ${{ matrix.test.env }} - name: 'Debug: SSH to runner' - uses: scality/actions/action-ssh-to-runner@1.6.0 + uses: scality/actions/action-ssh-to-runner@1.7.0 timeout-minutes: ${{ fromJSON(github.event.inputs.connection-timeout-m) }} continue-on-error: true with: From 6e0ec16f00f274d7e134a341cf298e9524559908 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Thu, 18 Apr 2024 15:05:22 +0200 Subject: [PATCH 6/6] Fix caching of python packages Issue: UTAPI-99 --- .github/workflows/tests.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 64cc503d..69fbc266 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -220,9 +220,7 @@ jobs: python-version: '3.9' cache: pip - name: Install python deps - run: | - pip install requests - pip install redis + run: pip install -r requirements.txt - name: install dependencies run: yarn install --frozen-lockfile --network-concurrency 1 - name: Wait for warp10 for 60 seconds @@ -343,9 +341,7 @@ jobs: python-version: '3.9' cache: pip - name: Install python deps - run: | - pip install requests - pip install redis + run: pip install -r requirements.txt - name: install dependencies run: yarn install --frozen-lockfile --network-concurrency 1 - name: Wait for warp10 a little bit