-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.Categorizes issue or PR as related to cleaning up code, process, or technical debt.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
Milestone
Description
The SDK build process currently has a pretty convoluted process for building docker images that involves several make targets and hack scripts.
I propose that we reduce this complexity by consolidating all image build steps into multi-stage Dockerfiles. With this change we will:
- Update Dockerfiles to perform go binary builds in a builder stage rather than copying in a pre-built binary.
- Update the
image-build
make targets to remove the make dependencies that build go binaries in the local environment - Update the
image-build
make targets to call docker directly. - Remove the
hack/image-build-*
scripts that are obsolete due to 3). - Move all Dockerfiles into
hack/image/<image-name>
. They were previously split betweenhack/image/
andimages/
- Move loading of images into kind from the image build step to the e2e tests where the images are actually required to be loaded into kind. Image building shouldn't be concerned with e2e setup.
This will give the project several benefits:
- Reproducible builds. All images will be built using identical environments, regardless if run in CI or by a developer locally.
- Reduce complexity. The build steps are now more self-contained in the respective Dockerfiles.
- Co-location in
hack/image
reduces the overhead of remembering where various files are for each image build. - Simplified support for multiple architectures. Now that the go build happens as part of the image build, it is now much simpler to ensure the binary target architecture matches the image architecture.
There are some things I would consider out-of-scope for this:
- Large overhauls of the Makefile. For now, I think we can have the docker go build stage call
make
to build the same binaries we always have. - Changes to the travis configuration and the way images are pushed and deployed.
Metadata
Metadata
Assignees
Labels
kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.Categorizes issue or PR as related to cleaning up code, process, or technical debt.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.