Skip to content

Commit fa5360a

Browse files
authored
Feat: supervisor ARM builds (#2046)
* v4 worker multi-arch builds * v4-beta tag for webapp * add oidc permission * deps fetcher needs python * node-gyp needs complete toolchain * fix headers * bust pnpm cache * add setuptools * switch back to old cache id * push worker images * pass the correct tags
1 parent 7ace1c3 commit fa5360a

File tree

3 files changed

+28
-32
lines changed

3 files changed

+28
-32
lines changed

.github/workflows/publish-webapp.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ jobs:
4343
ref_without_tag=ghcr.io/triggerdotdev/trigger.dev
4444
image_tags=$ref_without_tag:${{ steps.get_tag.outputs.tag }}
4545
46-
# if tag is a semver, also tag it as v3
46+
# if tag is a semver, also tag it as v4
4747
if [[ "${{ steps.get_tag.outputs.is_semver }}" == true ]]; then
48-
image_tags=$image_tags,$ref_without_tag:v3
48+
# TODO: switch to v4 tag on GA
49+
image_tags=$image_tags,$ref_without_tag:v4-beta
4950
fi
5051
5152
echo "image_tags=${image_tags}" >> "$GITHUB_OUTPUT"

.github/workflows/publish-worker-v4.yml

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- "re2-prod-*"
1515

1616
permissions:
17+
id-token: write
1718
packages: write
1819
contents: read
1920

@@ -35,6 +36,9 @@ jobs:
3536
env:
3637
DOCKER_BUILDKIT: "1"
3738
steps:
39+
- name: 🏭 Setup Depot CLI
40+
uses: depot/setup-action@v1
41+
3842
- name: ⬇️ Checkout git repo
3943
uses: actions/checkout@v4
4044

@@ -49,47 +53,37 @@ jobs:
4953
fi
5054
echo "repo=${repo}" >> "$GITHUB_OUTPUT"
5155
52-
- id: get_tag
56+
- name: "#️⃣ Get image tag"
57+
id: get_tag
5358
uses: ./.github/actions/get-image-tag
5459
with:
5560
tag: ${{ inputs.image_tag }}
5661

57-
- name: 🐋 Set up Docker Buildx
58-
uses: docker/setup-buildx-action@v3
62+
- name: 📛 Set tags to push
63+
id: set_tags
64+
run: |
65+
ref_without_tag=ghcr.io/triggerdotdev/${{ steps.get_repository.outputs.repo }}
66+
image_tags=$ref_without_tag:${{ steps.get_tag.outputs.tag }}
5967
60-
# ..to avoid rate limits when pulling images
61-
- name: 🐳 Login to DockerHub
62-
uses: docker/login-action@v3
63-
with:
64-
username: ${{ secrets.DOCKERHUB_USERNAME }}
65-
password: ${{ secrets.DOCKERHUB_TOKEN }}
68+
# if tag is a semver, also tag it as v4
69+
if [[ "${{ steps.get_tag.outputs.is_semver }}" == true ]]; then
70+
# TODO: switch to v4 tag on GA
71+
image_tags=$image_tags,$ref_without_tag:v4-beta
72+
fi
6673
67-
- name: 🚢 Build Container Image
68-
run: |
69-
docker build -t infra_image -f ./apps/${{ matrix.package }}/Containerfile .
74+
echo "image_tags=${image_tags}" >> "$GITHUB_OUTPUT"
7075
71-
# ..to push image
7276
- name: 🐙 Login to GitHub Container Registry
7377
uses: docker/login-action@v3
7478
with:
7579
registry: ghcr.io
7680
username: ${{ github.repository_owner }}
7781
password: ${{ secrets.GITHUB_TOKEN }}
7882

79-
- name: 🐙 Push to GitHub Container Registry
80-
run: |
81-
docker tag infra_image "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
82-
docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
83-
env:
84-
REGISTRY: ghcr.io/triggerdotdev
85-
REPOSITORY: ${{ steps.get_repository.outputs.repo }}
86-
IMAGE_TAG: ${{ steps.get_tag.outputs.tag }}
87-
88-
# - name: 🐙 Push 'v3' tag to GitHub Container Registry
89-
# if: steps.get_tag.outputs.is_semver == 'true'
90-
# run: |
91-
# docker tag infra_image "$REGISTRY/$REPOSITORY:v3"
92-
# docker push "$REGISTRY/$REPOSITORY:v3"
93-
# env:
94-
# REGISTRY: ghcr.io/triggerdotdev
95-
# REPOSITORY: ${{ steps.get_repository.outputs.repo }}
83+
- name: 🐳 Build image and push to GitHub Container Registry
84+
uses: depot/build-push-action@v1
85+
with:
86+
file: ./apps/${{ matrix.package }}/Containerfile
87+
platforms: linux/amd64,linux/arm64
88+
tags: ${{ steps.set_tags.outputs.image_tags }}
89+
push: true

apps/supervisor/Containerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ COPY --from=pruner --chown=node:node /app/out/pnpm-workspace.yaml ./pnpm-workspa
1919
RUN corepack enable && corepack prepare --activate
2020

2121
FROM base AS deps-fetcher
22+
RUN apk add --no-cache python3-dev py3-setuptools make g++ gcc linux-headers
2223
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch --frozen-lockfile
2324

2425
FROM deps-fetcher AS dev-deps

0 commit comments

Comments
 (0)