Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-arch support to all images #15023

Merged
merged 17 commits into from
Feb 22, 2021
Merged

Add multi-arch support to all images #15023

merged 17 commits into from
Feb 22, 2021

Conversation

aanm
Copy link
Member

@aanm aanm commented Feb 18, 2021

Add multi-arch support into all images

  • Remove legacy Dockefiles;
  • Remove cilium-sha label as builds are done by GH Actions.

Makefile: add install-bash-completion target

When building images in multi-arch, we do cross-compilation of Cilium.
With this cross-compilation we won't be able to run Cilium to generate
the bash-completion of the binary. Thus, we need to have a new Makefile
target that installs the binaries without executing and binary and
another target that creates the bash-completion files by executing the
binary.

Added lots of improvements in the building process of cilium-{runtime,builder}

Once this PR is merged [quay|docker].io/cilium/*:latest, the latest tag of all official images, will cease to exist.

Note for reviewers:

  • If you have a better idea for the 3rd commit please let me know.
  • The 1st and 2nd commit will be squashed together, they are split to make the review easier.
    - Ignore the commit add branch for testing temporarily, as it is used to test GH actions, it will be removed before merging.
  • Ignore all GH action failures that show up in the PR as they are failing because Dockerfiles no longer exist, there are GH actions triggered specifically for this branch which are all green.

Follow up PRs:

  • add support for cilium/hubble edit: DONE!
  • Merge all "operator" dockerfiles into a single one
  • Use github caches to make the builds faster.

@aanm aanm added release-note/misc This PR makes changes that have no direct user impact. area/build Anything to do with the build, more general then area/CI labels Feb 18, 2021
@aanm aanm requested review from a team February 18, 2021 11:52
@aanm aanm requested review from a team as code owners February 18, 2021 11:52
@aanm aanm requested review from a team February 18, 2021 11:52
@aanm aanm requested a review from a team as a code owner February 18, 2021 11:52
@aanm aanm requested a review from a team February 18, 2021 11:52
@aanm aanm requested review from a team as code owners February 18, 2021 11:52
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Feb 18, 2021
aanm and others added 8 commits February 22, 2021 15:44
Signed-off-by: André Martins <andre@cilium.io>
Signed-off-by: André Martins <andre@cilium.io>
Signed-off-by: André Martins <andre@cilium.io>
Rename 'Dockerfile.dockerignore' files as '.dockerignore' in each
subdir of 'images/'. It will still be used, but this allows make based
builds to override it with a generated 'Dockerfile.dockerignore' file.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
As dockerfiles are now in the buildkit syntax there is no need to
create translated copies of them. This also removes the need for the
'_build' directory.

'images/*/Dockerfile.dockerignore' is still automatically generated
from the '.gitignore' files in the repository. This avoids sending
100's of MB of unneeded files (.git/, binaries, etc.) to the docker
build context.

Support for pushing manifests from make targets is removed as we now
use docker buildx by default. Define DOCKER_BUILDX=1 to turn on
multi-arch builds and automatic push. Without it the built images are
loaded to the local docker only. Images can be pushed manually from
there.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Use images/cilium/Dockerfile for Envoy reference & do not require
Envoy reference when not building Cilium.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Signed-off-by: André Martins <andre@cilium.io>
aanm and others added 4 commits February 22, 2021 18:55
Signed-off-by: André Martins <andre@cilium.io>
Signed-off-by: André Martins <andre@cilium.io>
Use `docker buildx build` explicitly rather than redefining
`CONTAINER_ENGINE` as `docker buildx`, as that caused docker runs be
executed as `docker buildx run`, which does not work.

Add `Makefile.docker` to the autogenerated dockerignore files, and
make `make` ignore it if missing.

Add support for detecting `ARCH` for docker builds. Defaults to empty
which is interpreted as build for the default platform of the current
builder (typically the host platform using the default
builder). `ARCH=multi` triggers multi-arch builds for all the
supported platforms, currently linux/amd64 and linux/arm64. Other
recognized values are `ARCH=amd64` and `ARCH=arm64` for single
platform builds.

When ARCH is specified and the current builder is the "default"
builder, a new cross-platform builder is created for all the supported
platforms.

Add support for `DOCKER_BUILDKIT_IMAGE` that allows dev to pass a
private image which is needed when using a self-signed docker registry
via `DOCKER_REGISTRY`.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Signed-off-by: André Martins <andre@cilium.io>
Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

Latest docs LGTM.

@aanm aanm merged commit ce328b6 into master Feb 22, 2021
1.10.0 automation moved this from In progress to Done Feb 22, 2021
@aanm aanm deleted the pr/add-multi-arch-support branch February 22, 2021 18:06
This was referenced Feb 22, 2021
tklauser added a commit to tklauser/cilium that referenced this pull request Mar 12, 2021
…IMAGE

Since the refactoring of the get-image-digest.sh script in commit
8e00f78 ("re-write get-image-digest script") as part of the image
build refactoring in cilium#15023, it should no longer be necessary to check
the usage of the image tag before getting the sha256. Just determine it
once outside the loop, regardless of usage in the respective files.

This will make it easier in the successive commit to replace the full
image name in files other than images/*/Dockerfile.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
kkourt pushed a commit that referenced this pull request Mar 15, 2021
…IMAGE

Since the refactoring of the get-image-digest.sh script in commit
8e00f78 ("re-write get-image-digest script") as part of the image
build refactoring in #15023, it should no longer be necessary to check
the usage of the image tag before getting the sha256. Just determine it
once outside the loop, regardless of usage in the respective files.

This will make it easier in the successive commit to replace the full
image name in files other than images/*/Dockerfile.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Anything to do with the build, more general then area/CI release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

9 participants