-
Notifications
You must be signed in to change notification settings - Fork 119
Add example of developing multiple functions locally #99
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good skaffold example.
I'm going to approve but ask that we specifically don't suggest that this solves the multiple functions on a single port issue. This example is an opinionated way to achieve that but requires many dependencies that an existing Functions user is likely not going to want in their application.
examples/skaffold/README.md
Outdated
@@ -0,0 +1,138 @@ | |||
# Multiple Cloud Functions, Same Host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The H1 here and example content are not exactly what I would imagine.
Similar to #98 (comment), I wouldn't expect that the minimum requirement to run multiple functions on the same host involves Kubernetes/minikube
/skaffold
. I'd expect a lighter weight setup, like how the FF is very lightweight – maybe require 1 dependency like Docker.
That said, can we change this example / PR title to something more aligned to the content, like "Developing Multiple Functions using Minikube and Skaffold"
examples/skaffold/README.md
Outdated
|
||
## Introduction | ||
|
||
This example shows you how to deploy multiple Cloud Functions to a single host. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example shows how to develop multiple functions on a Kubernetes cluster with a single host.
- We're not using the Cloud Functions product anymore (FF's can be deployed to many environments).
- This seems like an opinionated way for a multiple function, single host app. Let's label that, as we may want a simpler multiple function, single host app in a different example.
Hi all, Just want to provide some insights on our in-house solution to enable supporting multiple functions on the same
Those two requests would both be executed by the Now we are invoking the functions-framework like this: functions-framework --target dispatcher --port 8081 --debug The def dispatcher(request):
path = request.path
path = path[1:] # Remove prefix / from path
# Introspect all methods for potential execution
potential_methods = globals().copy()
potential_methods.update(locals())
# Try to acquire corresponding method associated to the URL path
method = potential_methods.get(path)
if not method:
raise NotImplementedError("URL Path %s not implemented" % path)
return method(request) |
Fixes #98.