-
Notifications
You must be signed in to change notification settings - Fork 4
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 support for building functions with the OpenFaaS function Builder API. #33
Conversation
Just a thought Do you have a multi-arch example too with platforms? |
Do we perhaps want to include the BuildConfig struct and a method to write it out? I can see that much more than just a build API call is being done via the I think the tar step and writing the config could be made more visible to the user. The goal isn't to make this more abstract, but to make it quick to integrate with using the SDK and Go. |
I designed this by taking a look at how we would use this SDK functionality in the Both ways of building take the same argument: a build context, image name, platforms, build args, etc. Based on this config they build (and push) the function container image. The fact that in the case of the Remote Build the build context and config are combined in a tar that needs to be send to the builder API is an implementation detail that does not need to be exposed to the caller. However a do agree that we can take a different approach and have the SDK expose the functions that are now abstracted by the It would by up the the users of the SDK to use these function to build a similar abstraction if needed.
My thought around this, building on my previous arguments is that I took a similar approach to the
That is not in the REAMDE yet but I will add an example of how to specify target architectures. |
c13d2e6
to
f08821e
Compare
The PR has been updated with the requested changes.
|
This is much closer to what I had in mind. Do you have sample arguments I can run to try it out with the tester program? |
f08821e
to
6197f84
Compare
6197f84
to
5e8a2e9
Compare
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 think I'd like to change the approach to shrinkwrap before we move this forward.
5e8a2e9
to
4007d54
Compare
The |
4007d54
to
9fd11f7
Compare
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
9fd11f7
to
66a2d26
Compare
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.
Approved
OK that looks good 👍 let's get it written up quickly on the blog and the vendoring back to the CLI can come later on. |
Description
Add a package
builder
to support building function using the Function Builder APIThe README was updated to include a full example for building functions with a more detailed explanation for each step.
Motivation and context
Support building OpenFaaS functions from go code using the SDK.
How has this been tested
Modified the go example from the function builder examples to use the go-sdk for E2E testing.