Skip to content
0:00 / 0:00

#googlecloudrun#dotnet#docker

Are Serverless Container Runtimes The Way?

Charles Chen

546 subscribers • 3 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Charles Chen
  • Linked in the descriptionCharlieDigital/gcr-dn6-api
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

1.7K views4 years ago1 recommendation

Cloud and DevOpsWeb developmentGoogle CloudDocker and containersServerless

Charles Chen discusses the benefits of serverless container runtimes like Google Cloud Run for hosting low-cost .NET APIs.

Hacker News thread: news.ycombinator.com/item?id=33202453 Karl Sutt's article: karlsutt.com/articles/you-should-not-be-using-aws/ GitHub Repo: github.com/CharlieDigital/gcr-dn6-api Detailed walkthrough: youtu.be/ysXVta8_JWs

Why it's here

1 person recommends this

What people say. Highly recommended as a quick guide to cost-effective hosting of .NET APIs using Google Cloud Run.

Moments people linked to

u/c-digsin r/dotnet • Recommends

On “Most affordable but good hosting?”

…ency of 20 would consme 10,000 vCPU seconds and 10,000 GiB-seconds of memory on a 1 vCPU, 1 GiB instance. It's trivially easy to deploy if you can put together a `Dockerfile`. I have two small repos here: - https://github.com/CharlieDigital/gcr-dn6-api - https://github.com/CharlieDigital/playwright-scrape-api And two videos: - Short version: link to this video - Long version: link to this video…

u/c-digsin r/dotnet • Recommends

On “What's a cost-efficient service you use for hosting?”

Google Cloud Run. It's super easy to build a container and then launch it in Google Cloud Run. Set it to scale to 0 and it's free because of the generous monthly grants. Short video showing how to get a .NET web API containerized and launched into Google Cloud Run: link to this video Azure also has an alternative called Container Apps that also scales to 0 (so it's functionally free for small projects). It's super easy to get this up and running and I think it's the best way to host anything that doesn't require an "always on" background service.

u/c-digsin r/dotnet • Recommends

On “As .NET tech stack teams, if you use a cloud service, which provider does (or will) your company use - AWS, Azure, or others?”

I run a ton of side projects on GCP and if not for keeping some Cloud Functions warm, it would cost me pennies per month. Cloud run and Cloud Run Jobs both have very generous monthly grants that are impossible for most small projects to use up. Short video for folks on the fence about Google Cloud Run and .NET: link to this video

u/c-digsin r/dotnet • Recommends

On “Why Is It So Hard To Find Modern ASP.NET Hosting?”

**Google Cloud Run.** The best option for weekend hackers, startups, small projects. - Scales to 0. - Free until you get any actual volume (a few million requests per month free and several hours worth of compute (but keep in mind, it auto-scales down to 0 when not in use so the free limit goes a looooong way)) - $0.40/mo. assuming 50ms requests @100,000 requests/day (3 million reqeusts/mo.) - So easy to integrate with GitHub - Easy to add a custom domain - Slap a standard `Dockerfile` into your project - SSL: automatic and free 7 minute walkthrough including SSL+custom domain: link to this video (With narration: link to this video Repo: https://github.com/CharlieDigital/gcr-dn6-api

u/c-digsin r/dotnet • Recommends

On “Questions about making a FaaS web app”

…Practically, you won't be paying unless this service really takes off. If you need to run periodic jobs while scaling to 0, set up Google Cloud Scheduler to periodically invoke your service (e.g. run a nightly sync job). This approach is nominally free (fractions of a penny to host the container images). Short video here showing it in action: link to this video (full walkthrough here: link to this video **Multiple APIS**. Don't over think it for now; just make the separate API calls and aggregate the results in your own code. Dont' overcomplicate it from the get go. The secret to weekend and side projects is to keep it as simple as possible so it's easy to jump back in and work on it. The more complicat…

u/c-digsin r/dotnet • Recommends

On “Most affordable but good hosting?”

Yes. The SSL is "free". Cloud Run will assign an `https` URL to the public endpoint and map it to the container exposed HTTP port. You can then map a custom domain. See this end-to-end (only 7 minutes; you can easily fast forward): link to this video

u/c-digsin r/dotnet • Recommends

On “What are the best hosting solutions for hobbyist ASPNET projects?”

Google Cloud Run. I have an example here: https://github.com/CharlieDigital/playwright-scrape-api How to deploy into it via source: gcloud run deploy $gcloud_svc \ --source=. \ --allow-unauthenticated \ --port=8080 \ --min-instances=0 \ --max-instances=1 \ --cpu-boost \ --memory=1Gi Assuming a `Dockerfile` is present. This will push up the source, build the container, deploy the new container instance, and manage traffic routing as well. It's super simple and for all intents and purposes free for hobbyists. Short video showing how easy/quick it is: link to this video

u/c-digsin r/dotnet • Recommends

From Zero to Cloud API in 7 Minutes with dotnet on Google Cloud Run

u/c-digsin r/dotnet • Mentions

On “Why are more people on YouTube using Vs Code for .NET?”

I write software for a living. In the past two years, I've worked at 4 startups. $100m series C, $23m series B, $13m series A, $8m seed. Every single one used Mac. The team that was .NET backend did end up using Rider, but some folks stayed on VSC. VSC is all I need. Rider is great for refactoring and it has better language analyzer support, but by no means was it necessary When I make YT videos (e.g. link to this video I use VSC because it's more accessible and consistent across all platforms. There's nothing special about VS for backend work.

u/c-digsin r/dotnet • Mentions

On “Why Is It So Hard To Find Modern ASP.NET Hosting?”

Yeah, I figured you might have used it before this released. But as of September, it's pretty much point-and-click. If you start here: link to this video You can see that it's super simple to use now. The only downside is that it takes Google a really long time to create and assign the cert (much longer than AWS, for example).
2View on Reddit

u/c-digsin r/dotnet • Mentions

On “Why Is It So Hard To Find Modern ASP.NET Hosting?”

[.NET Web API from scratch to containerized application in Google Cloud in 7 minutes] Repo here: https://github.com/CharlieDigital/gcr-dn6-api

u/c-digsin r/dotnet • Mentions

On “Why isn’t dotnet core popular among startups?”

Give .NET minimal web APIs a spin. A short video showing how easy it is to go from command line to Google Cloud deployed API in minutes: link to this video

u/c-digsin r/dotnet • Mentions

On “I need to host my React.js frontend and ASP.NET Core API on an affordable hosting provider suitable for low traffic”

Cloud Run is just a Docker container with port 8080 mapped. You can write full .NET apps, move to AWS, or run in Azure Container Apps. The free monthly grant is quite hefty. Short video here showing how easy it is: link to this video