Top Banner
Deploying to AppEngine
15

Deploying to AppEngine

Feb 10, 2017

Download

Engineering

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Deploying to AppEngine

Deploying toAppEngine

Page 2: Deploying to AppEngine

⇒Whoami Alex Hayorov @hayorov

We

Page 3: Deploying to AppEngine

Catsvs

Dogsvoting

Page 4: Deploying to AppEngine

Choose Get the results

Page 5: Deploying to AppEngine

Our applicationArchitecture

• Multiplatform design

https://github.com/hayorov/example-voting-app

• Dockerized

• Hosted in Docker VM

Page 6: Deploying to AppEngine

Our applicationVoting-app

GET /

voting-appPOST /vote: a

rpushvoter_id, vote

•Flask (python 2.7-alpine)•Gunicorn•Redis (TCP)

Page 7: Deploying to AppEngine

New project on cloud.google.com

Install Google Cloud Platform SDK (gcloud)

runtime: python27api_version: 1threadsafe: true

handlers:- url: /

script: app.app

- url: /staticstatic_dir: static

Create app.yaml file

Page 8: Deploying to AppEngine

⇒ gcloud app deploy --project catsdogsvoteYou are about to deploy the following services:- catsdogsvote/default/20161120t203231 (from [example-voting-app/vote/app.yaml])

Deploying to URL: [https://catsdogsvote.appspot.com]

Beginning deployment of service [default]...File upload done.Updating service [default]...done.Deployed service [default] to [https://catsdogsvote.appspot.com]

goto https://catsdogsvote.appspot.com

Page 9: Deploying to AppEngine
Page 10: Deploying to AppEngine

Collecting Flask (from -r requirements.txt (line 1))Using cached Flask-0.11.1.tar.gz…Running setup.py install for Flask ... doneRunning setup.py install for Redis ... doneRunning setup.py install for gunicorn ... done

Successfully installed Flask Jinja2-2.8 MarkupSafe-0.23 Redis Werkzeug click gunicorn itsdangerous-0.24

⇒ virtualenv ./env && pip install -r requirements.txt #fixme

Create appengine_config.py

from google.appengine.ext import vendor

vendor.add('env/lib/python2.7/site-packages')

⇒ gcloud app deploy --project catsdogsvote

Page 11: Deploying to AppEngine

Choose Get the results

powered by AppEngine

Page 12: Deploying to AppEngine

rps-instances/time

t, secs

rps1k

100

Count: 321612Load: line(1, 1000, 10m) const(100, 5m)

HTTP codesCount Percent200 - OK 65.2% (430490)500 - Error 32.2% (212734)??? - Error 2.6% (17306)

workload300 600

created instances

183

Response time distributiontime, s quantile12000 1005000 871000 71500 63350 41150 4

Page 13: Deploying to AppEngine
Page 14: Deploying to AppEngine
Page 15: Deploying to AppEngine