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

Run Rover on Alpine images #537

Closed
4 tasks done
EverlastingBugstopper opened this issue May 12, 2021 · 3 comments
Closed
4 tasks done

Run Rover on Alpine images #537

EverlastingBugstopper opened this issue May 12, 2021 · 3 comments
Labels
feature 🎉 new commands, flags, functionality, and improved error messages needs decision 🤝
Milestone

Comments

@EverlastingBugstopper
Copy link
Contributor

EverlastingBugstopper commented May 12, 2021

It has become quite clear that there is high demand for running Rover on Alpine in production images due to Alpine's lightweight nature. Unfortunately with the introduction of rover supergraph compose, we stopped building fully static binaries for Linux since, well, rusty_v8 does not have prebuilt binaries for x86_64-unknown-linux-musl.

We want you to be able to use Rover in your Alpine images, but the constraints have forced our hand to a less-than-perfect solution. We've decided on first steps, but discussion is open on future steps!

First steps

Our first step will be to build binaries for x86_64-unknown-linux-musl that do not include rover supergraph compose.

This includes the following work:

  • Create a cargo feature for rover supergraph compose.
    If the feature is not enabled, running rover supergraph compose should error with:
    $ rover supergraph compose --config ./supergraph.yml
    error: You cannot run `rover supergraph compose` with this binary.
            You will need to install Rover on a machine that includes `glibc >= vX.X`
  • Add a step to our release GitHub action to build for x86_64-unknown-linux-musl with that feature disabled
  • Update the curl installer to install the musl build if glibc does not exist
  • Update the npm installer to install the musl build if glibc does not exist

Possible future steps

  • Bundle the JavaScript file that does composition with the musl build, and shell out to node directly to run composition
  • Create a cloud function that executes composition and use that with the musl build
  • Wait for rusty_v8 to build binaries for musl
  • Write a composition function in pure Rust

A PR for first steps will come shortly, but it won't close this issue until we decide on possible future steps. If and when that future is decided, we will create a new issue and close this one.

@EverlastingBugstopper EverlastingBugstopper added feature 🎉 new commands, flags, functionality, and improved error messages needs decision 🤝 labels May 12, 2021
@EverlastingBugstopper EverlastingBugstopper added this to the May 25 milestone May 12, 2021
@glasser
Copy link
Member

glasser commented May 12, 2021

Random drive-by comment: This is a great and pragmatic solution! I love it!

Would it be reasonable for the curl installer (and maybe the npm installer) to print something in this case like "warning: you appear to be running on a platform without glibc, which is required to support the rover supergraph compose command. Installing a version of rover without support for that command." ?

@EverlastingBugstopper
Copy link
Contributor Author

@glasser somehow just saw this comment, but good news! The PR I have up does just this 😊

@EverlastingBugstopper
Copy link
Contributor Author

The first steps outlined here have landed and will be released next Tuesday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🎉 new commands, flags, functionality, and improved error messages needs decision 🤝
Projects
None yet
Development

No branches or pull requests

2 participants