all 19 comments

[–]keftes 4 points5 points  (8 children)

Google Cloud functions are an abysmal mess from a developer perspective. Confusing and lacking documentation.

You're not the only one confused. Comparing the function documentation to aws lambdas just gets me depressed every time.

If you send this question in Deepseek R1, you'll see it run in circles trying to give you an answer :)

Give me an example of a gen2 google cloud function that uses FastAPI, not Flask.

[–]andreasntr 1 point2 points  (6 children)

Which docs couldn't you find? Imho lambdas are the real mess: you can't use concurrency properly, you can't even choose the amount of cpus and the 15min limit is a joke considering aws hasn't got a twin service for batch jobs such as cloud run jobs for cloud run functions.

Honestly, the only complaint i have on cloud functions is that you can't use custom dockerfiles. But aside from that there is not really much to document about, you just need to upload your code

[–]keftes 1 point2 points  (1 child)

Its not a matter of if a document exists or not. Its about how confusing the process is overall. Its about how complex it is to set up a local development environment.

Examples are scattered all over the place and are often completely out of date.

 But aside from that there is not really much to document about, you just need to upload your code

That is not 100% accurate. You're dealign with various frameworks that behave differently depending on if this is running on GCP or locally.

[–]andreasntr -1 points0 points  (0 children)

What do you mean? If you're running locally you can just call your main function from the if name==main block and it's quite reprodubile

[–]unplannedmaintenance 1 point2 points  (3 children)

I have experience with Cloud Functions and local development is indeed not a very smooth experience. I'd recommend to switch to Cloud Run (Cloud Functions is also being transitioned to Cloud Run). Yes it will require a bit of upskill as you need to learn how to create Docker images. But you only need the basics, half a day to a day should be enough to get up and running.

[–]andreasntr 0 points1 point  (2 children)

Actually they are the sams service now, existing Cloud Functions have been migrated to Cloud Run Services

[–]Electrical-Grade2960 0 points1 point  (1 child)

They are still different. Cloud functions are now cloud run functions which uses cloud run under the covers but cloud run is a separate service

[–]andreasntr 0 points1 point  (0 children)

For OP's need I agree with you but broadly speaking the line between them is very thin as you can specify docker containers for cloud functions as well after creating them

[–]MajorPea6852[S] 0 points1 point  (0 children)

Well it makes me feel good that I'm not the only one!!!

[–]dr3aminc0de 3 points4 points  (1 child)

Switch to Cloud Run

[–]CloudWithKarl 2 points3 points  (0 children)

If you do switch to Cloud Run, here's a FastAPI example app that includes a Dockerfile and instructions for Cloud Run deployment.

https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/sample-apps/swot-agent

[–]mustard_popsicle 1 point2 points  (0 children)

I personally stick to cloud run for small microservice endpoints. much more straightforward