0% found this document useful (0 votes)
73 views45 pages

Choosing Compute Options

This document discusses various options for running applications on Google Cloud Platform (GCP), including Cloud Functions, App Engine, Cloud Run, Google Kubernetes Engine (GKE), and Compute Engine. Each option has different strengths that make it a good fit for certain types of applications and technical requirements. The best choice also depends on factors like the project stage, team structure, and preferences around billing models and resource management.

Uploaded by

Teddi Zulkarnaen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views45 pages

Choosing Compute Options

This document discusses various options for running applications on Google Cloud Platform (GCP), including Cloud Functions, App Engine, Cloud Run, Google Kubernetes Engine (GKE), and Compute Engine. Each option has different strengths that make it a good fit for certain types of applications and technical requirements. The best choice also depends on factors like the project stage, team structure, and preferences around billing models and resource management.

Uploaded by

Teddi Zulkarnaen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Choosing Compute

Options in GCP
Where to run your application

Imre Nagi
Cloud Platform Engineer, Gojek
Cloud Google Developer Expert
@imrenagi
https://imrenagi.com
Credits to:
Brian Dorsey - Where Should I Run My Stuff? Choosing Compute Options
Where I should run my application?
It depends..
Web & mobile backends

Event driven

Your code
Web applications

events/web + containers

Your container
Containerized applications

Existing systems
Too much options?
Cloud Functions

Your simplest serverless friend..


What is Cloud Functions?
A serverless environment to build and connect cloud services

Event driven - connect Cloud services


● Via: Cloud Pub/Sub, Cloud Storage, HTTP requests & more

Serverless
● Fully managed execution environment
● Pay only for what you use
● Autoscales with usage
What do you think about?
Events

Function definitions
Demo
App Engine

Google Cloud Platform as a Service


What is App Engine
App Engine goal: let developers focus on app code,

No servers to manage, scale up fast, scale down to zero

No patches/updates

Versioning

Traffic splitting

“Serverless” before it was cool ;)


What do you think about?
Code

HTTP Request

Versions
Good fit? Constraints?
Good fit Constraints

HTTP/s request-response Standard


Stateless serving applications ● Runtimes for Python, Java, PHP,
Scaling to high traffic Go, Node
● HTTP/s only
Cloud Run

Serverless for your containerized apps


What is Container
A standardized packaging for software and dependencies
Works for all major Linux distributions

Lightweight
Isolated
Easily deployable
Composable

A fundamentally different way of managing applications


What is Cloud Run?
Input: container image with code listening on $PORT for HTTP

SSL termination

HTTP requests to running containers

1-80 concurrent requests, configurable

Autoscaling from zero to 1000s of instances

Pay only for actual CPU & memory used @ 100ms granularity
What do you think about?
Code in a container image

Building the image

Container contract:

Listen for HTTP requests on $PORT

Stateless: no persisted local state


Demo
Good fit? Constraints?
Good fit Constraints

Stateless Must use containers


Decide on build process (Cloud
HTTP request-response workloads
Build, etc
Scale: way up, down to zero, bursty

Specific runtime requirements:

language, dependencies, etc


Google Kubernetes
Engine
Managed Container orchestrators
Kubernetes
de facto platform
for running containers
What is Kubernetes Engine?
Hosted and managed Kubernetes

Manages the cluster

● compute nodes
● software updates
● cluster autoscaling
What do you think about?
Logical infrastructure

Applications, not computers or containers

● What programs?
● How are they connected?
● Where do they store state?
Demo
Good fit? Constraints?
Good fit Constraints

● Run app in multiple environments Must use containers


multi-cloud, hybrid, dev/test/prod Some architectural constraints
● Take full advantage of containers
● Have good team communication
between dev, ops, security, etc.
● Have or want CI/CD pipeline
● Network protocols beyond HTTP/S
Why Kubernetes & GKE?
Kubernetes Kubernetes Engine

Insulate from infrastructure Managed cluster


Enables high utilization ● Focus on your applications
== cost savings ● Quick start
Abstraction sweet spot for many ● Automatic updates
Choose tools for logging,
monitoring...
Compute Engine

Virtual Machines at hand


What is Compute Engine?
Virtual machines and networking

Per VM max:
● 224 vCPUs, 1,792 GB of RAM, 64 TB of disk, 8 GPUs, TPUs
○ Independently configurable, including disk!

● Specialized machine types:


○ up to 416 vCPU and 12TB RAM

○ Shared core small machines


What is Compute Engine?
Virtual machines and networking

Start quickly, ~20 seconds to user code running

Pre-built images, or create your own

● Debian, CentOS, CoreOS, Ubuntu, RHEL, SUSE

● Windows Server Datacenter: 2008, 2012 R2, 2016 , 2019,


Disk
Persistent Disk
● Network based
● Configure size (to 64 TB)
● Disk or SSD
● Independent of VM
● Global Snapshots
● Multi-VM RO mount
● Larger disks == more throughput

Local SSD
● Lowest latency
● 375 GB per disk (up to 8)
● Tied to VM lifecycle
What do you think about?
Your software

Operating system / disk images

CPU, RAM, Disk

Networking - Firewall, Load balancers, VPNs


Demo
Good fit? Constraints?
Good fit Constraints

Existing systems (lift and shift) Scaling speed floor


1:1 container:VM mapping ~20s per VM, 1000s in ~60s
Specific OS / kernel required Decide how to handle software
License requirements updates
Running databases
Network protocols beyond HTTP/S
Where I should run my application?
Event driven

Your code
Web applications

events/web + containers

Your container
Containerized applications

Existing systems
Found a good fit already?
Abstraction Technical Team &
level Requirements Organization
Events
Abstraction Function definitions

Code
HTTP Requests

Container Runtime Contract


Any language, HTTP requests

Applications, not computers or containers


What programs? How are they connected? State?

Your software, operating system / disk images


CPU, RAM, Disk
Networking: Firewall rules, Load balancers, VPNs
Requirements
App: URL routing, code sharing, traffic splitting

Support any programming language, run in


containers

GPUs, TPUs, Hybrid, need specific OS,


network protocols beyond HTTP/S

GPUs, TPUs, need specific kernel, Windows,


licensing requirements, migrating existing
systems
Usage
Billing Model
Usage

Usage / Resources

Resources

Resources
Team is mostly dev focused

Team is mostly dev focused


Teams

Team is mostly dev focused


Owns build tool and deployment decisions
Team integration: Dev, Ops, Security work
together; org is open to app architecture
updates

Adaptable to various team structures and


tool preferences
Project stage

New project

Existing /
Migration
Credits to:
Brian Dorsey - Where Should I Run My Stuff? Choosing Compute Options
Thanks!

You might also like