1 of 34

You build it, Google runs it (serverlessly) in containers

1

Geshan Manandhar

Sr. Software Engineer @ Simply Wall St.

2 of 34

Hello!

I am Geshan Manandhar

  • Sr. Software Engineer @ Simply Wall St.
  • GDE for GCP since 2019, Docker Captain 2024

2

  • GDG Cloud Sydney Co-organizer
  • Using Docker/containers since 2014
  • Dabbled with K8s since 2015

LinkedIn profile ☝️

3 of 34

I work for Simply Wall St.

3

Make confident investment decisions

4 of 34

I am from Kathmandu, Nepal

4

5 of 34

Agenda

  • Google's infrastructure is built to handle billions of users
  • Containers/Docker and why use it
  • Serverless and reasons to use it
  • Containers without Kubernetes (and serverless)
  • Google’s container runner service
  • Demo
  • Conclusion

5

This slide deck ☝️

6 of 34

7 Services with more than 1 billion users

6

7 of 34

Everything at Google runs in containers

  • Containerization helps Google’s development teams move fast, deploy software efficiently, and operate at an unprecedented scale (billions of users).
  • Google uses internal cluster management system Borg (dubbed the predecessor to Kubernetes)
  • Kubernetes the de facto container orchestrator is an open-source modified version of Borg
  • The main unit of operation is containers, so what are they?

7

8 of 34

“A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.”

- Docker.com

8

9 of 34

Why use Containers/Docker?

9

Ship the whole stack with its dependencies

📚

☁️

Cloud provider agnostic (faster initialization and execution - vs VMs)

Easy to scale horizontally (better resource usage)

💻

🧑‍🏭

Developers can be productive on day 1 (quicker onboarding)

10 of 34

Docker Image to running container

10

Containers can be run serverlessly, then, what is serverless?

11 of 34

“Serverless computing is an application development and execution model that enables developers to build and run application code without provisioning or managing servers or backend infrastructure.”

- IBM

* Also important: With serverless, developers never pay for idle capacity.

11

12 of 34

There are still servers,

you don’t have to manage them.

12

13 of 34

Reasons to use Serverless

13

🏃

Quick deployments and faster time to market

Cost based on precise usage (scaleable, highly available) - No requests, no cost.

💵

Server management not necessary

14 of 34

Run Containers - no need to learn Kubernetes

14

15 of 34

Kubernetes is complicated

15

16 of 34

Cloud and containers without Kubernetes

  • Kubernetes is complicated
  • Focus on your application code and business logic, containerize the app and run it without Kubernetes (move to K8s later if needed)
  • So, you build it and someone else runs/operates it
  • Is there any option to do this?

16

17 of 34

Google runs it in containers (serverlessly)

  • Imagine Google (SREs) manage scaling for your apps
  • You specify the CPU and memory per instance and the min (0 = serverless) and max number of instances
  • Google auto-scales instances for your service
    • As per the volume of requests based on CPU + other metrics every X seconds
  • It is like having a separate K8s cluster for each service/ deployment
  • Yes a service like that exists

17

18 of 34

Google Cloud Run

  • Cloud Run is a managed compute platform that automatically scales your stateless containers.
  • Cloud Run is serverless: it abstracts away all infrastructure management, so you can focus on what matters most — building great applications.

18

19 of 34

19

20 of 34

Cloud Run advantages

20

No need to learn a new language/framework

🛠

Serverless and fully managed

(Scales up and scales to 0 when there are no requests - every 5 seconds)

🔒

HTTPs URLs and support for custom domains

21 of 34

Cloud Run advantages

21

Manage traffic (%) and concurrency per instance (tag and get a URL to any revision)

🚦

🖥

Unserverless with one simple config (min instances 1 = no cold start issues)

Cloud Run jobs, integrations, sidecar containers, health checks, cloud storage bucket as volume

GPU and Gen AI Inference

⚙️

For more follow Cloud run release notes

22 of 34

“Cloud Run eliminated the need to add another engineer because we did not need to manage infrastructure or instances—it is just ‘set and forget’.” - Nik Kyriakidis, Lead Engineer, Halfbrick Studios(The company behind the game Fruit Ninja, Jetpack Joyride, and other games)

22

23 of 34

Docker image to running container on GCP

23

GKE

Logging

Trace

Cloud SQL

Pub Sub

Storage

24 of 34

Demo

  • Repo: https://github.com/geshan/nodejs-postgres-cloud-run
  • Cloud Run button
  • Buildpack - no docker branch
    • gcloud run deploy nodejs-postgres-buildpack --project=<project-id> --region=us-central1 --max-instances=2 --allow-unauthenticated --source .
  • Check the cloudbiuld.yaml

24

25 of 34

Demo - Cloud Run Button

25

26 of 34

Demo - Deploy from source

26

27 of 34

Aussie companies using Cloud Run

27

Left heavy lifting to GCP

Using Pub/Sub and Cloud Run, Pet Circle is not only changing their operations into a much more cost-effective one, but also scaling without needing to worry...

From $24/day to $4/day

…Cloud Run could serve a wider range of requests per instance than alternative solutions—enabling the business to control scaling while maintaining high throughput

One billion rows of data

The business also uses Dataflow and Pub/Sub to process and transform data ahead of its move into BigQuery; Cloud Run to scale stateless containers while abstracting infrastructure management;...

28 of 34

Cloud Run can scale (hyper-scale)

28

Scaling Web Services

The ability to put an automatically scaling service in production with one command is very attractive.

3B log lines in a day

…within one minute, we went from running 150 - 200 container instances to over 1000…. and the infrastructure just worked

90% cost saving (enterprise)

Second largest bank in Germany with 33K employees, with profit before taxes of €3.2 billion. Reduced toil by 70%. Met rigorous security and compliance standard.

Ford (~20K software developers): 30 min video

Loreal (~90K employees): 15 min video

29 of 34

Cloud Run at a side project scale (ATJ)

29

30 of 34

Top 3 takeaways/Conclusion

30

1

Use containers

Utilize Kubernetes only when needed

2

Serverless is useful

Use serverless when it makes sense

3

Let Google handle scaling

Offload scaling problems to Google use Cloud Run

31 of 34

Thanks! Any Questions?

31

LinkedIn profile ☝️

32 of 34

References

32

33 of 34

Cloud Run users

33

34 of 34

Pictures credits

34