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

Update the policy-controller release build process #6672

Merged
merged 23 commits into from
Aug 13, 2021
Merged

Update the policy-controller release build process #6672

merged 23 commits into from
Aug 13, 2021

Conversation

olix0r
Copy link
Member

@olix0r olix0r commented Aug 12, 2021

We can't use the typical multiarch docker build with the proxy:
qemu-hosted arm64/arm builds take 45+ minutes before failing due to
missing tooling--specifically protoc. (While there is a protoc
binary available for arm64, there are no binaries available for 32-bit
arm hosts).

To fix this, this change updates the release process to cross-build the
policy-controller on an amd64 host to the target architecture. We
separate the policy-controller's dockerfiles as amd64.dockerfile,
arm64.dockerfile, and arm.dockerfile. Then, in CI we build and push
each of these images individually (in parallel, via a build matrix).
Once all of these are complete, we use the docker manifest CLI tools
to unify these images into a single multi-arch manifest.

This cross-building approach requires that we move from using
native-tls to rustls, as we cannot build against the platform-
appropriate native TLS libraries. The policy-controller is now feature-
flagged to use rustls by default, though it may be necessary to use
native-tls in local development, as rustls cannot validate TLS
connections that target IP addresses.

The policy-controller has also been updated to pull in tracing-log for
compatibility with crates that do not use tracing natively. This was
helpful while debugging connectivity issue with the Kubernetes cluster.

The bin/docker-build-policy-controller helper script now only builds
the amd64 variant of the policy controller. It fails when asked to build
multiarch images.

kube v0.59 depends on k8s-openapi v0.13, which includes breaking
changes.

This change updates these dependencies and modifies our code to account
for these changes.

Furthermore, we now use the k8s-openapi feature `v1_16` so that we use
an API version that is compatible with Linkerd's minimum support
kubernetes version.

Closes #6657 #6658 #6659
The policy-controller fails to build on arm32 due to a file system
error. crazy-max/ghaction-docker-buildx#172 describes a workaround:
create a smaller temporary filesystem for docker builds.

This change employs this workaround to unblock releasing linkerd.
We can't use the typical multiarch docker build with the proxy:
qemu-hosted arm64/arm builds take 45+ minutes before failing due to
missing tooling--specifically `protoc`. (While there is a `protoc`
binary available for arm64, there are no binaries available for 32-bit
arm hosts).

To fix this, this change updates the release process to cross-build the
policy-controller on an amd64 host to the target architecture. We
separate the policy-controller's dockerfiles as `amd64.dockerfile`,
`arm64.dockerfile`, and `arm.dockerfile`. Then, in CI we build and push
each of these images individually (in parallel, via a build matrix).
Once all of these are complete, we use the `docker manifest` CLI tools
to unify these images into a single multi-arch manifest.

This cross-building approach requires that we move from using
`native-tls` to `rustls`, as we cannot build against the platform-
appropriate native TLS libraries. The policy-controller is now feature-
flagged to use `rustls` by default, though it may be necessary to use
`native-tls` in local development, as `rustls` cannot validate TLS
connections that target IP addresses.

The policy-controller has also been updated to pull in `tracing-log` for
compatibility crates that do not use `tracing` natively. This was
helpful while debugging connectivity issue with the Kubernetes cluster.

The `bin/docker-build-policy-controller` helper script now *only* builds
the amd64 variant of the policy controller. It fails when asked to build
multiarch images.
@olix0r olix0r changed the title release: Use a temporary file-system for docker builds Update the policy-controller release build process Aug 13, 2021
@olix0r olix0r marked this pull request as ready for review August 13, 2021 15:08
@olix0r olix0r requested a review from a team as a code owner August 13, 2021 15:08
@olix0r olix0r merged commit 79a5849 into main Aug 13, 2021
@olix0r olix0r deleted the ver/dockerfs branch August 13, 2021 16:28
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.

None yet

3 participants