-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify image builds by using QEMU to do multi-arch builds, but sinc…
…e they are slow, only do the multi-arch builds for releases. Also support passing cargo build args to the Docker image builder, allowing us to enable all features. Signed-off-by: Hiram Chirino <[email protected]>
- Loading branch information
Showing
6 changed files
with
135 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: 'Container Image Build' | ||
description: 'Builds a container image for the project' | ||
inputs: | ||
platforms: | ||
description: 'comma seperated list of platforms to build the image for' | ||
required: true | ||
default: 'linux/amd64' | ||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Set up QEMU for Multi-Arch Builds | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador | ||
tags: | | ||
# SHA tag for main branch | ||
type=raw,value=${{ github.sha }},enable=${{ github.ref_name == env.MAIN_BRANCH_NAME }} | ||
# set latest tag for main branch | ||
type=raw,value=latest,enable=${{ github.ref_name == env.MAIN_BRANCH_NAME }} | ||
# set ref name tag for non-main branches | ||
type=raw,value=${{ github.ref_name }},enable=${{ github.ref_name != env.MAIN_BRANCH_NAME }} | ||
- name: Login to container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.IMG_REGISTRY_USERNAME }} | ||
password: ${{ secrets.IMG_REGISTRY_TOKEN }} | ||
registry: ${{ env.IMG_REGISTRY_HOST }} | ||
|
||
- name: Build and Push | ||
id: build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: ${{ inputs.platforms }} | ||
push: true | ||
file: ./Dockerfile | ||
tags: | | ||
${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ steps.meta.outputs.version }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
GITHUB_SHA=${{ github.sha }} | ||
context: . | ||
labels: ${{ steps.meta.outputs.labels }} | ||
outputs: type=image,name=${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador,push-by-digest=true,name-canonical=true,push=true | ||
provenance: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Build Image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
env: | ||
IMG_REGISTRY_HOST: quay.io | ||
IMG_REGISTRY_ORG: kuadrant | ||
MAIN_BRANCH_NAME: main | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build/Push the Container Image | ||
uses: ./.github/actions/build-image | ||
with: | ||
platforms: linux/amd64,linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
limitador-server/sandbox/docker-compose-limitador-distributed.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
version: '3.8' | ||
services: | ||
limitador: | ||
image: ${LIMITADOR_IMAGE:-limitador-testing} | ||
depends_on: | ||
- envoy | ||
- redis | ||
command: | ||
- limitador-server | ||
- --rls-ip | ||
- 0.0.0.0 | ||
- --rls-port | ||
- "8081" | ||
- --http-ip | ||
- 0.0.0.0 | ||
- --http-port | ||
- "8080" | ||
- -vvv | ||
- --grpc-reflection-service | ||
- /opt/kuadrant/limits/limits.yaml | ||
- redis | ||
- redis://redis:6379 | ||
expose: | ||
- "8080" | ||
- "8081" | ||
ports: | ||
- "18080:8080" | ||
- "18081:8081" | ||
volumes: | ||
- ./limits.yaml:/opt/kuadrant/limits/limits.yaml | ||
redis: | ||
image: redis:5 |