Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX S3C 9.2.0] BB-582 Migrate to ghcr #2515

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/release-federation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ on:

jobs:
build-federation-image:
uses: scality/workflows/.github/workflows/docker-build.yaml@v1
secrets: inherit
uses: scality/workflows/.github/workflows/docker-build.yaml@v2
secrets:
REGISTRY_LOGIN: ${{ github.repository_owner }}
REGISTRY_PASSWORD: ${{ github.token }}
with:
push: true
registry: registry.scality.com
namespace: ${{ github.event.repository.name }}
registry: ghcr.io
namespace: scality
name: ${{ github.event.repository.name }}
context: .
file: images/nodesvc-base/Dockerfile
Expand All @@ -25,9 +27,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
with:
name: Release ${{ github.event.inputs.tag }}
tag_name: ${{ github.event.inputs.tag }}
Expand Down
29 changes: 9 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,36 @@ on:
required: true

env:
REGISTRY_NAME: registry.scality.com
PROJECT_NAME: ${{ github.event.repository.name }}

jobs:
release:
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@v1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_NAME }}
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- 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
working-directory: monitoring
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
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

- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
56 changes: 19 additions & 37 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,32 @@ 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: ${{ secrets.GITHUB_TOKEN }}

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/scality/backbeat/ci-kafka:${{ github.sha }}"
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

tags: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }}
cache-from: type=gha,scope=ci-kafka
cache-to: type=gha,mode=max,scope=ci-kafka
- name: Build and push syntheticbucketd
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
push: true
context: .
file: .github/dockerfiles/syntheticbucketd/Dockerfile
tags: "ghcr.io/scality/backbeat/syntheticbucketd:${{ 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
tags: ghcr.io/${{ github.repository }}/syntheticbucketd:${{ github.sha }}
cache-from: type=gha,scope=syntheticbucketd
cache-to: type=gha,mode=max,scope=syntheticbucketd

tests:
needs: build
Expand All @@ -70,14 +51,14 @@ jobs:
ports:
- 6379:6379
syntheticbucketd:
image: ghcr.io/scality/backbeat/syntheticbucketd:${{ github.sha }}
image: ghcr.io/${{ github.repository }}/syntheticbucketd:${{ github.sha }}
ports:
- 9001:9001
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 }}
password: ${{ github.token }}
ports:
- 2181:2181
- 9092:9092
Expand All @@ -87,15 +68,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
Expand Down
4 changes: 2 additions & 2 deletions images/nodesvc-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.scality.com/federation/nodesvc-base:7.10.7.0 as builder
FROM ghcr.io/scality/federation/nodesvc-base:7.10.7.0 as builder

WORKDIR /tmp/build

Expand All @@ -9,7 +9,7 @@ RUN yarn cache clean \
&& yarn cache clean

################################################################################
FROM registry.scality.com/federation/nodesvc-base:7.10.7.0
FROM ghcr.io/scality/federation/nodesvc-base:7.10.7.0

WORKDIR ${HOME_DIR}/backbeat

Expand Down