Skip to content

Comment on Cloud Run Button: Click-to-deploy your Git repos to GCP

Comments

I'm about to launch a new website and would like to start using AWS or GCP. Between Fargate and Cloud Run, which one would you recommend? (It's a simple React + Django + Postgres + Redis project) Thanks!

I personally make heavy use of classic App Engine tbh, the experience is pretty similar to Cloud Run but it's much more of a mature platform (if you can deal with the downsides).

AppEngine is great!

Plus, I just finished making an auto deploy to AppEngine Workflow with GitHub Actions last night, so I can just push and auto deploy if all tests pass!

If its open source - could you please point it.

https://gist.github.com/ZeroCool2u/c818f89906c9b46d28cb7de85...

The project I created it for isn't public yet, but I made a gist that provides an example workflow and the steps required to make it work.

If anyone happens upon this and finds it useful, I've created a public repository that demonstrates how to auto deploy if unit tests pass: https://github.com/ZeroCool2u/Python-Deploy-To-Google-App-En...

Thank you

Absolutely, happy to help!

I used App Engine years ago, but didn't even consider it nowadays exactly because it's mature and I fear Google might sunset it soon. Will have a look now, thanks!

App Engine is still GA and is still having features added.

Disclaimer: I work on both Cloud Run and App Engine at Google.

Again false perception issues, GCP is not Google consumer product. GCP rarely sunsets products already in GA (for now).

Cloud Run is great if you don't need something that's always on (e.g. websockets). For the Postgres part you still need Cloud SQL. It is also much simpler compared to Fargate (perceptually, haven't actually tried Fargate nor would want to, happy GCP user)

Thanks, it's a simple CRUD with a couple of cronjobs.

Yes, good point. It can do cron jobs with the help of Cloud Scheduler and PubSub

Cloud Run is not for hosting websites (edit: in most cases, see reply below), it's for bespoke API commands with a bit more flexibility than Lambda/Cloud Functions due to greater environmental control.

Cloud Run is a perfectly reasonable choice for hosting websites -- it's a serverless HTTP platform that uses containers as the base packaging and runtime infrastructure.

Unlike something like Fargate, it supports automatic scaling of containers based on requests, so it will run zero containers if you get no traffic, and 100 containers if you get (for example) 1500 requests per sec. The fully-managed version has a pay-per-100ms of execution model, while the GKE-hosted version uses an existing GKE cluster you provide.

It's stateless, which won't allow many user authentication/CRUD workflows, although recently they added integration with Cloud SQL which is interesting.

Don't think you could use Django on Cloud Run without issues, though, particularly with how it handles Sessions.

I disagree.

If you're doing any modern architecture with microservices using containers, you're primarily doing stateless things (even if it's your web frontend) and pushing the state off to somewhere like Redis/memcached/database.

You basically implied that web frontends don't run in a load-balanced multi-replica set up, which is not true.

Similarly from what you said one might think people don't deploy web frontends to Kubernetes (where containers come and go all the time as they're ephemeral, due to events like crashes, autoscaling), which is also not true.

If you’re writing anything that scales (i.e. has multiple replicas), then you actually store any significant state wrt logins/sessions on your app and you push it out to an external storage. Most web frameworks offer libraries or middleware that let you persist this "state" in external storage.

As a Cloud Run user myself, I suggest adding examples for that use case explicitly in the Cloud Run docs, as those workflows for Cloud Run specifically are harder to mental-model than say Kubernetes orchestration.

It's stateless, but it can connect to stateful services just fine to power things like authentication/CRUD. If the stateful services are also serverless, you can get a completely scalable, stateful system that scales to zero.

We use it in conjunction with Google PubSub and Cloud Storage to evaluate ML models in production and are really happy with it.

Hmm, that might be crazy enough to work.

actually you can run django on cloud run without issues. cloud run is basically gvisor+docker (which can be run on GKE or on google managed servers) its basically built with knative.. btw. even the new appengine can run django. (you can't run background stuff or you shouldn't)

Hi, thanks for the clarification, I'll give it a try then!

I read somewhere that it was comparable to Fargate and got confused. Thanks for clarifying it!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.