Skip to content
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

Proposal: Allow to create groups of functions inside openfaas portal #1156

Closed
1 task done
Jerome1337 opened this issue Apr 8, 2019 · 10 comments
Closed
1 task done

Comments

@Jerome1337
Copy link

My actions before raising this issue

Actually, for example I have some functions on my portal then I have PORTAL_URL/function/myFunction, it would be great to have the possibility to create groups directly inside openfaas portal and deploy new functions inside a group.

The result would be PORTAL_URL/function/myGroup/myFunction, this would be great if we want to deploy some functions with the same theme (idk, maybe images processing/server management or whatever) and then allow us to sort functions and have a cleaner openfaas portal function list, mostly if you have a lot of functions registered in your portal.

This can also simplify some use case when functions are invoked inside app/program, for example a program than only invoke functions of a same theme, by defining only a default/base URL and then use only the good function name.

@zeerorg
Copy link
Contributor

zeerorg commented Apr 14, 2019

If you are not looking for changing how the url works, you can get the grouping functionality inside Portal UI rather easily.

You can use function annotations to set similar value for something like com.openfaas.group for functions to be grouped together, and then change the UI code to display a group of functions.

This has the possibility of being a lot more backward compatible.

@alexellis
Copy link
Member

Grouping could be implemented in your own microservice fronting the API gateway. We do similar in OpenFaaS Cloud.

This isn't on the roadmap for core OpenFaaS right now.

OpenFaaS Cloud does grouping by user or organization and would probably your best option for this behaviour.

@alexellis
Copy link
Member

Derek add label: support

@derek derek bot added the support label Apr 14, 2019
@fadams
Copy link

fadams commented May 3, 2019

I too think that this would be useful. A FaaS platform is not just about the invocation of the functions themselves it's also about the whole lifecycle. Having what amounts to a flat namespace is all well and good when you have a fairly trivial system, but as systems become more complex and in particular when you wish to build multiple subsystems or indeed deploy multiple orthogonal systems then it becomes increasingly important to be able to partition into groups of related functions.

I appreciate that it's possible to do this external to OpenFaaS but it does seem to be useful to consider this type of namespacing as part of the FaaS platform - I mean it doesn't take long for the set of function pods under the openfaas-fn namespace to get out of hand too.

Fn https://fnproject.io/ certainly partitions groups of functions into "apps" and ISTR that Fission https://fission.io/ does too, so it would seem to be a fairly common (and useful) thing to be able to do.

@alexellis
Copy link
Member

What is your use-case for "groups" of functions?

Did you hit some kind of crazy limit like 3000 functions and want better paging?

Are you actually looking for multi tenancy controls?

Is it just that you like logical organisation of stuff?

Something else?

I appreciate you are trying to solve a real problem so I'd rather start with the usecase or an actual problem than with the solution.

@zeerorg
Copy link
Contributor

zeerorg commented May 6, 2019

I think something like grouping could help if I'm deploying multiple pipelines in a single openfaas instance then I can have better separation of concerns between them.
Also as mentioned the UI could make use of that to better group functions. As people deploy more functions having them separate could be a good solution for power users. But it's definitely not a solution for multitenancy which I think needs a lot more than just namespaces.

@alexellis
Copy link
Member

We are currently providing multi-user in OpenFaaS Cloud. Feel free to check it out and see if it's useful for your purposes.

@fadams
Copy link

fadams commented May 6, 2019

@alexellis as far as use cases go all the things that you mention and more. Basically grouping of functions along application grounds is conceptually similar to the sort of namespacing provided in many high-level languages. A simple scenario might be where one wishes to identify object type such as text, image, speech, video and have a bunch of functions in each class, sure it's possible to do this all with a large flat namespace, but it's much more convenient to be able to partition.

As @zeerorg says, it's about separation of concerns and has proven a useful concept in many languages over the years to aid with partitioning large problem spaces.

I'd also agree that (good) multi-tenancy needs a lot more than just namespaces - that's another reason why it's be a good idea to be able to (optionally) use so much lower level container controls - ultimately running function pods on top of VMs or more ideally something like Firecracker would provide much better isolation. Actually, being able to to select the container runtime would be useful for a number of scenarios including GPU acceleration (nvidia-docker uses a custom runc and also requires volume mounts - and I've already tried to argue that I think those are useful for many reasons). Obvs all of that is somewhat orthogonal to namespaces, but I do think that looking beyond simple hello world use cases will ultimately be what makes OpenFaaS successful and I definitely want it to be successful 'cause despite my nit picking I do think it's really cool.

@alexellis
Copy link
Member

Thanks for your suggestions, what I'm really looking for is a real-life use-case to justify the feature beyond conceptual (logical) grouping.

I'm going to close this issue because It currently doesn't meet the bar for a proposal according to the contribution guide. It is more of a suggestion which we will continue to track and consider revisiting in the future.

Work to support multiple namespaces is on the backlog already and being tracked in the faas-netes repo

@alexellis
Copy link
Member

Derek add label: revisit

@derek derek bot added the revisit label May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants