SlideShare a Scribd company logo
1 of 39
Oops! I deployed it again
New ways to get your app in the cloud Dylan Jay
You've written a web app
And now you need a host
We want it to be easy
We want flexibility
We want it to be cheap
Options
Type Providers Flexibility (Easy) Scalability
Shared Few
e.g. Webfaction
($14)
Limited Choice
(Control Panel)
None
AppEngine One
Google (Free)
No Choice
(Launcher)
Built in
VPS Lots
e.g. Slicehost ($20)
Unlimited choice
(DIY)
DIY
Cloud Few
e.g. Rackspace ($11)
Unlimited choice
(DIY)
DIY
Can you have your cake
and eat it to?
Hostout (Fabric, buildout)
&
Silverlining
Code under development
Push vs Pull
Fabric
<< fabfile.py >>
from fabric import api
def host_type():
api.run('uname -s')
$ fab -H localhost,linuxbox host_type
Buildout Workflow
Get the “buildout”
$ python bootstrap.py
$ bin/buildout
$ bin/myinstalledscript
… add recipes to buildout.cfg from pypi …
$ bin/buildout
Building myapp
$ bin/buildout
$ bin/paster serve src/myapp/myapp.ini
Useful recipes
● zc.recipe.egg – download eggs and create
scripts
● collective.recipe.command – run shell
commands
● collective.recipe.template – make config files
from templates
● zc.recipe.cmmi – compile, make, install stuff
● isotoma.recipe.apache – or any other useful
shortcuts
● mr.developer – manage source control
Hostout
Is
a buildout recipe
to replicate a local buildout
to many hosts
(using fabric)
Why document it when you can code it?
Basic Hostout
[buildout]
parts = host1
[host1]
recipe = collective.hostout
host = 127.0.0.1:10022
fabfiles = fabfile.py
option1 = buildout
user = root
password = root
path = /var/host1
Command line
$> bin/hostout host1 host_type
$> bin/hostout host1 host2 host_type echo
hello
Share your command
< setup.py >
entry_points = {'zc.buildout': ['default =pkg:Recipe',],
'fabric': ['fabfile = pkg.fabfile']
},
[host1]
recipe = collective.hostout
extends = pkg
Built in commands
● Run
● Sudo
● Deploy
● Predeploy
– Bootstrap – platform dependent
● setupusers
● setowners
● Uploadeggs
● Uploadbuildout
● Buildout
● Postdeploy
Releasing eggs
1 hostoutversions.cfg during buildout
2 sdist with md5 for all develop eggs
3 fabric.api.put all hashed eggs (if needed)
1 Direct to egg cache
4 deployed.cfg with hashed versions pinned
5 Upload zip of buildout + includes
6 fabric.api.run( bin/buildout -c deployed.cfg )
Hostout
● Get a “production” buildout
● To your develop.cfg buildout add...
[myhost]
recipe = collective.hostout
extends = hostout.cloud hostout.ubuntu
hosttype = rackspace
key = myaccount
secret = myapikey
buildout = production.cfg
● $ bin/buildout
● $ bin/hostout myhost deploy
Hostout is modular
● collective.hostout
● Deploys buildout to any posix host. Needs IP and
password
● hostout.ubuntu
● bootstraps ubuntu host for buildout
● hostout.cloud
● Creates node ready to be bootstrapped
● fabfiles = myfabfile.py – add your own
Suggested layout
● buildout.cfg (extends = config/deploy.cfg config/devel.cfg)
● config/
● base.cfg (extends = base.cfg)
● devel.cfg (extends = base.cfg)
● prod.cfg (extends = base.cfg)
● deploy.cfg (extends = base.cfg)
– [host1]
– buildout = production.cfg
– parts = instance1
User model
[host1]
user = {initial sudo user}
buildout-user = {owns buildout files + pw-less
login}
effective-user = {owns var dir}
buildout-group = {group owns both}
Extra Options
● include = {files to include in buildout zip}
● parts = {override parts}
● sudo-parts = {sudo bin/buildout install …}
● pre-commands = {shell to sudo before}
● post-commads = {shell to sudo after}
● path = {location of buildout}
Deployment Hooks
def predeploy():
domystuff
api.env.hostout.super.predeploy()
● Calls that are overridable
– api.env.hostout.callmycommand()
hostout.supervisor
● Pre and post deployment stop and start
● bin/hostout host status
● bin/hostout host supervisorboot
● bin/hostout host start/stop/restart
hostout.cloud
● bin/hostout host create
● bin/hostout host destroy
● Predeploy hook to create if needed
[host1]
extends =
hostout.cloud
hostout.ubuntu
hostout.supervisor
hosttype = rackspace
hostname = ploneplonk
key = ${keys:rackspace_key}
secret = ${keys:rackspace_secret}
Gotchas
● Eggs must be releasable. Ie need setuptools-git
etc
● All files must be checked in locally
● Interactive commands get stuck
$ bin/hostout host deploy
Silverlining
● By Ian Bicking
● Create app layout/dir
● $ silver init myapp
● Install dependencies into dir
● $ cd app; bin/easy_install repoze.bfg
● Install your code into dir
● $ bin/python src/myapp/setup.py develop
Silverlining II
● Configure it
● Edit app.ini: runner = src/myapp/myapp.ini
● Create host
● $ silver create-node myhost
● $ silver setup-node myhost
● Deploy (rsync)
● $ silver update myapp --node myhost
Hostout vs. Silverlining
● Many deployers
● Checkin. Checkout. Buildout. deploy
● Hostout uses fabric
● Cross platform but more dependencies (pycrypto)
● Hostout is modular
● Package your own fabfiles to help others deploy
● Hostout is flexible – helps professionals
● Buildout is powerful. No limit to building/installing.
NoSQL etc.
● Buildout shares dl code
Silverlining vs. Hostout
● Silverlining is batteries included
● You don't need a production buildout
● Silverlining is “known” target platform
● means less variables to go wrong
● Familiar workflow
● Commandline vs cfg.
Thanks
● Dylan Jay
● http://www.pretaweb.com
● twitter: djay75
● pyconau@dylanjay.com
● Know plone, syd admin or pywebdev? - we're
hiring
Photo Credits
http://www.flickr.com/photos/benheine/4613609067/sizes/l/in/set-72157622547905358/
http://www.flickr.com/photos/stevedave/3444248057/sizes/o/
http://www.flickr.com/photos/rkbcupcakes/3409724942/sizes/o/
http://www.flickr.com/photos/irrational_cat/517564258/

More Related Content

What's hot

Docker & FieldAware
Docker & FieldAwareDocker & FieldAware
Docker & FieldAware
Jakub Jarosz
 

What's hot (20)

The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker Hub
 
Deis, a PaaS built with Docker, Docker Meetup Sao Paulo #3 @Wayra
Deis, a PaaS built with Docker,  Docker Meetup Sao Paulo #3 @WayraDeis, a PaaS built with Docker,  Docker Meetup Sao Paulo #3 @Wayra
Deis, a PaaS built with Docker, Docker Meetup Sao Paulo #3 @Wayra
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APP
 
Docker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - MachineDocker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - Machine
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Building a Django App on Heroku
Building a Django App on HerokuBuilding a Django App on Heroku
Building a Django App on Heroku
 
Docker & FieldAware
Docker & FieldAwareDocker & FieldAware
Docker & FieldAware
 
Ansible lightning talk at Scale 12
Ansible lightning talk at Scale 12Ansible lightning talk at Scale 12
Ansible lightning talk at Scale 12
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with Nix
 
Workshop presentation
Workshop presentationWorkshop presentation
Workshop presentation
 
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
 
Kubeflow Development Environment
Kubeflow Development EnvironmentKubeflow Development Environment
Kubeflow Development Environment
 
Google App Engine: Basic
Google App Engine: BasicGoogle App Engine: Basic
Google App Engine: Basic
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoin
 
Plone and docker
Plone and dockerPlone and docker
Plone and docker
 
OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!
 
Docker and plone
Docker and ploneDocker and plone
Docker and plone
 
Next-Generation Ruby Deployment with Heroku
Next-Generation Ruby Deployment with HerokuNext-Generation Ruby Deployment with Heroku
Next-Generation Ruby Deployment with Heroku
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 

Viewers also liked (8)

DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)
 
Advanced Aspects of the Django Ecosystem: Haystack, Celery & Fabric
Advanced Aspects of the Django Ecosystem: Haystack, Celery & FabricAdvanced Aspects of the Django Ecosystem: Haystack, Celery & Fabric
Advanced Aspects of the Django Ecosystem: Haystack, Celery & Fabric
 
2日間Fabricを触った俺が
 色々解説してみる
2日間Fabricを触った俺が
 色々解説してみる2日間Fabricを触った俺が
 色々解説してみる
2日間Fabricを触った俺が
 色々解説してみる
 
Automated Deployment with Fabric
Automated Deployment with FabricAutomated Deployment with Fabric
Automated Deployment with Fabric
 
fabfile.py
fabfile.pyfabfile.py
fabfile.py
 
Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Fabric Fast & Furious edition
Fabric Fast & Furious editionFabric Fast & Furious edition
Fabric Fast & Furious edition
 

Similar to Opps I deployed it again-ploneconf2010

Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Weaveworks
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
Opersys inc.
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
Marcus Sá
 

Similar to Opps I deployed it again-ploneconf2010 (20)

Opps i deployed it again
Opps i deployed it againOpps i deployed it again
Opps i deployed it again
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012
 
How to host an app for $20 in 20min using buildout and hostout
How to host an app  for $20 in 20min using buildout and hostoutHow to host an app  for $20 in 20min using buildout and hostout
How to host an app for $20 in 20min using buildout and hostout
 
Buildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in pythonBuildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in python
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with Jitterbug
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
Wrangling 3rd Party Installers from Puppet
Wrangling 3rd Party Installers from PuppetWrangling 3rd Party Installers from Puppet
Wrangling 3rd Party Installers from Puppet
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Buildout: How to maintain big app stacks without losing your mind
Buildout: How to maintain big app stacks without losing your mindBuildout: How to maintain big app stacks without losing your mind
Buildout: How to maintain big app stacks without losing your mind
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Introduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John HixsonIntroduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John Hixson
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Yobi d2 naver(create)
Yobi d2 naver(create)Yobi d2 naver(create)
Yobi d2 naver(create)
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 

More from Dylan Jay

Surviving an earthquake's worth of traffic
Surviving an earthquake's worth of trafficSurviving an earthquake's worth of traffic
Surviving an earthquake's worth of traffic
Dylan Jay
 

More from Dylan Jay (11)

5 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 55 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 5
 
The eggless Plone manifesto (or Plone the open source cms-as-a-service platf...
The eggless Plone manifesto (or Plone  the open source cms-as-a-service platf...The eggless Plone manifesto (or Plone  the open source cms-as-a-service platf...
The eggless Plone manifesto (or Plone the open source cms-as-a-service platf...
 
The goodies of zope, pyramid, and plone (2)
The goodies of zope, pyramid, and plone (2)The goodies of zope, pyramid, and plone (2)
The goodies of zope, pyramid, and plone (2)
 
Surviving an earthquake's worth of traffic
Surviving an earthquake's worth of trafficSurviving an earthquake's worth of traffic
Surviving an earthquake's worth of traffic
 
TTW FTW: Plone as the new wordpress
TTW FTW: Plone as the new wordpressTTW FTW: Plone as the new wordpress
TTW FTW: Plone as the new wordpress
 
Plone pwns
Plone pwnsPlone pwns
Plone pwns
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web apps
 
Plone: The CMS that hits above it's weight
Plone: The CMS that hits above it's weightPlone: The CMS that hits above it's weight
Plone: The CMS that hits above it's weight
 
Funnelweb ploneconf2010
Funnelweb ploneconf2010Funnelweb ploneconf2010
Funnelweb ploneconf2010
 
Plone for python programmers
Plone for python programmersPlone for python programmers
Plone for python programmers
 
TestBrowser Driven Development: How to get bulletproof code from lazy developers
TestBrowser Driven Development: How to get bulletproof code from lazy developersTestBrowser Driven Development: How to get bulletproof code from lazy developers
TestBrowser Driven Development: How to get bulletproof code from lazy developers
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Opps I deployed it again-ploneconf2010

Editor's Notes

  1. Isolated environment Combine eggs, sdist, cmmi, .cfg, php, whatever Recipes do the combining Flow is Configure, build (auto install), run Vs Install, configure, run Can share “buildouts”