-
Notifications
You must be signed in to change notification settings - Fork 11
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 buildpack/builder/stacks for Rust #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly lgtm. I made a suggestion re: the run image, but now that I think about it, it's probably a little involved to change the Makefile and build-stack.sh
. Probably worthy of a separate PR
#!/usr/bin/env bash | ||
set -eo pipefail | ||
|
||
if [[ ! -f Cargo.toml ]] ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soon I think we should change all of the buildpacks to look first for a func.yaml file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there wasn't a func.yaml file, how would func know which builder to even run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly - and if there's not a func.yaml, then it's probably not a function project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking it's a redundant, superfluous check because of course there's a func.yaml there because that's the only possible way func
would've invoked this builder in the first place...
But you must be thinking that the buildpack might be invoked by something other than func
so we need to check for func.yaml
to prevent... what exactly? Sorry for being dense.
[stack] | ||
id = "dev.boson.stacks.rust" | ||
build-image = "quay.io/boson/faas-stack-build:rust-{{VERSION}}" | ||
run-image = "quay.io/boson/faas-stack-run:rust-{{VERSION}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have multiple buildpacks that result in a binary for runtime execution, we should probably have a single tag for these vs. boson/faas-stack-run:rust-{{VERSION}}
and boson/faas-stack-run:go-{{VERSION}}
which are bit for bit the same image outside of the tag.
Perhaps this should point to quay.io/boson/faas-stack-run:ubi8-minimal-{{VERSION}}
. It has all of the necessary metadata, and we can avoid adding another tag to the image.
@@ -0,0 +1,8 @@ | |||
ARG version=tip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my note above about using just the ubi8-minimal-{{VERSION}}
image as the run image for Rust.
Before making release it might be good to create |
A pretty simple first attempt here, using the cargo/rust packages available in the Red Hat ubi repo (rustc v1.49.0)
Possible enhancements include rust version selection using
rustup
and non-linked binaries using a musl target.