<#3194 Refactor single-binary image builds> Pull r...
# flyte-github
a
#3194 Refactor single-binary image builds Pull request opened by jeevb This PR does the following: • Separate single-binary CI pipeline • Speed up image builds for faster CI cycles (see below for more details) Build times are reduced by roughly 75% with the following 2 changes: (1) Go builds are now done on the native build platform for all target architectures, by: • specifying the builder image as
FROM --platform=${BUILDPLATFORM} golang:1.19.1-bullseye AS flytebuilder
• using
ENV GOARCH=${TARGETARCH}
. For building an arm64 image on CI, these will be: •
FROM --platform=linux/amd64 golang:1.19.1-bullseye AS flytebuilder
ENV GOARCH=arm64
Build times for
arm64
and
amd64
images are roughly the same now. (2) Removing caching from image build steps:
Copy code
cache-from: type=gha
cache-to: type=gha,mode=max
There was no indication that layer caches were being leveraged, likely due to our complex multi-stage Dockerfiles, but the cache export step is an expensive one, taking up to 75% of the time for some image builds. Even if we were to fix our pipelines to correctly and efficiently use caching, our build times are short enough such that caching image layers would not provide any substantial benefit. flyteorg/flyte All checks have passed 11/11 successful checks