openfaas-incubator / faas-rancher

Serverless with Rancher 1.x and (OpenFaaS)
https://github.com/openfaas/faas
MIT License
23 stars 7 forks source link

Mandatory update needed for `availableReplicas` #3

Open alexellis opened 6 years ago

alexellis commented 6 years ago

Hi @kenfdev,

A mandatory update is needed for OpenFaaS providers to work with the newest changes proposed in the OpenFaaS UI.

A new field: availableReplicas will need to be populated in the endpoint /system/function/

Now the purpose of this field is to indicate which functions (containers) have a replica ready for a HTTP request - often when pulling a large image the function is not ready until several minutes in. That's the purpose of this change - to provide that information to the UI or new endpoint.

You may need to vendor the latest release of faas-provider, which adds a healthcheck endpoint also.

https://github.com/openfaas/faas-provider/releases

The easiest way to maintain compatibility will be to set the availableReplicas count to be the same as replicas - this will mean the UI continues to work as planned. Down the road updating availableReplicas to its true meaning would be best.

Let me know if you have questions or if I can help.

Alex

See also: https://github.com/hashicorp/faas-nomad/issues/33

kenfdev commented 6 years ago

Thanks Alex, I'll try implementing this. Just need some time.

roomthirteen commented 5 years ago

any news on this issue?

alexellis commented 5 years ago

@roomthirteen are you using Rancher 1.0 or 2.0? This provider is for Rancher 1.0 - no provider was needed for 2.0 since it uses the OpenFaaS Kubernetes provider.

https://github.com/openfaas/faas-netes

Alex

roomthirteen commented 5 years ago

@alexellis we are still using Rancher 1.0 as we could not yet upgrade our infrastructure... I've created my own fork for now (https://github.com/picibird/faas-rancher) until/if this will be fixed here.

alexellis commented 5 years ago

Would you like to raise a PR against this repository if you've fixed the readiness check? I've sent you an invite for Slack, maybe we can chat more there too?

alexellis commented 5 years ago

@roomthirteen I can't see any functional changes in your fork in the master branch.

I might be able to save you some work too. You don't need to rename the GitHub namespace, you can change the origin of your repo and when running within Docker it also doesn't matter.

alexellis commented 5 years ago

cc @jgnagy

roomthirteen commented 5 years ago

@alexellis I'm still working in my local copy. As it seems there is more work to do than just adding the availableReplicas property in the function list response. There are new endpoints (most important the update endpoint) that I'm currently implementing. I have a working version locally build with my own docker hub image as my top priority was to make it work with 0.8.3 in our customer project. After that I will try to find the time to contribute the changes back.

alexellis commented 5 years ago

Our early version update for Swarm was delete/create, it may help you get that endpoint in place sooner, but it shouldn't be permanent.

Let me know when you have a PR ready and I'll try to get the community together to review it?

Alex