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

Supporting new features for function placements/scheduling #815

Open
1 of 2 tasks
aslanpour opened this issue Jul 14, 2021 · 2 comments
Open
1 of 2 tasks

Supporting new features for function placements/scheduling #815

aslanpour opened this issue Jul 14, 2021 · 2 comments

Comments

@aslanpour
Copy link

aslanpour commented Jul 14, 2021

I would suggest some improvements in the flexibility in scheduling functions in OpenFaaS.

Expected Behaviour

It is not a bug.

This improvement would help to enable a finer-grained scheduling decision for functions, so we can work on replica-level scheduling, not just function-level. This improvement should also let us do the scheduling stuff all in a configuration, not scattered between Profile and Function's Deployment description.

Current Behaviour

It is not a bug.

Current scheduling enablers in OpenFaaS include setting the "limitation" (or under the hood: nodeName) in the function's deployment which is way simplistic. Also, the "Profile" feature is able to accommodate affinity and toleration which helps, but still, new features such as Pod topology spread is missing. By enabling nodeName in the Profile feature, the scheduling enablers can get together all in Profiles. And, by supporting new features, finer-grained scheduling is going to be more possible.

Are you a GitHub Sponsor (Yes/No?)

No

I am basing my PhD on OpenFaaS and by disseminating my findings in journals and conferences, the use of OpenFaaS as a reliable serverless platform will be encouraged, particulalrly in academia.
Check at: https://github.com/sponsors/openfaas

  • Yes
  • No

List All Possible Solutions and Workarounds

I would suggest making the Profile feature further comprehensive by covering the newly added features in the scheduling of Pods. Another suggestion is enabling users with specifying the schedulerName in the functions' deployment description so they can apply any possible scheduling stuff in their custom scheduling configuration.

The addition will be support for Pod Topology Spread Constraints, Extended Resources, NodeName, Plugins, priorityClassName , and terminationGracePeriodSeconds, but these are just based on my understanding of scheduling features and could be more.

I am not sure, but a generic way of including PodSpec items in the function's deployment can do all this stuff. Perhaps the Function CRD will be an effort towards achieving this.

Which Solution Do You Recommend?

I am really in favor of a generic solution, as Kubernetes keeps adding new features and this will be a hassle for OpenFaaS developers to accommodate them one by one. By generic, I mean realizing a dynamic template in Function's description that can cover any PodSpec configuration.

Steps to Reproduce (for bugs)

Context

I am trying to achieve a replica level scheduling of functions so I can place each function on a particular node based on the node's performance. But, at the moment, not being able to use Pod Spread Constraint, priority, preemption, extended resources and so on are a hassle and would not let me achieve it.

Your Environment

  • FaaS-CLI version ( Full output from: faas-cli version ):
    CLI:
    commit: 72816d486cf76c3089b915dfb0b66b85cf096634
    version: 0.13.13* Docker version docker version (e.g. Docker 17.0.05 ):

  • What version and distriubtion of Kubernetes are you using? kubectl version
    K3s

  • Operating System and version (e.g. Linux, Windows, MacOS):
    Linux (Raspbian)

  • Link to your project or a code example to reproduce issue:

  • What network driver are you using and what CIDR? i.e. Weave net / Flannel

Hi everyone,

Obtaining some experience with customized scheduling of functions in OpenFaaS, I see (as a student) there is the potential to improve the Profile functionality and Function's Deployment in the interest of better flexibility.
I would suggest supporting the following features:

To be added to Profile:

Pod Topology Spread Constraints

Extended Resources

NodeName (already exists in Functions's Deployment, but better to have it in Profiles as well)
schedulerName (having this in Function's Deployment is a good choice, too)
Plugins (I mean the ability to disable/enable scheduling plugins)

To be added to Function's Deployment:
priorityClassName (to implement Pod priority and Preemption)
terminationGracePeriodSeconds(for Distruptions)

I think such features can help to improve the cluster's performance significantly.
Also, I find it really helpful if we can have particular PodSpec items such nodeName, priorityClassName, terminationGracePeriodSeconds, etc in Profiles as well for better handling the scheduling stuff.
I also understand keeping OpenFaaS as simple as possible is of your concerns, but I just thought sharing my ideas would perhaps be useful.

Thanks,
Mohammad

@alexellis
Copy link
Member

Hi @aslanpour thanks for your interest in OpenFaaS.

Please can I ask you to edit your issue and use the proper template that we have provided?

The context fields are also extremely important if you want to influence the backlog and our roadmap.

Thanks,

Alex

@aslanpour
Copy link
Author

Hi @alexellis
I tried to fill in the fields as much as I could.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants