bringing serverless to containers with google cloud run · 2020. 7. 8. · docker, kubernetes...

20
Bringing serverless to containers with Google Cloud Run Dec 3, 2019 Zoë Omander @zoe_omander Main Omander @mainomander

Upload: others

Post on 17-Aug-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Bringing serverless to containers with Google Cloud Run

Dec 3, 2019

Zoë Omander @zoe_omander

Martin Omander @martinomander

Page 2: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Lily started the first Pet Theory clinic 12 years ago

Lily, veterinarian, Founder of Pet Theory

Page 3: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

IT growing pains...

Why can’t I change my appointment online?

Michael, client

I have to call insurance companies all the time.

Deirdre, veterinarian

I wasn’t able to send any invoices yesterday. The phone just kept ringing.

Lisa, receptionist

The appointment system is down...

Patrick, IT support

Page 4: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Ruby, Consultant

Lily, veterinarian, Founder of Pet Theory

Solid IT is a requirement for my business.

As a pilot project, let’s fix the invoice problem first.

Page 5: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

There are two paths to modern cloud systems.

Z

Page 6: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Containers:Docker, Kubernetes

Serverless:FaaS, PaaS

😀Fine-grained control.

Use any language, binary or library.Run your code in many places.

😨Setup and maintenance work.

Provision resources ahead of time.Pay for idle resources.

😀No infrastructure management.

Fully managed security.Pay only for usage.

😨App is not portable.

Can’t use any language.Can’t use any binary or library.

Page 7: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

What if we choose the wrong path?

Patrick, IT support

I have read about a new trend in cloud computing...

Ruby, Consultant

Page 8: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Serverless

Containers

Page 9: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Containers:Docker, Kubernetes

Serverless:FaaS, PaaS

😨Setup and maintenance work.

Provision resources ahead of time.Pay for idle resources.

😨App is not portable.

Can’t use any language.Can’t use any binary or library.

😀Fine-grained control.

Use any language, binary or library.Run your code in many places.

😀No infrastructure management.

Fully managed security.Pay only for usage.

Page 10: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Knativeserverless platform

Cloud Run Events/web + containers

Kubernetescontainer manager

KubernetesEngine

Containerized applications

Linuxoperating system

ComputeEngine

Open source projectRun it hosted on Google Cloud Platform Useful for

Existing, stateful applications

The big picture

Page 11: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Ruby, Consultant

Lily, veterinarian, Founder of Pet Theory

Solid IT is a requirement for my business.

As a pilot project, let’s fix the invoice problem first.

Page 12: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Good work! Let’s review the script.

Our on-prem system generates invoices as DOCX files. Lisa used to manually convert them to PDFs, but I found a Python script that does it.

Patrick, IT support Ruby, Consultant

Page 13: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

# app.py

...

cmd = "libreoffice --headless --convert-to pdf {}".format(filename).split(' ')

p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)

stdout, stderr = p.communicate()

...

Wait a minute - the Python script is using LibreOffice to create PDFs?

Patrick, IT support

You got a problem with that?

Ruby, Consultant

Page 14: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

LibreOffice

Flask web framework

app.py

gunicorn web server

Cloud Storage lib

Let’s package it up in a container.

Container

Page 15: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

pdfgen-cqwnsh3hvq-uc.a.run.app

Demo

Page 16: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Ruby, Consultant

Lily, veterinarian, Founder of Pet Theory

Excellent! My staff are asking if cloud computing is sustainable.

Let me do some research...

Z

Page 17: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Power Usage Efficiency (PUE)

Sources

First six bars: United States Data Center Energy Usage Report, www.osti.gov/servlets/purl/1372902/

Last bar: Google website, google.com/about/datacenters/efficiency/internal

Page 18: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of
Page 19: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Ruby, Consultant

Lily, veterinarian, Founder of Pet Theory

Looks like cloud computing fits with Pet Theory’s values.

I am happy that you are happy.

Page 20: Bringing serverless to containers with Google Cloud Run · 2020. 7. 8. · Docker, Kubernetes Serverless: FaaS, PaaS 😨 Setup and maintenance work. Provision resources ahead of

Knativeserverless platform

Cloud Run Events/web + containers

Kubernetescontainer manager

KubernetesEngine

Containerized applications

Linuxoperating system

ComputeEngine

Open source projectRun it hosted on Google Cloud Platform Useful for

Existing, stateful applications

The big picture