SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
Nathan Handler
nhandler@yelp.com / @nathanhandler
PaaSTA
Running Applications at Yelp
● Nathan Handler / @nathanhandler
● Site Reliability Engineer at Yelp
● Ubuntu/Debian Developer and freenode staff
● PaaSTA Developer
Who am I?
2
Yelp’s Mission
Connecting people with great
local businesses.
3
Yelp Stats
As of Q1 2016
90M 3270%102M
4
● Monolithic Python application (~3M LoC)
● Builds/deployments took a long time
○ Bottleneck on how often we can deploy
● Mistakes are painful
○ Large impact
○ Difficult to find
○ Slow to fix
History
5
● Split features into different applications
● Smaller services allowed for faster pushes
● Easier to reason about issues
● Able to scale services independently
Service Oriented Architecture v1
6
● Standalone application
● Stateless
● Separate git repository
● Typically at Yelp:
○ HTTP API
○ Python, Pyramid, uWSGI
○ virtualenv
What is a service?
7
● Statically defined list of hosts to deploy a service on
● Operations decides which hosts to deploy to
● Monitoring manually configured in Nagios
● Manual deployment system via rsync
Deploying Services v1
8
3x
2x
Does Not Scale
9
1x
3x
2x
Does Not Scale
10
1x
● Yelp's Platform as a Service
● Builds, Deploys, Connects, and Monitors services
● Glue around existing and established open source
tools
PaaSTA
11
https://github.com/yelp/paasta
#paasta on irc.freenode.net
12
PaaSTA Components
13
Docker
Registry
Developer
git push
git pull
git push
docker push
13
Marathon
Sensu
PaaSTA Components
14
Developer
git push
14
.
├── Dockerfile
├── htdocs
│ ├── index.php
│ └── status
└── Makefile
15
A simple service
DOCKER_TAG ?= $(USER)-dev
test:
@echo 'Unit testing'
itest: cook-image
paasta local-run --healthcheck --service devops
cook-image:
docker build -t $(DOCKER_TAG) .
16
$ cat Makefile
DOCKER_TAG ?= $(USER)-dev
test:
@echo 'Unit testing'
itest: cook-image
paasta local-run --healthcheck --service devops
cook-image:
docker build -t $(DOCKER_TAG) .
17
$ cat Makefile
• Containers: like lightweight VMs
• Provides a language (Dockerfile) for describing
container image
• Reproducible builds (mostly)
• Provides software flexibility
18
Docker
docker.com
FROM ubuntu:xenial
MAINTAINER Nathan Handler <nhandler@yelp.com>
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install 
apache2 
libapache2-mod-php
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
RUN rm -f /var/www/html/index.html
COPY htdocs /var/www/html/
CMD ["/usr/sbin/apache2", "-D", "FOREGROUND", "-C", "listen 8888"]
EXPOSE 8888 19
$ cat Dockerfile
✓ yelpsoa-config directory for devops found in /nail/etc/serv
✓ deploy.yaml exists for a Jenkins pipeline
✗ No 'security-check' entry was found in your deploy.yaml.
Please add a security-check entry *AFTER* the itest entry in d
so your docker image can be checked against known security vul
More info: http://servicedocs.yelpcorp.com/docs/paasta_tools/c
✗ No 'performance-check' entry was found in your deploy.yaml.
Please add a performance-check entry *AFTER* the security-chec
so your docker image can be checked for performance regression
More info: http://servicedocs.yelpcorp.com/docs/paasta_tools/c
✓ Jenkins build pipeline found
✓ Git repo found in the expected location.
✓ Found Dockerfile
✓ A Makefile is present
✓ The Makefile contains a tab character
✓ The Makefile contains a docker tag
✓ The Makefile responds to `make cook-image`
✓ The Makefile responds to `make itest`
✓ The Makefile responds to `make test`
✓ Found marathon.yaml file.
✓ All entries in deploy.yaml correspond to a marathon or chro
✓ All marathon instances have a corresponding deploy.yaml ent
✓ monitoring.yaml found for Sensu monitoring
✓ Your service uses Sensu and team 'nhandler' will get alerts
✓ Found smartstack.yaml file
✓ Instance 'demo' of your service is using smartstack port 20
balanced
✓ Successfully validated schema: marathon-nova-devc.yaml
20
$ paasta check
PaaSTA Components
21
Developer
git push
git pull
21
PaaSTA Components
22
Docker
Registry
Developer
git push
git pull
git push
docker push
22
---
pipeline:
- instancename: itest
- instancename: push-to-registry
- instancename: dev.everything
23
$ cat deploy.yaml
Jenkins Pipeline
24
paasta-nova-devc.demo-20160503T231914-deploy
paasta-nova-devc.demo-20160503T234021-stop
paasta-nova-devc.demo-20160503T234202-start
25
$ git tag
• Describe end goal, not path
• Helps us achieve fault tolerance.
"Deploy 6de16ff2 to prod"
vs.
"Commit 6de16ff2 should be running in prod"
Gas pedal vs. Cruise Control
26
Declarative control
Description: A demo PaaSTA service for OSCON 2016
External Link: http://conferences.oreilly.com/oscon/open-source-
us/public/schedule/detail/49358
Monitored By: team nhandler
Runbook: Please set a `runbook` field in your monitoring.yaml. Like "y/rb-m
Docs: https://trac.yelpcorp.com/wiki/HowToService/Monitoring/monitoring.yam
Git Repo: git@git.yelpcorp.com:services/devops
Jenkins Pipeline: https://jenkins.yelpcorp.com/view/services-devops
Deployed to the following clusters:
- nova-devc (N/A)
Smartstack endpoint(s):
- http://169.254.255.254:20973 (demo)
Dashboard(s):
- https://uchiwa.yelpcorp.com/#/events?q=devops (Sensu Alerts)
27
$ paasta info
PaaSTA Components
28
Docker
Registry
Developer
git push
git pull
git push
docker push
28
Marathon
• Mesos is an "SDK for distributed systems", not
batteries-included.
• Requires a framework
• Marathon
• Chronos for scheduled batches
• Can run many frameworks on the same cluster
• Supports Docker as task executor
29
mesosphere.io
mesos.apache.org
Scheduling: Mesos + Marathon
---
demo:
cpus: 0.1
instances: 3
mem: 500
monitoring:
alert_after: 0m
bounce_method: brutal
deploy_group: dev.everything
30
$ cat marathon-nova-devc.yaml
PaaSTA Components
31
Docker
Registry
Developer
git push
git pull
git push
docker push
31
Marathon
● Brutal: Stops old versions and starts the new
version, without regard to safety.
● Upthendown: Brings up the new version of the
service and waits until all instances are healthy
before stopping the old versions.
● Downthenup: Stops any old versions and waits for
them to die before starting the new version.
● Crossover: Starts the new version, and gradually kills
instances of the old versions as new instances
become healthy.
Bounce Strategies
32
33
34
35
36
Discovery in PaaSTA: Smartstack
mesos
slave
box2
client
nerve
HAProxy
synapse
box1
service
nerve
mesos
slave
synapse
HAProxy
ZooKeeperMetadata
HTTP request
healthcheck
37
Latency Zones
Superregion
Region
Habitat
---
demo:
advertise: [region]
discover: region
proxy_port: 20973
38
$ cat smartstack.yaml
Pipeline: https://jenkins.yelpcorp.com/view/services-devops
cluster: nova-devc
instance: demo
Git sha: 6de16ff2
State: Running - Desired state: Started
Marathon: Healthy - up with (3/3) instances. Status: Running.
Mesos: Healthy - (3/3) tasks in the TASK_RUNNING state.
Smartstack:
Name LastCheck LastChange Status
useast1-devc - Healthy - in haproxy with (3/3) total backends UP in this namespace.
39
$ paasta status
Cluster: mesosstage
Dashboards:
Marathon RO: http://marathon.paasta-mesosstage.yelp/
Smartstack: http://paasta-mesosstage.yelp:3212
Chronos RO: http://chronos.paasta-mesosstage.yelp/
Mesos: http://mesos.paasta-mesosstage.yelp
Mesos Status: OK
quorum: masters: 3 configured quorum: 2
frameworks:
framework: chronos-2.4.0 count: 1
framework: marathon count: 1
CPUs: 1.00 / 7 in use (14.29%)
Memory: 3.03 / 42.85GB in use (7.07%)
Disk: 10.00 / 153.81GB in use (6.50%)
tasks: running: 9 staging: 1 starting: 0
slaves: active: 7 inactive: 0
Marathon Status: OK
marathon apps: 5
marathon tasks: 9
marathon deployments: 0
Chronos Status: OK
Enabled chronos jobs: 1 40
$ paasta metastatus
PaaSTA Components
41
Docker
Registry
Developer
git push
git pull
git push
docker push
41
Marathon
Sensu
---
team: nhandler
page: true
notification_email: nhandler+devops@yelp.com
42
$ cat monitoring.yaml
43
PaaSTA Components
44
Docker
Registry
Developer
git push
git pull
git push
docker push
44
Marathon
Sensu
Autoscaling
45
@YelpEngineering
fb.com/YelpEngineers
engineeringblog.yelp.com
github.com/yelp
46

Weitere ähnliche Inhalte

Was ist angesagt?

Docker: the road ahead
Docker: the road aheadDocker: the road ahead
Docker: the road aheadshykes
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Nicolas De Loof
 
Using functional programming within an industrial product group: perspectives...
Using functional programming within an industrial product group: perspectives...Using functional programming within an industrial product group: perspectives...
Using functional programming within an industrial product group: perspectives...Anil Madhavapeddy
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionJérôme Petazzoni
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...Jérôme Petazzoni
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Chris Tankersley
 
Container Torture: Run any binary, in any container
Container Torture: Run any binary, in any containerContainer Torture: Run any binary, in any container
Container Torture: Run any binary, in any containerDocker, Inc.
 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real WorldTim Haak
 
Docker Online Meetup #31: Unikernels
Docker Online Meetup #31: UnikernelsDocker Online Meetup #31: Unikernels
Docker Online Meetup #31: UnikernelsDocker, Inc.
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...Ambassador Labs
 
What Have Namespaces Done for you Lately? Liz Rice, Aqua Security
What Have Namespaces Done for you Lately?  Liz Rice, Aqua SecurityWhat Have Namespaces Done for you Lately?  Liz Rice, Aqua Security
What Have Namespaces Done for you Lately? Liz Rice, Aqua SecurityDocker, Inc.
 
Docker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing MeetupDocker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing MeetupJérôme Petazzoni
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Jérôme Petazzoni
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Containerd: Building a Container Supervisor by Michael Crosby
Containerd: Building a Container Supervisor by Michael CrosbyContainerd: Building a Container Supervisor by Michael Crosby
Containerd: Building a Container Supervisor by Michael CrosbyDocker, Inc.
 
Intro to Docker - London meetup oct. 2013
Intro to Docker - London meetup oct. 2013Intro to Docker - London meetup oct. 2013
Intro to Docker - London meetup oct. 2013stevedomin
 
Leveraging the Power of containerd Events - Evan Hazlett
Leveraging the Power of containerd Events - Evan HazlettLeveraging the Power of containerd Events - Evan Hazlett
Leveraging the Power of containerd Events - Evan HazlettDocker, Inc.
 
LinuxKit Deep Dive
LinuxKit Deep DiveLinuxKit Deep Dive
LinuxKit Deep DiveDocker, Inc.
 
Docker: Testing to Production
Docker: Testing to ProductionDocker: Testing to Production
Docker: Testing to ProductionEdwin Fuquen
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to productionmuayyad alsadi
 

Was ist angesagt? (20)

Docker: the road ahead
Docker: the road aheadDocker: the road ahead
Docker: the road ahead
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge
 
Using functional programming within an industrial product group: perspectives...
Using functional programming within an industrial product group: perspectives...Using functional programming within an industrial product group: perspectives...
Using functional programming within an industrial product group: perspectives...
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017
 
Container Torture: Run any binary, in any container
Container Torture: Run any binary, in any containerContainer Torture: Run any binary, in any container
Container Torture: Run any binary, in any container
 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real World
 
Docker Online Meetup #31: Unikernels
Docker Online Meetup #31: UnikernelsDocker Online Meetup #31: Unikernels
Docker Online Meetup #31: Unikernels
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
 
What Have Namespaces Done for you Lately? Liz Rice, Aqua Security
What Have Namespaces Done for you Lately?  Liz Rice, Aqua SecurityWhat Have Namespaces Done for you Lately?  Liz Rice, Aqua Security
What Have Namespaces Done for you Lately? Liz Rice, Aqua Security
 
Docker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing MeetupDocker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing Meetup
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Containerd: Building a Container Supervisor by Michael Crosby
Containerd: Building a Container Supervisor by Michael CrosbyContainerd: Building a Container Supervisor by Michael Crosby
Containerd: Building a Container Supervisor by Michael Crosby
 
Intro to Docker - London meetup oct. 2013
Intro to Docker - London meetup oct. 2013Intro to Docker - London meetup oct. 2013
Intro to Docker - London meetup oct. 2013
 
Leveraging the Power of containerd Events - Evan Hazlett
Leveraging the Power of containerd Events - Evan HazlettLeveraging the Power of containerd Events - Evan Hazlett
Leveraging the Power of containerd Events - Evan Hazlett
 
LinuxKit Deep Dive
LinuxKit Deep DiveLinuxKit Deep Dive
LinuxKit Deep Dive
 
Docker: Testing to Production
Docker: Testing to ProductionDocker: Testing to Production
Docker: Testing to Production
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to production
 

Ähnlich wie PaaSTA: Running applications at Yelp

PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpNathan Handler
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017Patrick Chanezon
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java binOlve Hansen
 
Free GitOps Workshop
Free GitOps WorkshopFree GitOps Workshop
Free GitOps WorkshopWeaveworks
 
Scala, docker and testing, oh my! mario camou
Scala, docker and testing, oh my! mario camouScala, docker and testing, oh my! mario camou
Scala, docker and testing, oh my! mario camouJ On The Beach
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Anthony Dahanne
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesRishabh Indoria
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Dockernklmish
 
Successful DevOps implementation for small teams a true story
Successful DevOps implementation for small teams  a true storySuccessful DevOps implementation for small teams  a true story
Successful DevOps implementation for small teams a true storyJakub Paweł Głazik
 
Docker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsDocker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsRightScale
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Novaclayton_oneill
 
Leveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningLeveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningEvans Ye
 
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging Docker for Hadoop build automation and Big Data stack provisioningLeveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging Docker for Hadoop build automation and Big Data stack provisioningDataWorks Summit
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Microsoft
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingStanislav Osipov
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAkshaya Mahapatra
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...Ambassador Labs
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 
Devoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and BoltsDevoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and BoltsPatrick Chanezon
 

Ähnlich wie PaaSTA: Running applications at Yelp (20)

PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at Yelp
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Free GitOps Workshop
Free GitOps WorkshopFree GitOps Workshop
Free GitOps Workshop
 
Scala, docker and testing, oh my! mario camou
Scala, docker and testing, oh my! mario camouScala, docker and testing, oh my! mario camou
Scala, docker and testing, oh my! mario camou
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 
Successful DevOps implementation for small teams a true story
Successful DevOps implementation for small teams  a true storySuccessful DevOps implementation for small teams  a true story
Successful DevOps implementation for small teams a true story
 
Docker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsDocker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud Applications
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Nova
 
Leveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningLeveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioning
 
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging Docker for Hadoop build automation and Big Data stack provisioningLeveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Devoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and BoltsDevoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and Bolts
 

Kürzlich hochgeladen

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 

Kürzlich hochgeladen (20)

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 

PaaSTA: Running applications at Yelp

  • 1. Nathan Handler nhandler@yelp.com / @nathanhandler PaaSTA Running Applications at Yelp
  • 2. ● Nathan Handler / @nathanhandler ● Site Reliability Engineer at Yelp ● Ubuntu/Debian Developer and freenode staff ● PaaSTA Developer Who am I? 2
  • 3. Yelp’s Mission Connecting people with great local businesses. 3
  • 4. Yelp Stats As of Q1 2016 90M 3270%102M 4
  • 5. ● Monolithic Python application (~3M LoC) ● Builds/deployments took a long time ○ Bottleneck on how often we can deploy ● Mistakes are painful ○ Large impact ○ Difficult to find ○ Slow to fix History 5
  • 6. ● Split features into different applications ● Smaller services allowed for faster pushes ● Easier to reason about issues ● Able to scale services independently Service Oriented Architecture v1 6
  • 7. ● Standalone application ● Stateless ● Separate git repository ● Typically at Yelp: ○ HTTP API ○ Python, Pyramid, uWSGI ○ virtualenv What is a service? 7
  • 8. ● Statically defined list of hosts to deploy a service on ● Operations decides which hosts to deploy to ● Monitoring manually configured in Nagios ● Manual deployment system via rsync Deploying Services v1 8
  • 11. ● Yelp's Platform as a Service ● Builds, Deploys, Connects, and Monitors services ● Glue around existing and established open source tools PaaSTA 11 https://github.com/yelp/paasta #paasta on irc.freenode.net
  • 12. 12
  • 13. PaaSTA Components 13 Docker Registry Developer git push git pull git push docker push 13 Marathon Sensu
  • 15. . ├── Dockerfile ├── htdocs │ ├── index.php │ └── status └── Makefile 15 A simple service
  • 16. DOCKER_TAG ?= $(USER)-dev test: @echo 'Unit testing' itest: cook-image paasta local-run --healthcheck --service devops cook-image: docker build -t $(DOCKER_TAG) . 16 $ cat Makefile
  • 17. DOCKER_TAG ?= $(USER)-dev test: @echo 'Unit testing' itest: cook-image paasta local-run --healthcheck --service devops cook-image: docker build -t $(DOCKER_TAG) . 17 $ cat Makefile
  • 18. • Containers: like lightweight VMs • Provides a language (Dockerfile) for describing container image • Reproducible builds (mostly) • Provides software flexibility 18 Docker docker.com
  • 19. FROM ubuntu:xenial MAINTAINER Nathan Handler <nhandler@yelp.com> RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 ENV APACHE_LOCK_DIR /var/lock/apache2 ENV APACHE_PID_FILE /var/run/apache2.pid RUN rm -f /var/www/html/index.html COPY htdocs /var/www/html/ CMD ["/usr/sbin/apache2", "-D", "FOREGROUND", "-C", "listen 8888"] EXPOSE 8888 19 $ cat Dockerfile
  • 20. ✓ yelpsoa-config directory for devops found in /nail/etc/serv ✓ deploy.yaml exists for a Jenkins pipeline ✗ No 'security-check' entry was found in your deploy.yaml. Please add a security-check entry *AFTER* the itest entry in d so your docker image can be checked against known security vul More info: http://servicedocs.yelpcorp.com/docs/paasta_tools/c ✗ No 'performance-check' entry was found in your deploy.yaml. Please add a performance-check entry *AFTER* the security-chec so your docker image can be checked for performance regression More info: http://servicedocs.yelpcorp.com/docs/paasta_tools/c ✓ Jenkins build pipeline found ✓ Git repo found in the expected location. ✓ Found Dockerfile ✓ A Makefile is present ✓ The Makefile contains a tab character ✓ The Makefile contains a docker tag ✓ The Makefile responds to `make cook-image` ✓ The Makefile responds to `make itest` ✓ The Makefile responds to `make test` ✓ Found marathon.yaml file. ✓ All entries in deploy.yaml correspond to a marathon or chro ✓ All marathon instances have a corresponding deploy.yaml ent ✓ monitoring.yaml found for Sensu monitoring ✓ Your service uses Sensu and team 'nhandler' will get alerts ✓ Found smartstack.yaml file ✓ Instance 'demo' of your service is using smartstack port 20 balanced ✓ Successfully validated schema: marathon-nova-devc.yaml 20 $ paasta check
  • 23. --- pipeline: - instancename: itest - instancename: push-to-registry - instancename: dev.everything 23 $ cat deploy.yaml
  • 26. • Describe end goal, not path • Helps us achieve fault tolerance. "Deploy 6de16ff2 to prod" vs. "Commit 6de16ff2 should be running in prod" Gas pedal vs. Cruise Control 26 Declarative control
  • 27. Description: A demo PaaSTA service for OSCON 2016 External Link: http://conferences.oreilly.com/oscon/open-source- us/public/schedule/detail/49358 Monitored By: team nhandler Runbook: Please set a `runbook` field in your monitoring.yaml. Like "y/rb-m Docs: https://trac.yelpcorp.com/wiki/HowToService/Monitoring/monitoring.yam Git Repo: git@git.yelpcorp.com:services/devops Jenkins Pipeline: https://jenkins.yelpcorp.com/view/services-devops Deployed to the following clusters: - nova-devc (N/A) Smartstack endpoint(s): - http://169.254.255.254:20973 (demo) Dashboard(s): - https://uchiwa.yelpcorp.com/#/events?q=devops (Sensu Alerts) 27 $ paasta info
  • 28. PaaSTA Components 28 Docker Registry Developer git push git pull git push docker push 28 Marathon
  • 29. • Mesos is an "SDK for distributed systems", not batteries-included. • Requires a framework • Marathon • Chronos for scheduled batches • Can run many frameworks on the same cluster • Supports Docker as task executor 29 mesosphere.io mesos.apache.org Scheduling: Mesos + Marathon
  • 30. --- demo: cpus: 0.1 instances: 3 mem: 500 monitoring: alert_after: 0m bounce_method: brutal deploy_group: dev.everything 30 $ cat marathon-nova-devc.yaml
  • 31. PaaSTA Components 31 Docker Registry Developer git push git pull git push docker push 31 Marathon
  • 32. ● Brutal: Stops old versions and starts the new version, without regard to safety. ● Upthendown: Brings up the new version of the service and waits until all instances are healthy before stopping the old versions. ● Downthenup: Stops any old versions and waits for them to die before starting the new version. ● Crossover: Starts the new version, and gradually kills instances of the old versions as new instances become healthy. Bounce Strategies 32
  • 33. 33
  • 34. 34
  • 35. 35
  • 36. 36 Discovery in PaaSTA: Smartstack mesos slave box2 client nerve HAProxy synapse box1 service nerve mesos slave synapse HAProxy ZooKeeperMetadata HTTP request healthcheck
  • 39. Pipeline: https://jenkins.yelpcorp.com/view/services-devops cluster: nova-devc instance: demo Git sha: 6de16ff2 State: Running - Desired state: Started Marathon: Healthy - up with (3/3) instances. Status: Running. Mesos: Healthy - (3/3) tasks in the TASK_RUNNING state. Smartstack: Name LastCheck LastChange Status useast1-devc - Healthy - in haproxy with (3/3) total backends UP in this namespace. 39 $ paasta status
  • 40. Cluster: mesosstage Dashboards: Marathon RO: http://marathon.paasta-mesosstage.yelp/ Smartstack: http://paasta-mesosstage.yelp:3212 Chronos RO: http://chronos.paasta-mesosstage.yelp/ Mesos: http://mesos.paasta-mesosstage.yelp Mesos Status: OK quorum: masters: 3 configured quorum: 2 frameworks: framework: chronos-2.4.0 count: 1 framework: marathon count: 1 CPUs: 1.00 / 7 in use (14.29%) Memory: 3.03 / 42.85GB in use (7.07%) Disk: 10.00 / 153.81GB in use (6.50%) tasks: running: 9 staging: 1 starting: 0 slaves: active: 7 inactive: 0 Marathon Status: OK marathon apps: 5 marathon tasks: 9 marathon deployments: 0 Chronos Status: OK Enabled chronos jobs: 1 40 $ paasta metastatus
  • 41. PaaSTA Components 41 Docker Registry Developer git push git pull git push docker push 41 Marathon Sensu
  • 42. --- team: nhandler page: true notification_email: nhandler+devops@yelp.com 42 $ cat monitoring.yaml
  • 43. 43
  • 44. PaaSTA Components 44 Docker Registry Developer git push git pull git push docker push 44 Marathon Sensu