faas-cli icon indicating copy to clipboard operation
faas-cli copied to clipboard

Support streaming logs for remote builds.

Open welteki opened this issue 6 months ago • 0 comments

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 up and faas-cli publish command stream build logs to sdout if the Function Builder API supports it.

  • Switch to using the builder.CreateBuildeContext and builder.MakeTar functions 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 up and faas-cli publish command 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.txt
    
    faas-cli publish --remote-builder http://127.0.0.1:8081 \
      --payload-secret $HOME/.openfaas/payload.txt
    
  • Verified both the faas-cli up and faas-cli publish command 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.

welteki avatar Jun 17 '25 11:06 welteki