Skip to content

Conversation

@apostasie
Copy link
Contributor

@apostasie apostasie commented Mar 5, 2025

For context, see #3940, #3924, and the start of this PR cycle at #3983.

On top of #3985


We currently depend on two distincts golang image (bookworm and alpine), and we also download a golang archive from go servers.

Depending at all on docker images is a significant source of issues:

  • there is delay between availability of go version and availability of go images on the hub - this has regularly broken canary in the past (currently is broken (*))
  • go images on the hub have their own versioning scheme that is different from golang's, requiring us to do some shell monkeying to convert one version to the other
  • hitting the Hub often leads to the dreaded 429 (too many requests)
  • the hub image adds no visible value on top of the archive that we are downloading anyways...

This PR does cleanup our base images.

It bases every build stage on a single image, a naked bookworm, and uses the golang version of go.

That will reduce our network traffic with Hub, improve cacheability, and make our life less miserable when new versions of go arrive.

Finally, this will drastically reduce network com with go servers, as currently the archive is never cached and always downloaded, for every target we build. There should be a speed boost out of that for the later build stages.

(*) this PR does fix the current canary bustage

@apostasie apostasie force-pushed the ci-build-accel-4 branch 4 times, most recently from f545aaf to 65b6293 Compare March 5, 2025 00:56
@apostasie apostasie changed the title [WIP] Cleanup Dockerfile base images [WIP] CI, build 4: Cleanup Dockerfile base images Mar 5, 2025
@apostasie apostasie changed the title [WIP] CI, build 4: Cleanup Dockerfile base images CI, build 4: Cleanup Dockerfile base images Mar 5, 2025
@apostasie apostasie marked this pull request as ready for review March 5, 2025 01:37
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
ENV TERM="xterm"
ENV LANG="C.UTF-8"
ENV LC_ALL="C.UTF-8"
ENV TZ="America/Los_Angeles"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

FROM --platform=$BUILDPLATFORM debian:$DEBIAN_VERSION AS tooling-base
SHELL ["/bin/bash", "-o", "errexit", "-o", "errtrace", "-o", "functrace", "-o", "nounset", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND="noninteractive"
ENV TERM="xterm"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

SHELL ["/bin/bash", "-o", "errexit", "-o", "errtrace", "-o", "functrace", "-o", "nounset", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND="noninteractive"
ENV TERM="xterm"
ENV LANG="C.UTF-8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the default locale?

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["bash", "--login", "-i"]

# convert GO_VERSION=1.16 to the latest release such as "go1.16.1"
Copy link
Member

@AkihiroSuda AkihiroSuda Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this

Alternative:

echo "Failed retrieving go download for $arch: $GO_VERSION"; \
exit 1; \
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This complicates the Dockerfile too much

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't get the advantages of this

@AkihiroSuda
Copy link
Member

there is delay between availability of go version and availability of go images on the hub

Yes, but usually fixed within a day

@AkihiroSuda
Copy link
Member

Alternative:

@apostasie
Copy link
Contributor Author

Sorry, I don't get the advantages of this

Commented briefly on #3997

The point is that our current Dockerfile is retrieving massive amount of data for no good reason, and heavily depends on Hub for stuff that is very easy to do without.

We just disagree on the way to tackle these problems, so, I'll just retract this proposal.

@apostasie apostasie closed this Mar 10, 2025
@apostasie apostasie mentioned this pull request Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants