Proposal: Create/extract faas-cli SDK
Detach faas-cli logic currently in commands package to an autonomous package. This would make reusability a lot easier and testing (as library or exposed as service) .
Expected Behaviour
I would like to reuse commands in a grpc service (https://github.com/muka/faas-cli-grpc) to expose build & deploy as a service API
Currently this may be done by just running shell scipts, but raw response, error management and configuration make it difficult to handle.
Other area of improvement are where to store local files (eg. the template/ folder ) and also ease up test eventually as a positive side effect.
Current Behaviour
The CLI works great but there is room for improvement on reusability of the features
Possible Solution
- Moved most of the commands logic under
api - Added a
workdirflag and setter/getter for where to put local files - refactored paths reference to be resolved via
filepath.Resolve - Tried to maintan backward compatibility at end user side
I have built a POC here https://github.com/muka/faas-cli
Not all commands has been ported (still missing logout, new, remove, version) but all tests passes
Would love to get feedback! Thanks
Context
I am looking to enable function building as a service in a multi-tenant and eventually distributed environment
Issue that may be related or addressable
- Added as a configurable path https://github.com/openfaas/faas-cli/issues/154
-
Servicescan be passed as argument https://github.com/openfaas/faas-cli/issues/128
Derek add label: question
Hi @muka I'll send this to the contributors channel on slack for feedback
Don't go too far with your gRPC service until we've had a chance to validate the changes. It's likely that we'll make changes that you'll want to keep in sync with.
Sure, I will not make further changes / dev until I have your feedback. Thanks
@muka do you have any input on the issue? This seems pretty outdated. How do you feel with the latest faas-cli?
Please close, thank you!