Skip to content

Commit

Permalink
Copy .env.docker
Browse files Browse the repository at this point in the history
(cherry picked from commit 5c299fd)

Use .env file during build

(cherry picked from commit cd834b2)

Build everything for arm as well

chore(ci): use node version from `.nvmrc`

Make a single launcher workflow to launch all arm builds

trigger on push temporarily for testing

f

give broad permissions

try again

test

tag branch with arm

try again

fionally

one more

one more time

I hope

try this

The stupidest thing eve: how should I've known that github.inputs.build_arm needs to be used for workflow call and not github.event.inputs.build_arm

Now

nowwww

Disable debug, finally!
  • Loading branch information
corneliusroemer committed May 11, 2024
1 parent 05cf85a commit b8ca05d
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 19 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ on:
description: "Build for ARM as well"
default: false
required: false
workflow_call:
inputs:
build_arm:
type: string
description: "Build for ARM as well"
default: "false"
required: true

env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/backend
BUILD_ARM: ${{ github.ref == 'refs/heads/main' || github.event.inputs.build_arm }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }}

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-backend
Expand Down Expand Up @@ -48,7 +56,7 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch
type=sha,prefix=commit-
type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/build-arm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Trigger a build of all docker images including ARM images

on:
push:
workflow_dispatch:

permissions:
contents: read
packages: write
checks: read

jobs:
trigger-backend:
uses: ./.github/workflows/backend.yml
with:
build_arm: true

trigger-config-preprocessor:
uses: ./.github/workflows/config-preprocessor-build.yml
with:
build_arm: true

trigger-dummy-preprocessing:
uses: ./.github/workflows/dummyPreprocessing.yml
with:
build_arm: true

trigger-ingest:
uses: ./.github/workflows/ingest.yml
with:
build_arm: true

trigger-keycloakify:
uses: ./.github/workflows/keycloakify-build.yml
with:
build_arm: true

trigger-preprocessing-nextclade:
uses: ./.github/workflows/preprocessing-nextclade.yml
with:
build_arm: true

trigger-website:
uses: ./.github/workflows/website.yml
with:
build_arm: true
15 changes: 12 additions & 3 deletions .github/workflows/config-preprocessor-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,26 @@ on:
type: boolean
description: "Build for ARM as well"
default: false
required: false
required: true
workflow_call:
inputs:
build_arm:
type: string
description: "Build for ARM as well"
default: "false"
required: true

env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/config-processor
BUILD_ARM: ${{ github.ref == 'refs/heads/main' || github.event.inputs.build_arm }} # When to build for arm as well
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }}

defaults:
run:
working-directory: ./kubernetes/config-processor

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-config-processor
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-config-processor-${{github.event.inputs.build_arm}}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -50,6 +58,7 @@ jobs:
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=sha,prefix=commit-
type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/dummyPreprocessing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ on:
description: "Build for ARM as well"
default: false
required: false
workflow_call:
inputs:
build_arm:
type: boolean
description: "Build for ARM as well"
default: false
required: false

env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/preprocessing-dummy
BUILD_ARM: ${{ github.ref == 'refs/heads/main' || github.event.inputs.build_arm }} # When to build for arm as well
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }}

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-preprocessing-dummy
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-preprocessing-dumm-${{github.event.inputs.build_arm}}y
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -45,6 +53,7 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch
type=sha,prefix=commit-
type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/ingest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ on:
description: "Build for ARM as well"
default: false
required: false
workflow_call:
inputs:
build_arm:
type: boolean
description: "Build for ARM as well"
default: false
required: false

env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/ingest
BUILD_ARM: ${{ github.ref == 'refs/heads/main' || github.event.inputs.build_arm }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }}

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-ingest
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-ingest-${{github.event.inputs.build_arm}}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -45,6 +53,7 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch
type=sha,prefix=commit-
type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/keycloakify-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ on:
description: "Build for ARM as well"
default: false
required: false

workflow_call:
inputs:
build_arm:
type: boolean
description: "Build for ARM as well"
default: false
required: false
env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/keycloakify
BUILD_ARM: ${{ github.ref == 'refs/heads/main' || github.event.inputs.build_arm }} # When to build for arm as well
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }}

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-keycloak-build
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-keycloak-buil-${{github.event.inputs.build_arm}}d
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -50,6 +57,7 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch
type=sha,prefix=commit-
type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }}
- name: Check if image exists
id: check-image
run: |
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/preprocessing-nextclade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ on:
description: "Build for ARM as well"
default: false
required: false
workflow_call:
inputs:
build_arm:
type: boolean
description: "Build for ARM as well"
default: false
required: false

env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/preprocessing-nextclade
BUILD_ARM: ${{ github.ref == 'refs/heads/main' || github.event.inputs.build_arm }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }}

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-preprocessing-nextclade
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-preprocessing-nextclade-${{github.event.inputs.build_arm}}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -46,6 +54,7 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch
type=sha,prefix=commit-
type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
name: website

on:
push:
workflow_dispatch:
inputs:
build_arm:
type: boolean
description: "Build for ARM as well"
default: false
required: false

workflow_call:
inputs:
build_arm:
type: boolean
description: "Build for ARM as well"
default: false
required: false
env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/website
BUILD_ARM: ${{ github.ref == 'refs/heads/main' || github.event.inputs.build_arm }} # When to build for arm as well
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }}

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-website
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-website-${{github.event.inputs.build_arm}}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -46,6 +52,7 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch
type=sha,prefix=commit-
type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
2 changes: 1 addition & 1 deletion docs/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22
v22

0 comments on commit b8ca05d

Please sign in to comment.