Skip to content

Adapting makefile for multiarch builds#497

Merged
olix0r merged 1 commit intolinkerd:masterfrom
jaerik:jaerik-multiarch-build
May 6, 2020
Merged

Adapting makefile for multiarch builds#497
olix0r merged 1 commit intolinkerd:masterfrom
jaerik:jaerik-multiarch-build

Conversation

@jaerik
Copy link
Contributor

@jaerik jaerik commented Apr 30, 2020

Make it possible to to build the linkerd2-proxy for other architectures the than the host architecture with make. This by updating the makefile to be aware of environment variables specifying the target architecture.

@olix0r
Copy link
Member

olix0r commented Apr 30, 2020

Thanks @jaerik! This looks great.

You don't have to necessarily make these changes in this branch: but do you have any thoughts on how we can support these builds in our release process? Our release process is driven by this github action:

https://github.com/linkerd/linkerd2-proxy/blob/c72c5f57da8af60cf89f57c2cc2c9a223cf15bd8/.github/workflows/release.yml

I assume that we need to figure out a way to produce binaries for each of the target platforms. Can we do this easily in Actions? If not, we may be able to provision build hosts for the target platforms... Anyway, this isn't a blocker; but I'd love to figure out a way to support these artifacts as a part of our automated release process. (Until then, it will be hard for us to consider these builds officially supported).

@olix0r
Copy link
Member

olix0r commented Apr 30, 2020

This CI failure is an issue with actions, not this branch.

@jaerik jaerik force-pushed the jaerik-multiarch-build branch from cd1105c to 0d647f5 Compare May 4, 2020 05:59
@jaerik
Copy link
Contributor Author

jaerik commented May 4, 2020

I assume that we need to figure out a way to produce binaries for each of the target platforms. Can we do this easily in Actions?

@olix0r I think you just can add a new action step for each target platform, e.g:

  • name: package-arm32v7
    env:
    CARGO_RELEASE: "1"
    CARGO_TARGET=armv7-unknown-linux-gnueabihf
    CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
    PACKAGE_VERSION: ${{ steps.release-tag-meta.outputs.name }}
    uses: ./.github/actions/package
    with:
    entrypoint: make
    args: package

And then just change the with-files in the realese step to:
files: target/x86_64-unknown-linux-gnu/release/package/* target/arm-linux-gnueabihf/release/package/* target/aarch64-unknown-linux-gnu/release/package/*

I'm not sure how to adapt the checksec step, when there are limitations when testing cross compiled systems.

@olix0r olix0r requested review from a team and kleimkuhler May 5, 2020 20:01
@olix0r olix0r self-assigned this May 5, 2020
Copy link
Contributor

@kleimkuhler kleimkuhler left a comment

Choose a reason for hiding this comment

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

👍

@olix0r olix0r merged commit 6166d32 into linkerd:master May 6, 2020
olix0r added a commit to linkerd/linkerd2 that referenced this pull request May 7, 2020
This release modifies Linkerd's internal buffering to avoid idling out
services as a request arrives. This could cause failures for requests
that are sent exactly once per minute, such as Prometheus scrapes.

---

* Handle GRPC body errors (linkerd/linkerd2-proxy#493)
* Set a grpc-status of UNAVAILABLE only on io errors (linkerd/linkerd2-proxy#498)
* inbound: Remove unnecessary buffer (linkerd/linkerd2-proxy#501)
* buffer: Move idle timeouts into the buffer (linkerd/linkerd2-proxy#502)
* make: Support CARGO_TARGET for multi-arch builds (linkerd/linkerd2-proxy#497)
* release: Use arch-specific paths (linkerd/linkerd2-proxy#508)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request May 7, 2020
This release modifies Linkerd's internal buffering to avoid idling out
services as a request arrives. This could cause failures for requests
that are sent exactly once per minute, such as Prometheus scrapes.

---

* Set a grpc-status of UNAVAILABLE only on io errors (linkerd/linkerd2-proxy#498)
* inbound: Remove unnecessary buffer (linkerd/linkerd2-proxy#501)
* buffer: Move idle timeouts into the buffer (linkerd/linkerd2-proxy#502)
* make: Support CARGO_TARGET for multi-arch builds (linkerd/linkerd2-proxy#497)
* release: Use arch-specific paths (linkerd/linkerd2-proxy#508)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request May 7, 2020
This release modifies Linkerd's internal buffering to avoid idling out
services as a request arrives. This could cause failures for requests
that are sent exactly once per minute, such as Prometheus scrapes.

---

* Set a grpc-status of UNAVAILABLE only on io errors (linkerd/linkerd2-proxy#498)
* inbound: Remove unnecessary buffer (linkerd/linkerd2-proxy#501)
* buffer: Move idle timeouts into the buffer (linkerd/linkerd2-proxy#502)
* make: Support CARGO_TARGET for multi-arch builds (linkerd/linkerd2-proxy#497)
* release: Use arch-specific paths (linkerd/linkerd2-proxy#508)
olix0r pushed a commit that referenced this pull request Jun 15, 2020
This change adds support for a `CARGO_TARGET` environment variable.
When set, this value is passed to i.e. `cargo build --target` to support
cross-compilation for multi-architecture builds.

Signed-off-by: jaerik <[email protected]>
Co-authored-by: Erik Jansson <[email protected]>
hawkw pushed a commit that referenced this pull request Jun 15, 2020
* make: Support CARGO_TARGET for multi-arch builds (#497)

This change adds support for a `CARGO_TARGET` environment variable.
When set, this value is passed to i.e. `cargo build --target` to support
cross-compilation for multi-architecture builds.

Signed-off-by: jaerik <[email protected]>
Co-authored-by: Erik Jansson <[email protected]>

* Add a CODEOWNERS (#558)

This CODEOWNERS change will ensure that proxy-maintainers are requested on all PRs.

Co-authored-by: Erik Jansson <[email protected]>
Co-authored-by: Erik Jansson <[email protected]>
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.

3 participants