Deploying to
AppEngine
⇒ Whoami
Alex Hayorov @hayorov
We
Cats
vs
Dogs
voting
Choose Get the results
Our applicationArchitecture
• Multiplatform design
https://github.com/hayorov/example-voting-app
• Dockerized
• Hosted in Docker VM
Our applicationVoting-app
GET /
voting-appPOST /
vote: a
rpush
voter_id, vote
•Flask (python 2.7-alpine)
•Gunicorn
•Redis (TCP)
New project on cloud.google.com
Install Google Cloud Platform SDK (gcloud)
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
script: app.app
- url: /static
static_dir: static
Create app.yaml file
⇒ gcloud app deploy --project catsdogsvote
You 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
Collecting Flask (from -r requirements.txt (line 1))
Using cached Flask-0.11.1.tar.gz
…
Running setup.py install for Flask ... done
Running setup.py install for Redis ... done
Running 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
Choose Get the results
powered by AppEngine
rps-instances/time
t, secs
rps
1k
100
Count: 321612
Load: line(1, 1000, 10m) const(100, 5m)
HTTP codes
Count Percent
200 - OK 65.2% (430490)
500 - Error 32.2% (212734)
??? - Error 2.6% (17306)
workload
300 600
created instances
183
Response time distribution
time, s quantile
12000 100
5000 87
1000 71
500 63
350 41
150 4
Deploying to AppEngine
Deploying to AppEngine
Deploying to AppEngine

Deploying to AppEngine

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
    Our applicationArchitecture • Multiplatformdesign https://github.com/hayorov/example-voting-app • Dockerized • Hosted in Docker VM
  • 6.
    Our applicationVoting-app GET / voting-appPOST/ vote: a rpush voter_id, vote •Flask (python 2.7-alpine) •Gunicorn •Redis (TCP)
  • 7.
    New project oncloud.google.com Install Google Cloud Platform SDK (gcloud) runtime: python27 api_version: 1 threadsafe: true handlers: - url: / script: app.app - url: /static static_dir: static Create app.yaml file
  • 8.
    ⇒ gcloud appdeploy --project catsdogsvote You 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
  • 10.
    Collecting Flask (from-r requirements.txt (line 1)) Using cached Flask-0.11.1.tar.gz … Running setup.py install for Flask ... done Running setup.py install for Redis ... done Running 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
  • 11.
    Choose Get theresults powered by AppEngine
  • 12.
    rps-instances/time t, secs rps 1k 100 Count: 321612 Load:line(1, 1000, 10m) const(100, 5m) HTTP codes Count Percent 200 - OK 65.2% (430490) 500 - Error 32.2% (212734) ??? - Error 2.6% (17306) workload 300 600 created instances 183 Response time distribution time, s quantile 12000 100 5000 87 1000 71 500 63 350 41 150 4