I'm building an API and I need help understanding whether I need Cloud Run, or Cloud Run Functions. I guess they're not the same service...?
Right now, I created a Node.js project, and ran:
gcloud run deploy my-function \
--source . \
--allow-unauthenticated \
--region us-central1
But I'm not sure what it creates... a Cloud Run function, or a Cloud Run Function function (?).
I'm really confused, so I'd appreciate any help!
Solved! Go to Solution.
Hi @CastAsHuman,
Welcome to the Google Cloud community!
You're absolutely right that Cloud Run and Cloud Run Functions are not the same service. I'll help clarify the difference and explain what you've created based on your deployment command.
Cloud Run vs Cloud Run Functions
The command you deploy is a Cloud Run service (not Cloud Run Functions) using your Node.js code. The --source
. points to the directory of your Node.js project, meaning you're deploying from source code (which is typical for Cloud Run). The gcloud run deploy command you're running deploys a Cloud Run service, which means it's deploying a containerized app (or code that will be containerized automatically). It's not deploying a Cloud Run Function.
To summarize, if you're looking to deploy simple functions without worrying about containers, you should consider Cloud Run Functions. If you want to deploy full containerized apps (with more control over the runtime environment), use Cloud Run.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi @CastAsHuman,
Welcome to the Google Cloud community!
You're absolutely right that Cloud Run and Cloud Run Functions are not the same service. I'll help clarify the difference and explain what you've created based on your deployment command.
Cloud Run vs Cloud Run Functions
The command you deploy is a Cloud Run service (not Cloud Run Functions) using your Node.js code. The --source
. points to the directory of your Node.js project, meaning you're deploying from source code (which is typical for Cloud Run). The gcloud run deploy command you're running deploys a Cloud Run service, which means it's deploying a containerized app (or code that will be containerized automatically). It's not deploying a Cloud Run Function.
To summarize, if you're looking to deploy simple functions without worrying about containers, you should consider Cloud Run Functions. If you want to deploy full containerized apps (with more control over the runtime environment), use Cloud Run.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi! Yes, they aren't the same service. They have a slightly different abstraction level.
Cloud Run - A service that operates with images to deploy the applications
Cloud Run Functions - Has a higher abstraction level and we deploy to Cloud Run Functions with the actual code.
In your command, you call gcloud run (Cloud Run), but apparently you should use gcloud function (Cloud Run Functions) because you specify your current folder as a source.
Here's the guide how to do it:
https://cloud.google.com/functions/docs/deploy