Support streaming logs for remote builds.
Description
Add support for streaming build logs when building function using the OpenFaaS Function Builder API
Switch to the "github.com/openfaas/go-sdk/builder" package for building functions.
-
Use the builder.FunctionBuilder to invoke the Function Builder API for remote builds. Both the
faas-cli upandfaas-cli publishcommand stream build logs to sdout if the Function Builder API supports it. -
Switch to using the
builder.CreateBuildeContextandbuilder.MakeTarfunctions from the Go SDK instead of their local variants.
Motivation and Context
- [ ] I have raised an issue to propose this change (required)
Provide real time feedback on build progress for remote builds.
How Has This Been Tested?
-
Verified both the
faas-cli upandfaas-cli publishcommand work as expected when using the remoter builder. Verified build logs are streamed in real time when using the latest version of the function builder.faas-cli up --remote-builder http://127.0.0.1:8081 \ --payload-secret $HOME/.openfaas/payload.txtfaas-cli publish --remote-builder http://127.0.0.1:8081 \ --payload-secret $HOME/.openfaas/payload.txt -
Verified both the
faas-cli upandfaas-cli publishcommand still work with older versions (<0.4.3) of the function builder that do not support streaming build logs.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I've read the CONTRIBUTION guide
- [x] I have signed-off my commits with
git commit -s - [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.