From 1f82f1e64a6d9d4fb1eabc57dbf186836e23cfaf Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 16:02:51 +0800 Subject: [PATCH 01/17] [V2] feat: Dockerfiles for each components Signed-off-by: Ryan Lo --- actions/config.yaml | 2 ++ docker/Dockerfile.actions | 25 +++++++++++++++++++++++++ docker/bake.hcl | 10 ++++++++++ 3 files changed, 37 insertions(+) create mode 100644 actions/config.yaml create mode 100644 docker/Dockerfile.actions create mode 100644 docker/bake.hcl diff --git a/actions/config.yaml b/actions/config.yaml new file mode 100644 index 0000000000..6d922789a9 --- /dev/null +++ b/actions/config.yaml @@ -0,0 +1,2 @@ +# Actions service configuration +actions: {} diff --git a/docker/Dockerfile.actions b/docker/Dockerfile.actions new file mode 100644 index 0000000000..599f827e5f --- /dev/null +++ b/docker/Dockerfile.actions @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1 + +# Build stage +ARG GO_VERSION +FROM golang:${GO_VERSION:-1.24}-alpine AS builder + +ARG TARGETOS +ARG TARGETARCH + +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download + +COPY . ./ + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o actions-service actions/cmd/main.go + +# Final stage +FROM gcr.io/distroless/static-debian12 + +COPY --from=builder /src/actions-service / +# Copy default config +COPY --from=builder /src/actions/config.yaml / + +ENTRYPOINT ["/actions-service"] diff --git a/docker/bake.hcl b/docker/bake.hcl new file mode 100644 index 0000000000..272b9e4bf0 --- /dev/null +++ b/docker/bake.hcl @@ -0,0 +1,10 @@ +group "default" { + targets = ["actions"] +} + +target "actions" { + dockerfile = "docker/Dockerfile.actions" + context = "." + platforms = ["linux/arm64"] + tags = ["flyte-actions-service:latest"] +} From 26df8b493728f17e203b693919a8e879ba754d28 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 21:16:00 +0800 Subject: [PATCH 02/17] add all Dockerfile Signed-off-by: Ryan Lo --- docker/Dockerfile.actions | 9 +++++++-- docker/Dockerfile.cache_service | 25 +++++++++++++++++++++++++ docker/Dockerfile.dataproxy | 25 +++++++++++++++++++++++++ docker/Dockerfile.events | 25 +++++++++++++++++++++++++ docker/Dockerfile.executor | 27 +++++++++++++++++++++++++++ docker/Dockerfile.runs | 26 ++++++++++++++++++++++++++ 6 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 docker/Dockerfile.cache_service create mode 100644 docker/Dockerfile.dataproxy create mode 100644 docker/Dockerfile.events create mode 100644 docker/Dockerfile.executor create mode 100644 docker/Dockerfile.runs diff --git a/docker/Dockerfile.actions b/docker/Dockerfile.actions index 599f827e5f..1eb1a4927b 100644 --- a/docker/Dockerfile.actions +++ b/docker/Dockerfile.actions @@ -2,7 +2,7 @@ # Build stage ARG GO_VERSION -FROM golang:${GO_VERSION:-1.24}-alpine AS builder +FROM golang:${GO_VERSION}-alpine AS builder ARG TARGETOS ARG TARGETARCH @@ -11,7 +11,12 @@ WORKDIR /src COPY go.mod go.sum ./ RUN go mod download -COPY . ./ +COPY actions/ actions/ +COPY flytestdlib/ flytestdlib/ +COPY flyteplugins/ flyteplugins/ +COPY flyteidl2/ flyteidl2/ +COPY gen/ gen/ +COPY executor/ executor/ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o actions-service actions/cmd/main.go diff --git a/docker/Dockerfile.cache_service b/docker/Dockerfile.cache_service new file mode 100644 index 0000000000..e1749f36b3 --- /dev/null +++ b/docker/Dockerfile.cache_service @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1 + +# Build stage +ARG GO_VERSION +FROM golang:${GO_VERSION}-alpine AS builder + +ARG TARGETOS +ARG TARGETARCH + +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download + +COPY cache_service/ cache_service/ +COPY flytestdlib/ flytestdlib/ +COPY gen/ gen/ + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o cache-service cache_service/cmd/main.go + +# Final stage +FROM gcr.io/distroless/static-debian12 + +COPY --from=builder /src/cache-service / + +ENTRYPOINT ["/cache-service"] diff --git a/docker/Dockerfile.dataproxy b/docker/Dockerfile.dataproxy new file mode 100644 index 0000000000..2271cb45f0 --- /dev/null +++ b/docker/Dockerfile.dataproxy @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1 + +# Build stage +ARG GO_VERSION +FROM golang:${GO_VERSION}-alpine AS builder + +ARG TARGETOS +ARG TARGETARCH + +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download + +COPY dataproxy/ dataproxy/ +COPY flytestdlib/ flytestdlib/ +COPY gen/ gen/ + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o dataproxy dataproxy/cmd/main.go + +# Final stage +FROM gcr.io/distroless/static-debian12 + +COPY --from=builder /src/dataproxy / + +ENTRYPOINT ["/dataproxy"] diff --git a/docker/Dockerfile.events b/docker/Dockerfile.events new file mode 100644 index 0000000000..642efa7d19 --- /dev/null +++ b/docker/Dockerfile.events @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1 + +# Build stage +ARG GO_VERSION +FROM golang:${GO_VERSION}-alpine AS builder + +ARG TARGETOS +ARG TARGETARCH + +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download + +COPY events/ events/ +COPY flytestdlib/ flytestdlib/ +COPY gen/ gen/ + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o events events/cmd/main.go + +# Final stage +FROM gcr.io/distroless/static-debian12 + +COPY --from=builder /src/events / + +ENTRYPOINT ["/events"] diff --git a/docker/Dockerfile.executor b/docker/Dockerfile.executor new file mode 100644 index 0000000000..d1c8935564 --- /dev/null +++ b/docker/Dockerfile.executor @@ -0,0 +1,27 @@ +# syntax=docker/dockerfile:1 + +# Build stage +ARG GO_VERSION +FROM golang:${GO_VERSION}-alpine AS builder + +ARG TARGETOS +ARG TARGETARCH + +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download + +COPY executor/ executor/ +COPY flyteplugins/ flyteplugins/ +COPY flytestdlib/ flytestdlib/ +COPY flyteidl2/ flyteidl2/ +COPY gen/ gen/ + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o executor executor/cmd/main.go + +# Final stage +FROM gcr.io/distroless/static-debian12 + +COPY --from=builder /src/executor / + +ENTRYPOINT ["/executor"] diff --git a/docker/Dockerfile.runs b/docker/Dockerfile.runs new file mode 100644 index 0000000000..95008c5dd0 --- /dev/null +++ b/docker/Dockerfile.runs @@ -0,0 +1,26 @@ +# syntax=docker/dockerfile:1 + +# Build stage +ARG GO_VERSION +FROM golang:${GO_VERSION}-alpine AS builder + +ARG TARGETOS +ARG TARGETARCH + +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download + +COPY runs/ runs/ +COPY flytestdlib/ flytestdlib/ +COPY gen/ gen/ + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o runs-service runs/cmd/main.go + +# Final stage +FROM gcr.io/distroless/static-debian12 + +COPY --from=builder /src/runs-service / +COPY --from=builder /src/runs/config.yaml / + +ENTRYPOINT ["/runs-service"] From 21eb5227ad4cee8656940e4fece1618b242f5fb8 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 21:16:14 +0800 Subject: [PATCH 03/17] update bake.hcl Signed-off-by: Ryan Lo --- docker/bake.hcl | 64 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/docker/bake.hcl b/docker/bake.hcl index 272b9e4bf0..62cf5fb045 100644 --- a/docker/bake.hcl +++ b/docker/bake.hcl @@ -1,10 +1,66 @@ +variable "IMAGE_REPO_PREFIX" { + default = "ghcr.io/flyteorg/flyte" +} + +variable "IMAGE_SHA_SHORT_TAG" { + default = "latest" +} + +variable "GO_VERSION" { + default = "1.24" +} + group "default" { - targets = ["actions"] + targets = [ + "actions", + "cache_service", + "dataproxy", + "events", + "executor", + "runs", + ] } -target "actions" { - dockerfile = "docker/Dockerfile.actions" +target "_common" { context = "." platforms = ["linux/arm64"] - tags = ["flyte-actions-service:latest"] + args = { + GO_VERSION = "${GO_VERSION}" + } +} + +target "actions" { + inherits = ["_common"] + dockerfile = "docker/Dockerfile.actions" + tags = ["${IMAGE_REPO_PREFIX}/actions:${IMAGE_SHA_SHORT_TAG}"] +} + +target "cache_service" { + inherits = ["_common"] + dockerfile = "docker/Dockerfile.cache_service" + tags = ["${IMAGE_REPO_PREFIX}/cache_service:${IMAGE_SHA_SHORT_TAG}"] +} + +target "dataproxy" { + inherits = ["_common"] + dockerfile = "docker/Dockerfile.dataproxy" + tags = ["${IMAGE_REPO_PREFIX}/dataproxy:${IMAGE_SHA_SHORT_TAG}"] +} + +target "events" { + inherits = ["_common"] + dockerfile = "docker/Dockerfile.events" + tags = ["${IMAGE_REPO_PREFIX}/events:${IMAGE_SHA_SHORT_TAG}"] +} + +target "executor" { + inherits = ["_common"] + dockerfile = "docker/Dockerfile.executor" + tags = ["${IMAGE_REPO_PREFIX}/executor:${IMAGE_SHA_SHORT_TAG}"] +} + +target "runs" { + inherits = ["_common"] + dockerfile = "docker/Dockerfile.runs" + tags = ["${IMAGE_REPO_PREFIX}/runs:${IMAGE_SHA_SHORT_TAG}"] } From a0865eec70d7c41324d2cd38afe49aace6491812 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 21:45:19 +0800 Subject: [PATCH 04/17] rename bake file Signed-off-by: Ryan Lo --- docker/{bake.hcl => docker-bake.hcl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docker/{bake.hcl => docker-bake.hcl} (100%) diff --git a/docker/bake.hcl b/docker/docker-bake.hcl similarity index 100% rename from docker/bake.hcl rename to docker/docker-bake.hcl From 708817fafcf8af6aeccda892700026a5cb07723e Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 21:45:41 +0800 Subject: [PATCH 05/17] add gha for flyte-core v2 builds Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 86 ++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/flyte-core-v2.yaml diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml new file mode 100644 index 0000000000..c5c690671c --- /dev/null +++ b/.github/workflows/flyte-core-v2.yaml @@ -0,0 +1,86 @@ +name: Build & Push Flyte Core v2 Images + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - v2 + paths: + - "docker/Dockerfile.*" + - "docker/docker-bake.hcl" + - "actions/**" + - "cache_service/**" + - "dataproxy/**" + - "events/**" + - "executor/**" + - "runs/**" + - "flytestdlib/**" + - "flyteplugins/**" + - "flyteidl2/**" + - "gen/**" + - "go.mod" + - "go.sum" + pull_request: + branches: + - v2 + paths: + - "docker/Dockerfile.*" + - "docker/docker-bake.hcl" + - "actions/**" + - "cache_service/**" + - "dataproxy/**" + - "events/**" + - "executor/**" + - "runs/**" + - "flytestdlib/**" + - "flyteplugins/**" + - "flyteidl2/**" + - "gen/**" + - "go.mod" + - "go.sum" + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Login to GitHub Container Registry + if: github.event_name == 'push' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ secrets.FLYTE_BOT_USERNAME }} + password: ${{ secrets.FLYTE_BOT_PAT }} + + - name: Set short Git SHA as tag + run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + + - name: Build images (PR) + if: github.event_name == 'pull_request' + uses: docker/bake-action@v7 + with: + workdir: docker + files: docker-bake.hcl + targets: default + vars: + IMAGE_SHA_SHORT_TAG=${env.SHORT_SHA} + + # - name: Build and push images + # if: github.event_name == 'push' + # uses: docker/bake-action@v7 + # with: + # workdir: docker + # files: docker-bake.hcl + # push: false + # targets: default From 44c82b61e5a8afc68b13cefe2feb3954871ee679 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 22:13:05 +0800 Subject: [PATCH 06/17] fix gha workflow Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index c5c690671c..e63e73b1e8 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -66,21 +66,23 @@ jobs: - name: Set short Git SHA as tag run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - name: Build images (PR) + - name: Build multi-arch image (PR) if: github.event_name == 'pull_request' uses: docker/bake-action@v7 with: - workdir: docker - files: docker-bake.hcl + source: . + files: docker/docker-bake.hcl targets: default - vars: - IMAGE_SHA_SHORT_TAG=${env.SHORT_SHA} + vars: | + IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} - # - name: Build and push images - # if: github.event_name == 'push' - # uses: docker/bake-action@v7 - # with: - # workdir: docker - # files: docker-bake.hcl - # push: false - # targets: default + - name: Build and push images + if: github.event_name == 'push' + uses: docker/bake-action@v7 + with: + source: . + files: docker/docker-bake.hcl + push: true + targets: default + vars: | + IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} From 0abad6d18c8d03c91bdbf57bace77c89927c21d5 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 22:24:25 +0800 Subject: [PATCH 07/17] fix git_town.yml Signed-off-by: Ryan Lo --- .github/workflows/git_town.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/git_town.yml b/.github/workflows/git_town.yml index 478ac9bfdb..e7c1695a2f 100644 --- a/.github/workflows/git_town.yml +++ b/.github/workflows/git_town.yml @@ -1,7 +1,7 @@ name: Git Town on: - pull_request: + pull_request_target: branches: - '**' From ccd275054f742aa523611f6a051186710dcc0c3f Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 22:49:16 +0800 Subject: [PATCH 08/17] fix invalid field Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index e63e73b1e8..34254f05da 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -73,8 +73,8 @@ jobs: source: . files: docker/docker-bake.hcl targets: default - vars: | - IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} + set: | + *.args.IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} - name: Build and push images if: github.event_name == 'push' @@ -84,5 +84,5 @@ jobs: files: docker/docker-bake.hcl push: true targets: default - vars: | + set: | IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} From e2acc58c97716f2fd062f8c74365a8ea694d884b Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 22:49:45 +0800 Subject: [PATCH 09/17] speed up building Signed-off-by: Ryan Lo --- docker/Dockerfile.actions | 10 +++++++--- docker/Dockerfile.cache_service | 10 +++++++--- docker/Dockerfile.dataproxy | 10 +++++++--- docker/Dockerfile.events | 10 +++++++--- docker/Dockerfile.executor | 10 +++++++--- docker/Dockerfile.runs | 10 +++++++--- 6 files changed, 42 insertions(+), 18 deletions(-) diff --git a/docker/Dockerfile.actions b/docker/Dockerfile.actions index 1eb1a4927b..4daa6085d8 100644 --- a/docker/Dockerfile.actions +++ b/docker/Dockerfile.actions @@ -2,14 +2,15 @@ # Build stage ARG GO_VERSION -FROM golang:${GO_VERSION}-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder ARG TARGETOS ARG TARGETARCH WORKDIR /src COPY go.mod go.sum ./ -RUN go mod download +RUN --mount=type=cache,target=/go/pkg/mod \ + go mod download COPY actions/ actions/ COPY flytestdlib/ flytestdlib/ @@ -18,7 +19,10 @@ COPY flyteidl2/ flyteidl2/ COPY gen/ gen/ COPY executor/ executor/ -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o actions-service actions/cmd/main.go +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ + go build -trimpath -o actions-service actions/cmd/main.go # Final stage FROM gcr.io/distroless/static-debian12 diff --git a/docker/Dockerfile.cache_service b/docker/Dockerfile.cache_service index e1749f36b3..9270221cbb 100644 --- a/docker/Dockerfile.cache_service +++ b/docker/Dockerfile.cache_service @@ -2,20 +2,24 @@ # Build stage ARG GO_VERSION -FROM golang:${GO_VERSION}-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder ARG TARGETOS ARG TARGETARCH WORKDIR /src COPY go.mod go.sum ./ -RUN go mod download +RUN --mount=type=cache,target=/go/pkg/mod \ + go mod download COPY cache_service/ cache_service/ COPY flytestdlib/ flytestdlib/ COPY gen/ gen/ -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o cache-service cache_service/cmd/main.go +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ + go build -trimpath -o cache-service cache_service/cmd/main.go # Final stage FROM gcr.io/distroless/static-debian12 diff --git a/docker/Dockerfile.dataproxy b/docker/Dockerfile.dataproxy index 2271cb45f0..c707ccd7f9 100644 --- a/docker/Dockerfile.dataproxy +++ b/docker/Dockerfile.dataproxy @@ -2,20 +2,24 @@ # Build stage ARG GO_VERSION -FROM golang:${GO_VERSION}-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder ARG TARGETOS ARG TARGETARCH WORKDIR /src COPY go.mod go.sum ./ -RUN go mod download +RUN --mount=type=cache,target=/go/pkg/mod \ + go mod download COPY dataproxy/ dataproxy/ COPY flytestdlib/ flytestdlib/ COPY gen/ gen/ -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o dataproxy dataproxy/cmd/main.go +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ + go build -trimpath -o dataproxy dataproxy/cmd/main.go # Final stage FROM gcr.io/distroless/static-debian12 diff --git a/docker/Dockerfile.events b/docker/Dockerfile.events index 642efa7d19..2e943bc192 100644 --- a/docker/Dockerfile.events +++ b/docker/Dockerfile.events @@ -2,20 +2,24 @@ # Build stage ARG GO_VERSION -FROM golang:${GO_VERSION}-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder ARG TARGETOS ARG TARGETARCH WORKDIR /src COPY go.mod go.sum ./ -RUN go mod download +RUN --mount=type=cache,target=/go/pkg/mod \ + go mod download COPY events/ events/ COPY flytestdlib/ flytestdlib/ COPY gen/ gen/ -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o events events/cmd/main.go +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ + go build -trimpath -o events events/cmd/main.go # Final stage FROM gcr.io/distroless/static-debian12 diff --git a/docker/Dockerfile.executor b/docker/Dockerfile.executor index d1c8935564..7bbae24b6f 100644 --- a/docker/Dockerfile.executor +++ b/docker/Dockerfile.executor @@ -2,14 +2,15 @@ # Build stage ARG GO_VERSION -FROM golang:${GO_VERSION}-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder ARG TARGETOS ARG TARGETARCH WORKDIR /src COPY go.mod go.sum ./ -RUN go mod download +RUN --mount=type=cache,target=/go/pkg/mod \ + go mod download COPY executor/ executor/ COPY flyteplugins/ flyteplugins/ @@ -17,7 +18,10 @@ COPY flytestdlib/ flytestdlib/ COPY flyteidl2/ flyteidl2/ COPY gen/ gen/ -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o executor executor/cmd/main.go +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ + go build -trimpath -o executor executor/cmd/main.go # Final stage FROM gcr.io/distroless/static-debian12 diff --git a/docker/Dockerfile.runs b/docker/Dockerfile.runs index 95008c5dd0..43b4aafd87 100644 --- a/docker/Dockerfile.runs +++ b/docker/Dockerfile.runs @@ -2,20 +2,24 @@ # Build stage ARG GO_VERSION -FROM golang:${GO_VERSION}-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder ARG TARGETOS ARG TARGETARCH WORKDIR /src COPY go.mod go.sum ./ -RUN go mod download +RUN --mount=type=cache,target=/go/pkg/mod \ + go mod download COPY runs/ runs/ COPY flytestdlib/ flytestdlib/ COPY gen/ gen/ -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o runs-service runs/cmd/main.go +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ + go build -trimpath -o runs-service runs/cmd/main.go # Final stage FROM gcr.io/distroless/static-debian12 From 5540a95b1c3b87e76dbfe8203d3d75fe11a38c86 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 22:50:09 +0800 Subject: [PATCH 10/17] fix invalid field Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index 34254f05da..2f5f226e19 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -85,4 +85,4 @@ jobs: push: true targets: default set: | - IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} + *.args.IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} From 1ec2c56ce62eb21459dac4d6f4c20068665af4f2 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 23:20:49 +0800 Subject: [PATCH 11/17] test Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index 2f5f226e19..7af7be2170 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -43,8 +43,28 @@ on: - "go.sum" jobs: + prepare: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.generate.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + path: docker + - name: Generate matrix + id: generate + uses: docker/bake-action/subaction/matrix@v7 + with: + files: docker/docker-bake.hcl + target: default build-and-push: + needs: prepare runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Checkout uses: actions/checkout@v6 @@ -74,7 +94,7 @@ jobs: files: docker/docker-bake.hcl targets: default set: | - *.args.IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} + *.args.tags="ghcr.io/flyteorg/flyte/${{ matrix.target }}:${{ env.SHORT_SHA }}" - name: Build and push images if: github.event_name == 'push' @@ -85,4 +105,4 @@ jobs: push: true targets: default set: | - *.args.IMAGE_SHA_SHORT_TAG=${{ env.SHORT_SHA }} + *.args.tags="ghcr.io/flyteorg/flyte/${{ matrix.target }}:${{ env.SHORT_SHA }}" From 1c638aa31eba76399d23a27f454e56e42972bbd9 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 23:28:52 +0800 Subject: [PATCH 12/17] fix Signed-off-by: Ryan Lo --- .github/workflows/flyte-binary-v2.yml | 12 ++++++------ .github/workflows/flyte-core-v2.yaml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/flyte-binary-v2.yml b/.github/workflows/flyte-binary-v2.yml index bb10f4f48d..aa279cb402 100644 --- a/.github/workflows/flyte-binary-v2.yml +++ b/.github/workflows/flyte-binary-v2.yml @@ -100,11 +100,11 @@ jobs: path: docker/demo-bundled/images/tar - name: Login to GitHub Container Registry if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - uses: docker/login-action@v2 + uses: docker/login-action@v4 with: registry: ghcr.io - username: "${{ secrets.FLYTE_BOT_USERNAME }}" - password: "${{ secrets.FLYTE_BOT_PAT }}" + username: ${{ secrets.FLYTE_BOT_USERNAME }} + password: ${{ secrets.FLYTE_BOT_PAT }} - name: Build and push Image if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} uses: docker/build-push-action@v6 @@ -152,11 +152,11 @@ jobs: type=raw,value=nightly,enable=${{ github.event_name == 'push' && github.ref == 'refs/heads/v2' }} type=sha,format=long, - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v4 with: registry: ghcr.io - username: "${{ secrets.FLYTE_BOT_USERNAME }}" - password: "${{ secrets.FLYTE_BOT_PAT }}" + username: ${{ secrets.FLYTE_BOT_USERNAME }} + password: ${{ secrets.FLYTE_BOT_PAT }} - name: Save console image tarballs run: | mkdir -p docker/demo-bundled/images/tar/amd64 docker/demo-bundled/images/tar/arm64 diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index 7af7be2170..e8fa44b3ec 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -56,7 +56,7 @@ jobs: id: generate uses: docker/bake-action/subaction/matrix@v7 with: - files: docker/docker-bake.hcl + files: docker-bake.hcl target: default build-and-push: needs: prepare From 95b403109326461077cb254e567fbfae16a4f70e Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 23:32:32 +0800 Subject: [PATCH 13/17] fix Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index e8fa44b3ec..7f2b7f92ab 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -51,7 +51,8 @@ jobs: - name: Checkout uses: actions/checkout@v6 with: - path: docker + sparse-checkout: docker/docker-bake.hcl + sparse-checkout-cone-mode: false - name: Generate matrix id: generate uses: docker/bake-action/subaction/matrix@v7 From a6774af483b9399ee3dea04bfb87f376e3119349 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 23:33:29 +0800 Subject: [PATCH 14/17] fix Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index 7f2b7f92ab..50c931f326 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -57,7 +57,7 @@ jobs: id: generate uses: docker/bake-action/subaction/matrix@v7 with: - files: docker-bake.hcl + files: docker/docker-bake.hcl target: default build-and-push: needs: prepare From fb36d45e0b2eaf0b76391f728ad4966fbfb0421a Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 23:35:21 +0800 Subject: [PATCH 15/17] fix Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index 50c931f326..65fd16dc74 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -93,7 +93,7 @@ jobs: with: source: . files: docker/docker-bake.hcl - targets: default + targets: ${{ matrix.target }} set: | *.args.tags="ghcr.io/flyteorg/flyte/${{ matrix.target }}:${{ env.SHORT_SHA }}" @@ -104,6 +104,6 @@ jobs: source: . files: docker/docker-bake.hcl push: true - targets: default + targets: ${{ matrix.target }} set: | *.args.tags="ghcr.io/flyteorg/flyte/${{ matrix.target }}:${{ env.SHORT_SHA }}" From aa25576631a108a94594fbcf09f2c8dbf778722f Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Sun, 19 Apr 2026 23:56:38 +0800 Subject: [PATCH 16/17] test multi arch Signed-off-by: Ryan Lo --- .github/workflows/flyte-core-v2.yaml | 9 +++++++-- docker/docker-bake.hcl | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flyte-core-v2.yaml b/.github/workflows/flyte-core-v2.yaml index 65fd16dc74..3d534a65cc 100644 --- a/.github/workflows/flyte-core-v2.yaml +++ b/.github/workflows/flyte-core-v2.yaml @@ -44,7 +44,7 @@ on: jobs: prepare: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: matrix: ${{ steps.generate.outputs.matrix }} steps: @@ -59,9 +59,10 @@ jobs: with: files: docker/docker-bake.hcl target: default + fields: platforms build-and-push: needs: prepare - runs-on: ubuntu-latest + runs-on: ${{ startsWith(matrix.platforms, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} strategy: fail-fast: false matrix: @@ -95,7 +96,9 @@ jobs: files: docker/docker-bake.hcl targets: ${{ matrix.target }} set: | + *.platform=${{ matrix.platforms }} *.args.tags="ghcr.io/flyteorg/flyte/${{ matrix.target }}:${{ env.SHORT_SHA }}" + - name: Build and push images if: github.event_name == 'push' @@ -106,4 +109,6 @@ jobs: push: true targets: ${{ matrix.target }} set: | + *.platform=${{ matrix.platforms }} *.args.tags="ghcr.io/flyteorg/flyte/${{ matrix.target }}:${{ env.SHORT_SHA }}" + \ No newline at end of file diff --git a/docker/docker-bake.hcl b/docker/docker-bake.hcl index 62cf5fb045..f816f9d084 100644 --- a/docker/docker-bake.hcl +++ b/docker/docker-bake.hcl @@ -23,7 +23,7 @@ group "default" { target "_common" { context = "." - platforms = ["linux/arm64"] + platforms = ["linux/arm64", "linux/amd64"] args = { GO_VERSION = "${GO_VERSION}" } From fefd5a255c8df8c829be6a5e2abf3d928928f289 Mon Sep 17 00:00:00 2001 From: Ryan Lo Date: Mon, 20 Apr 2026 00:14:06 +0800 Subject: [PATCH 17/17] fix .github/workflows/flyte-binary-v2.yml Signed-off-by: Ryan Lo --- .github/workflows/flyte-binary-v2.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/flyte-binary-v2.yml b/.github/workflows/flyte-binary-v2.yml index aa279cb402..9a741f98c0 100644 --- a/.github/workflows/flyte-binary-v2.yml +++ b/.github/workflows/flyte-binary-v2.yml @@ -152,12 +152,14 @@ jobs: type=raw,value=nightly,enable=${{ github.event_name == 'push' && github.ref == 'refs/heads/v2' }} type=sha,format=long, - name: Login to GitHub Container Registry + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ secrets.FLYTE_BOT_USERNAME }} password: ${{ secrets.FLYTE_BOT_PAT }} - name: Save console image tarballs + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} run: | mkdir -p docker/demo-bundled/images/tar/amd64 docker/demo-bundled/images/tar/arm64 docker pull --platform linux/amd64 ghcr.io/flyteorg/flyte-client-v2:latest