-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement Google Functions Framework #132
Comments
While CloudEvents handler support may take some effort since we need to have some sort of CloudEvents SDK for Scala, supporting HTTP would be the first step? |
@tanishiking I think we already support HTTP. As far as I can tell there is nothing special about it, it is just ordinary HTTP. So you can make an HTTP application with http4s Ember server and deploy it to Google Cloud Run. |
@armanbilge Great, thanks! I gonna play around with GCP stuffs with Scala Native when I have time, since most of GCP APIs are well defined with gRPC (or OpenAPI) https://github.com/googleapis/googleapis.github.io/ and I remember you mentioned there exists pure Scala gRPC client davenverse/http4s-grpc on Discord 👍 https://discord.com/channels/632150470000902164/635668881951686686/1152248482992762932 |
Oh, it's already generated https://davenverse.github.io/googleapis-http4s/ 😃 |
https://github.com/GoogleCloudPlatform/functions-framework#functions-framework-contract
This is lower-level than Cloud Functions, which enables us to implement concurrency, and thus achieve better efficiency than non-concurrent serverless options like Lambda.
Note that these frameworks are containerized and deployed to e.g. Cloud Run. This is different from FaaS, where you typically upload an npm package or a jar.
These tips for running Java in Cloud Run (and only Java!) suggest that Node.js is still an ideal runtime even for the framework setup:
https://cloud.google.com/run/docs/tips/java
There's also a testkit:
https://github.com/GoogleCloudPlatform/functions-framework-conformance
Finally, none of this is specific to Google Cloud per se: it works with ordinary HTTP events and platform-agnostic CloudEvents and is deployable to kubernetes/knative ... although, not sure how widely adopted these are outside of Google (AWS does not support CloudEvents, cloudevents/spec#435).
This also makes testing locally much easier, since it does not rely on emulators of serverless environments.
The text was updated successfully, but these errors were encountered: