Skip to content

Commit

Permalink
Merge branch 'improvement/BB-578' into w/7.10/improvement/BB-578
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisferrand committed Apr 15, 2024
2 parents 9e2792c + a781423 commit cc598eb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 57 deletions.
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

0 comments on commit cc598eb

Please sign in to comment.