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

Proposal: Create/extract faas-cli SDK

Open muka opened this issue 8 years ago • 6 comments

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 workdir flag 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
  • Services can be passed as argument https://github.com/openfaas/faas-cli/issues/128

muka avatar Nov 25 '17 14:11 muka

Derek add label: question

alexellis avatar Nov 26 '17 09:11 alexellis

Hi @muka I'll send this to the contributors channel on slack for feedback

alexellis avatar Nov 29 '17 23:11 alexellis

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.

alexellis avatar Nov 29 '17 23:11 alexellis

Sure, I will not make further changes / dev until I have your feedback. Thanks

muka avatar Nov 30 '17 08:11 muka

@muka do you have any input on the issue? This seems pretty outdated. How do you feel with the latest faas-cli?

ivanayov avatar Nov 08 '18 16:11 ivanayov

Please close, thank you!

muka avatar Nov 08 '18 17:11 muka