Slide 1

Slide 1 text

Use Docker with Cloud Run Yevgen Batovskyi [email protected] @batovsky meetup co-organizer

Slide 2

Slide 2 text

Yesterday

Slide 3

Slide 3 text

Build Process Create branch, add code, tests 2 Add Dockerfile 3 Push image to registry 1

Slide 4

Slide 4 text

Ship Process Pull image 2 Check image with QA 3 Tag it 1

Slide 5

Slide 5 text

New tag triggers a Release 2 Pass any Pre-Deployment Conditions 3 Deploy to environment 1 4 Pass any Post-Deployment Conditions Run Process

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Demo time

Slide 8

Slide 8 text

git clone https://github.com/mfahlandt/gcp-continuous-deployment-node-demo gcloud config get-value project gcloud builds submit --tag gcr.io/[PROJECT_ID]/mario-image . gcloud auth configure-docker gcloud beta run deploy demo-app --image gcr.io/[PROJECT_ID]/mario-image --region us-central1 --platform managed --memory 1Gi --allow-unauthenticated --quiet gcloud run services update SERVICE-NAME --update-labels KEY=VALUE go get -v github.com/rakyll/hey hey -n 100 -c 10 URLs Scenario • https://cloud.google.com/profiler/ • https://cloud.google.com/monitoring/ • https://cloud.google.com/logging/

Slide 9

Slide 9 text

Today

Slide 10

Slide 10 text

GCP Free Tier? Cloud shell • Cloud shell UX survey

Slide 11

Slide 11 text

http://cloud.run

Slide 12

Slide 12 text

Operational Model Programming Model No Infra Management Managed Security Pay only for usage Service-based Event-driven Open

Slide 13

Slide 13 text

Runs in your GKE cluster Provisioned resources Kubernetes operations Custom machine types Hardware accelerators (GPUs) Fully managed, no cluster Pay-per-use Minimal operations Limited instance size Autoscaling Stackdriver UI & CLI Custom URLs TLS Cloud Run Cloud Run on GKE

Slide 14

Slide 14 text

● Common API and runtime environment for serving workloads ● Implements learnings from Google and over 50 companies contributing ● Portability of experiences, tooling, and workloads between Knative environments - you can even run serverless on-prem https://knative.dev Portability based on kNative • https://deployeveryday.com/2020/03/31/running-knative-locally.html

Slide 15

Slide 15 text

● stateless ● 64bit linux containers ● max timeout is 15 minutes ● 4 minutes to first http response timeout ● 2GB max RAM (min 256 MB) ● 2GB max filesystem size ● 32MB max response/request size ● 80 concurrent requests ● one $PORT supported ● min cold start time is near 4 seconds ● asia-east1 (Taiwan) ● asia-northeast1 (Tokyo) ● europe-north1 (Finland) ● europe-west1 (Belgium) ● europe-west4 (Netherlands) ● us-central1 (Iowa) ● us-east1 (South Carolina) ● us-east4 (Northern Virginia) ● us-west1 (Oregon) • https://cloud.google.com/run/docs/issues • https://cloud.google.com/run/docs/release-notes Known limitations

Slide 16

Slide 16 text

• https://cloud.google.com/run/docs/reference/container-contract • https://cloud.google.com/run/docs/issues

Slide 17

Slide 17 text

• https://cloud.google.com/run/docs/about-concurrency Concurrency

Slide 18

Slide 18 text

Billable time • https://cloud.google.com/products/calculator • https://cloud.google.com/run/pricing

Slide 19

Slide 19 text

Pricing details • https://cloud.google.com/products/calculator • https://cloud.google.com/run/pricing

Slide 20

Slide 20 text

Where to store data • https://cloud.google.com/run/docs/issues

Slide 21

Slide 21 text

● No servers to manage ● Focus on writing code ● Scale up fast and scale to zero ● Control over max instances ● All GCP troubleshooting tools ● Pay for exact usage ● HTTPS URL in seconds ● Own domains ● Labels support ● Terraform support Takeaways • https://cloud.google.com/profiler/ • https://cloud.google.com/monitoring/ • https://cloud.google.com/logging/

Slide 22

Slide 22 text

Tomorrow

Slide 23

Slide 23 text

CloudRun button 12 factor

Slide 24

Slide 24 text

VSCode remote https://code.visualstudio.com/docs/remote/containers https://code.visualstudio.com/docs/remote/containers-advanced

Slide 25

Slide 25 text

docker hands-on https://training.play-with-docker.com https://portal.cloudskills.io/docker-jumpstart https://hub.docker.com/search?q=&type=image&image_filter=official

Slide 26

Slide 26 text

docker-compose hands-on https://www.compose-spec.io/ https://cloud.google.com/community/tutorials/cloud-run-local-dev-docker-compose https://github.com/docker/awesome-compose/

Slide 27

Slide 27 text

More information Cloud Run FAQ google-cloud- run

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Grow your skills at home

Slide 30

Slide 30 text

Thank you! #safety-tips