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 buildpack/builder/stacks for Rust #95

Merged
merged 2 commits into from
Jun 21, 2021
Merged

Conversation

jcrossley3
Copy link
Contributor

@jcrossley3 jcrossley3 commented Jun 7, 2021

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.

@jcrossley3 jcrossley3 marked this pull request as ready for review June 8, 2021 18:08
Copy link
Member

@lance lance left a 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
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

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}}"
Copy link
Member

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
Copy link
Member

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.

@matejvasek
Copy link
Contributor

Before making release it might be good to create faas-rust-builder and faas-rust-bp repositories with public visibility in boson org.

@lance lance merged commit 67fad46 into boson-project:main Jun 21, 2021
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