SlideShare a Scribd company logo
1 of 46
Download to read offline
Deploying PHP on
PAAS: Why & How?
  Midwest PHP — March 2013, Minnesota
Outline
•  PHP deployment "back then"
  o    a (biased) history
•  PHP deployment today
  o    unresolved issues
•  How PaaS can help
  o    any PaaS—not just dotCloud! ☺
•  How to help yourself with PaaS
  o    and make your lives (as developers) easier
•  What's next?
Who am I? Who was I?
•    Sysadmin in a (French) PHP shop
     during the "dotcom bubble" (1999-2001)


•    What did it mean to "create a site?"
     o  Apache <VirtualHost> section
     o  FTP account
     o  MySQL database
     o  sendmail aliases (hellyeah!)
     o  DNS zone


•    What did it mean to "go to production?"
     o  Easy! Update the <VirtualHost>
The awful truth
•  Repetitive tasks are error-prone
   o    Script everything!
•  Custom setups are error-prone
   o    Knowing where to differentiate is black magic
•  Moving development→production is easy
   o    Having development+production is hard

A production environment is a customized, repeat version
             of the development environment.
                  I don't see how anything could possibly go wrong.
PaaS 2000:
Account creation
•    Summer 1999: Apache mod_vhost_alias
     (Apache 1.3.7/1.3.9)
      o  Create a directory, boom, you're done!
•    April 1999: proftpd mod_mysql
     ("experimental and utterly undocumented")
      o  INSERT a user, boom, you're done!
•    Postfix virtual domains
     o  With all due respect, sendmail was creepy
•    BIND generic zones (PowerDNS later)

                           Bliss level: 9000!
PaaS 2000:
Go to production
•  Move directories, rename users
   o    Error prone!
•  Create a new, clean account; copy DB
   o    Different from the dev environment!




 Whatever you do: if you push the wrong code
  to the wrong place, something hits the fan.
PaaS 2000:
Musings with SQLite
•  In May 2000, two great things happen:
  PHP4 and SQLite.

•  Deployment of simple PHP apps is easy:
  Just upload the code. No DB creation.

•  Migration of said PHP apps is easy:
  Just copy the code (and the .db file).

•  As long as you have this non-standard PHP.
•  And you don't mind blewing up the DB.
PaaS 2000:
It's Web Scale!
PaaS 2000:
It's Web Scale!
PaaS 2000:
 It's Web Scale!
•  No load balancer yet, DNS round robin
   o    Then HAProxy arrived, and Nginx, and F5...

•  Files (PHP and static assets) over NFS
   o    Today, we could talk about GlusterFS, S3...

•  User accounts shared with NIS
   o    LDAP is the new cool (... kind of)

•  MySQL: no replication yet
   o    But if you like, we can talk about 3-way multi-master
PaaS 2000:
The Downfall
"We need this Java thing"
• mod_jk, mod_jserv, mod_ajp, ...
"And media streaming, too"
• realserver, ...

Those things were changing quickly.
We needed test environments.
Virtualization wasn't there yet.
☹
Let's talk about you!
Let's talk about you!
Please raise your hand if you...
•  Write PHP code?
•  Use (mainly) FTP to deploy?
•  Use SCP/rsync/similar to deploy?
•  Use capistrano/fabric/similar to deploy?
•  Deploy to a PaaS?
•  Deploy to something else?
•  Always use a staging environment?
•  Have a clean staging→production workflow?
What I do today
•  Server-whisperer for dotCloud
  o    ...Among other things


•  Tackling the PaaS challenge again
  o    development→production workflow
  o    deployment should be as easy as "upload, done!"
  o    ... even when $language	
  !=	
  "php"	
  


•  Trying to steal NetBSD's motto
  o    "Of course it runs on dotCloud"
Waitaminute...
What's a PaaS?
Waitaminute...
What's a PaaS?
Waitaminute...
What's a PaaS?
 You                              The Great
                                   Internet



                       Load balancer           Load balancer
   Tools:
  CLI, API...
                   A large             number of

                beefy servers            running apps
PaaS:
  What's the point? (1/5)
Deploying new environments ...

•  It's fast!
   o    In minutes, you have your whole stack,
        complete with DB, memcached, bells & whistles
   o    Cool to test some now code
   o    Or to deploy older code to find regressions


•  It's cheap!
   o    On most PaaS, development = free
PaaS:
     What's the point? (2/5)
Leverage git, hg, ...

•    If you don't know git, I beg you to attend
     Mike Stowe's talk in Room 62 at 10:30am!
•    Keep all versions of your code, ever;
     go back to any of them
•    Redeploy the exact version which was online last week
     before that horrible bug happened
•    Compare conversion rates on two variants
     of your site
PaaS:
     What's the point? (3/5)
Someone else takes care of ...


•    Optimizing your stack (≠code)
     o  Crafting that crazy Nginx/PHP-FPM setup
     o  Lower memory footprint
     o  Better performance (APC...)


•    Upgrading your stack
     o  Watch security disclosure mailing lists
     o  Roll out performance and security updates
     o  Give you new versions of PHP, MySQL, etc.
PaaS:
     What's the point? (4/5)
Comprehensive HTTP routing


•    Attach/detach domains (virtualhosts)
     o  Easy transitions to new versions
         (And you keep the old version around)


•    Get nice metrics
     o  Request rate, error rate, latency
     o  (See screenshots!)


•    WebSocket support
     o  And other languages as well
PaaS:
     What's the point? (5/5)
Be Web Scale!

•    Scale horizontally and vertically
     o  horizontally = more servers
     o  vertically = bigger servers


•    Reliability
     o  horizontal scaling for web tier
     o  replication for database tier


→ Deploy to the Cloud
PaaS:
     What's the point? (5/5)
Be Web Scale!

•    Scale horizontally and vertically
     o  horizontally = more servers
     o  vertically = bigger servers


•    Reliability
     o  horizontal scaling for web tier
     o  replication for database tier


→ Deploy to the Cloud without the hassle
How to deploy PHP to
PaaS

   Note: my example will use dotCloud.
 But the principle is the same on any PAAS.
Deployment example:
  Symfony2 "KnpIpsum"
Original code:https://github.com/KnpLabs/KnpIpsum	
  

dotCloudized version:https://github.com/jpetazzo/
  KnpIpsum/tree/dotcloud	
  


(Make sure you use the "dotcloud" branch)
To the Cloud, and beyond!
  0: setup environment
•  Create (free) account on www.dotcloud.com
•  Install Python (!)
•  pip	
  install	
  dotcloud	
  
•  dotcloud	
  setup(Asks for login+password)
(Note: web-based push is →← that close)
To the Cloud, and beyond!
     1: dotcloud.yml	
  
•    The app is described by a small YAML file

                  www:	
  
                  	
  	
  type:	
  php	
  
                  	
  	
  approot:	
  web	
  
                  mongodb:	
  
                  	
  	
  type:	
  mongodb	
  
                  mysql:	
  
                  	
  	
  type:	
  mysql	
  
To the Cloud, and beyond!
  2: dotCloud+Symfony2
•  dotCloud has Symfony2 docs
•  The docs tell us we need a nginx.conf file
•  That's because most people deploy
     Symfony2 on Apache + mod_php
•    Symfony2 apps typically ship .htaccess	
  file
•    We need the equivalent of that file

→ Drop nginx.conf file in the web directory.
To the Cloud, and beyond!
  3: application specifics
•  README says to run a few manual
  steps:bin/vendors	
  install	
  
  php	
  app/console	
  doctrine:database:create	
  
  php	
  app/console	
  doctrine:schema:create	
  


•  We will put those steps in a postinstall script
  (that's just a shell script called "postinstall"),
  and the postinstall script will be executed
  automatically when we deploy
To the Cloud, and beyond!
    4: deploy application
$	
  dotcloud	
  create	
  symfonipsum	
  
[...]	
  
$	
  dotcloud	
  push	
  
==>	
  Pushing	
  code	
  with	
  rsync	
  from	
  "./"	
  to	
  application	
  symfonipsum	
  
building	
  file	
  list	
  ...	
  done	
  
[...uploading...]	
  
[...and	
  a	
  couple	
  of	
  minutes	
  later...]	
  
14:38:10.312838:	
  -­‐-­‐>	
  Application	
  (symfonipsum)	
  fully	
  installed	
  
==>	
  Application	
  is	
  live	
  at	
  http://symfonipsum-­‐skaya.dotcloud.com	
  


But of course, it doesn't work:
we never configured the database host/port/etc.
To the Cloud, and beyond!
     5: configure database
•      Find out database information:

$	
  dotcloud	
  info	
  mysql	
  
[...]	
  
ports:	
  
	
  	
  ssh:	
  	
  	
  ssh://mysql@symfonipsum-­‐skaya.azva.dotcloud.net:12345	
  
	
  	
  mysql:	
  mysql://root:XXX@symfonipsum-­‐skaya.azva.dotcloud.net:23456	
  


•      Edit app/config/config.yml,
       update host/port/login/password

•      Push again
Quick break:
     "The Twelve Factor App"
•    http://www.12factor.net/
•    http://www.12factor.net/config
•    "Store config in the environment"
      o  App config = everything that is likely to vary between deploys
         (staging, production, developer env., etc.)
      o  Includes: database/memcached access information,
         credentials to external services (Twitter, S3...)
      o  Storing config as constants in the code is wrong! Please don't
         do it!
      o  A good test: can you open source the code without
         compromising any credential?
To the Cloud, and beyond!
     5bis: configure database
•    dotCloud will put all information in two files:
      o  ~/environment.json	
  
      o  ~/environment.yml	
  


•    We do the following changes:
     o  Update postinstall to generate ~/symfony.yml (using the
        information in environment.json)
     o  Update app/config/config.yml to import ~/symfony.yml	
  


•    Push again
To the Cloud, and beyond!
  6: Multiplicate the Loaves
$	
  dotcloud	
  create	
  ipsumdev	
  
$	
  dotcloud	
  push	
  
[...]	
  

$	
  dotcloud	
  create	
  symfonymongotest	
  
$	
  dotcloud	
  push	
  
[...]	
  
To the Cloud, and beyond!
  7: Go live!
$	
  dotcloud	
  create	
  ipsumprod	
  -­‐f	
  live	
  

$	
  dotcloud	
  push	
  

$	
  dotcloud	
  scale	
  db:instances=2	
  

$	
  dotcloud	
  scale	
  www:memory=800M	
  

$	
  dotcloud	
  domain	
  add	
  www	
  www.loremipsum.com	
  
Drawbacks of PaaS
•  One-time initial investment (small)
   o    Get familiar with the CLI, tools...


•  Per-app initial investment (variable)
   o    Inject configuration variables
   o    Rework your app "for the Cloud" (when needed)
   o    Meddle Not In The Affairs Of Wizards!
Drawbacks of PaaS
•  One-time initial investment (small)
   o    Get familiar with the CLI, tools...


•  Per-app initial investment (variable)
   o    Inject configuration variables
   o    Rework your app "for the Cloud" (when needed)
   o    Meddle Not In The Affairs Of Wizards!


•  Higher apparent cost
   o    PaaS hosting can be 4x-10x more expensive
   o    Comes with 24x7 ops team, scaling, support
   o    Current PaaS don't leverage cheap hosts yet
One more (semi-)
 Drawback of PaaS
•  "dotcloud	
  run" (SSH access) doesn't work on the
     WiFi access in this conference!

•  But we're working on that...
     (WebSocket tunneling of SSH)

•  And you can't access your server, neither.
     (Unless you have a cunning VPN;
     OpenVPN running on 443/tcp anyone?)

•    Meawhile, you can still push to dotCloud! Yaaay!
Future of PaaS
•    PaaS on your servers / local machine

•    PaaS on a wide range of platforms
     (from cheap entry-level to high-end SSD)

•    Support for more languages & databases

•    Support for more frameworks

•    More integration with 3rd parties (e.g. github)
Thank you! Questions?
@jpetazzo
jerome@dotcloud.com

www.dotcloud.com

Slides deck: http://goo.gl/jZwdC

Feedback: http://joind.in/8217
Thank you! Questions?

More Related Content

What's hot

Leveraging Structured Data To Reduce Disk, IO & Network Bandwidth
Leveraging Structured Data To Reduce Disk, IO & Network BandwidthLeveraging Structured Data To Reduce Disk, IO & Network Bandwidth
Leveraging Structured Data To Reduce Disk, IO & Network BandwidthPerforce
 
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuffBuildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuffPatrick Shuff
 
Perconalive feb-2011-share
Perconalive feb-2011-sharePerconalive feb-2011-share
Perconalive feb-2011-sharemdcallag
 
Behind the Scenes at LiveJournal: Scaling Storytime
Behind the Scenes at LiveJournal: Scaling StorytimeBehind the Scenes at LiveJournal: Scaling Storytime
Behind the Scenes at LiveJournal: Scaling StorytimeSergeyChernyshev
 
Advanced Web Hosting
Advanced Web HostingAdvanced Web Hosting
Advanced Web HostingOVHcloud
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami SayarFITC
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou Toutou
 
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experimentAlfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experimentAxel Faust
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedTim Callaghan
 
Hashicorp at holaluz
Hashicorp at holaluzHashicorp at holaluz
Hashicorp at holaluzRicard Clau
 
DevOps Naughties Style - How We DevOps at MP3.com in the Early 2000's
DevOps Naughties Style - How We  DevOps at MP3.com in the Early 2000'sDevOps Naughties Style - How We  DevOps at MP3.com in the Early 2000's
DevOps Naughties Style - How We DevOps at MP3.com in the Early 2000'stechopsguru
 
Packaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything ElsePackaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything Elsemckern
 
Scaling Instagram
Scaling InstagramScaling Instagram
Scaling Instagramiammutex
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Mandi Walls
 
Capacity Management from Flickr
Capacity Management from FlickrCapacity Management from Flickr
Capacity Management from Flickrxlight
 

What's hot (17)

Leveraging Structured Data To Reduce Disk, IO & Network Bandwidth
Leveraging Structured Data To Reduce Disk, IO & Network BandwidthLeveraging Structured Data To Reduce Disk, IO & Network Bandwidth
Leveraging Structured Data To Reduce Disk, IO & Network Bandwidth
 
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuffBuildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuff
 
Perconalive feb-2011-share
Perconalive feb-2011-sharePerconalive feb-2011-share
Perconalive feb-2011-share
 
Behind the Scenes at LiveJournal: Scaling Storytime
Behind the Scenes at LiveJournal: Scaling StorytimeBehind the Scenes at LiveJournal: Scaling Storytime
Behind the Scenes at LiveJournal: Scaling Storytime
 
Advanced Web Hosting
Advanced Web HostingAdvanced Web Hosting
Advanced Web Hosting
 
CommandBox : Free CFML
CommandBox : Free CFMLCommandBox : Free CFML
CommandBox : Free CFML
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami Sayar
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experimentAlfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 
Hashicorp at holaluz
Hashicorp at holaluzHashicorp at holaluz
Hashicorp at holaluz
 
DevOps Naughties Style - How We DevOps at MP3.com in the Early 2000's
DevOps Naughties Style - How We  DevOps at MP3.com in the Early 2000'sDevOps Naughties Style - How We  DevOps at MP3.com in the Early 2000's
DevOps Naughties Style - How We DevOps at MP3.com in the Early 2000's
 
Packaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything ElsePackaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything Else
 
Scaling Instagram
Scaling InstagramScaling Instagram
Scaling Instagram
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
 
Capacity Management from Flickr
Capacity Management from FlickrCapacity Management from Flickr
Capacity Management from Flickr
 

Viewers also liked

Practical PaaS presentation
Practical PaaS presentationPractical PaaS presentation
Practical PaaS presentationhmalphettes
 
Lotus Live 4 ClubAlliances.com
Lotus Live 4 ClubAlliances.comLotus Live 4 ClubAlliances.com
Lotus Live 4 ClubAlliances.comPhilippe MATHIEU
 
Putting The PaaS in OpenStack with Diane Mueller @RedHat
Putting The PaaS in OpenStack with Diane Mueller @RedHat Putting The PaaS in OpenStack with Diane Mueller @RedHat
Putting The PaaS in OpenStack with Diane Mueller @RedHat OpenShift Origin
 
Choosing a dev ops paas platform svccd presentation v2 for slideshare
Choosing a dev ops paas platform svccd presentation v2 for slideshareChoosing a dev ops paas platform svccd presentation v2 for slideshare
Choosing a dev ops paas platform svccd presentation v2 for slideshareJohn Mathon
 
2016 Seleniumゆく年くる年 @ 第4回 日本Seleniumユーザーコミュニティ勉強会
2016 Seleniumゆく年くる年 @ 第4回 日本Seleniumユーザーコミュニティ勉強会2016 Seleniumゆく年くる年 @ 第4回 日本Seleniumユーザーコミュニティ勉強会
2016 Seleniumゆく年くる年 @ 第4回 日本Seleniumユーザーコミュニティ勉強会Hiroshi Toda
 
Transforming your business with PaaS
Transforming your business with PaaSTransforming your business with PaaS
Transforming your business with PaaSOmar Nawaz
 
PaaS is dead, Long live PaaS - Defrag 2016
PaaS is dead, Long live PaaS - Defrag 2016PaaS is dead, Long live PaaS - Defrag 2016
PaaS is dead, Long live PaaS - Defrag 2016brendandburns
 
Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...
Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...
Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...OpenShift Origin
 
Test Process Improvement with TPI NEXT - what the model does not tell you but...
Test Process Improvement with TPI NEXT - what the model does not tell you but...Test Process Improvement with TPI NEXT - what the model does not tell you but...
Test Process Improvement with TPI NEXT - what the model does not tell you but...SQALab
 
ひしめき合うOpen PaaSを徹底解剖! PaaSの今と未来
ひしめき合うOpen PaaSを徹底解剖! PaaSの今と未来ひしめき合うOpen PaaSを徹底解剖! PaaSの今と未来
ひしめき合うOpen PaaSを徹底解剖! PaaSの今と未来Kazuto Kusama
 
Tracxn research - PaaS Landscape, December 2016
Tracxn research -  PaaS Landscape, December 2016Tracxn research -  PaaS Landscape, December 2016
Tracxn research - PaaS Landscape, December 2016Tracxn
 
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)VMware Tanzu
 
Tracxn Research: PaaS Landscape Report, August 2016
Tracxn Research: PaaS Landscape Report, August 2016Tracxn Research: PaaS Landscape Report, August 2016
Tracxn Research: PaaS Landscape Report, August 2016Tracxn
 
A Multi-Company Perspective: Enterprise Cloud and PaaS
A Multi-Company Perspective: Enterprise Cloud and PaaSA Multi-Company Perspective: Enterprise Cloud and PaaS
A Multi-Company Perspective: Enterprise Cloud and PaaSThoughtworks
 
Entendiendo Iaas/Paas/Saas en Azure
Entendiendo Iaas/Paas/Saas en AzureEntendiendo Iaas/Paas/Saas en Azure
Entendiendo Iaas/Paas/Saas en AzureFernando Mejía
 

Viewers also liked (17)

Practical PaaS presentation
Practical PaaS presentationPractical PaaS presentation
Practical PaaS presentation
 
Lotus Live 4 ClubAlliances.com
Lotus Live 4 ClubAlliances.comLotus Live 4 ClubAlliances.com
Lotus Live 4 ClubAlliances.com
 
Putting The PaaS in OpenStack with Diane Mueller @RedHat
Putting The PaaS in OpenStack with Diane Mueller @RedHat Putting The PaaS in OpenStack with Diane Mueller @RedHat
Putting The PaaS in OpenStack with Diane Mueller @RedHat
 
Evolution of PaaS
Evolution of PaaSEvolution of PaaS
Evolution of PaaS
 
Choosing a dev ops paas platform svccd presentation v2 for slideshare
Choosing a dev ops paas platform svccd presentation v2 for slideshareChoosing a dev ops paas platform svccd presentation v2 for slideshare
Choosing a dev ops paas platform svccd presentation v2 for slideshare
 
2016 Seleniumゆく年くる年 @ 第4回 日本Seleniumユーザーコミュニティ勉強会
2016 Seleniumゆく年くる年 @ 第4回 日本Seleniumユーザーコミュニティ勉強会2016 Seleniumゆく年くる年 @ 第4回 日本Seleniumユーザーコミュニティ勉強会
2016 Seleniumゆく年くる年 @ 第4回 日本Seleniumユーザーコミュニティ勉強会
 
Transforming your business with PaaS
Transforming your business with PaaSTransforming your business with PaaS
Transforming your business with PaaS
 
PaaS is dead, Long live PaaS - Defrag 2016
PaaS is dead, Long live PaaS - Defrag 2016PaaS is dead, Long live PaaS - Defrag 2016
PaaS is dead, Long live PaaS - Defrag 2016
 
Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...
Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...
Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...
 
Test Process Improvement with TPI NEXT - what the model does not tell you but...
Test Process Improvement with TPI NEXT - what the model does not tell you but...Test Process Improvement with TPI NEXT - what the model does not tell you but...
Test Process Improvement with TPI NEXT - what the model does not tell you but...
 
ひしめき合うOpen PaaSを徹底解剖! PaaSの今と未来
ひしめき合うOpen PaaSを徹底解剖! PaaSの今と未来ひしめき合うOpen PaaSを徹底解剖! PaaSの今と未来
ひしめき合うOpen PaaSを徹底解剖! PaaSの今と未来
 
Tracxn research - PaaS Landscape, December 2016
Tracxn research -  PaaS Landscape, December 2016Tracxn research -  PaaS Landscape, December 2016
Tracxn research - PaaS Landscape, December 2016
 
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
 
Tracxn Research: PaaS Landscape Report, August 2016
Tracxn Research: PaaS Landscape Report, August 2016Tracxn Research: PaaS Landscape Report, August 2016
Tracxn Research: PaaS Landscape Report, August 2016
 
A Multi-Company Perspective: Enterprise Cloud and PaaS
A Multi-Company Perspective: Enterprise Cloud and PaaSA Multi-Company Perspective: Enterprise Cloud and PaaS
A Multi-Company Perspective: Enterprise Cloud and PaaS
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
Entendiendo Iaas/Paas/Saas en Azure
Entendiendo Iaas/Paas/Saas en AzureEntendiendo Iaas/Paas/Saas en Azure
Entendiendo Iaas/Paas/Saas en Azure
 

Similar to Midwest php 2013 deploying php on paas- why & how

Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Docker, Inc.
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsDerek Anderson
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101Rami Sayar
 
Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShiftSteven Pousty
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"IT Event
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedDataStax Academy
 
321 codeincontainer brewbox
321 codeincontainer brewbox321 codeincontainer brewbox
321 codeincontainer brewboxLino Telera
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?AFUP_Limoges
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014André Rømcke
 
Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewCeph, Docker, Heroku Slugs, CoreOS and Deis Overview
Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsPablo Godel
 
Getting Started Running Apache Spark on Apache Mesos
Getting Started Running Apache Spark on Apache MesosGetting Started Running Apache Spark on Apache Mesos
Getting Started Running Apache Spark on Apache MesosPaco Nathan
 
Intalio create and cloudfoudry - short
Intalio create and cloudfoudry - shortIntalio create and cloudfoudry - short
Intalio create and cloudfoudry - shorthmalphettes
 
Enterprise software needs a PaaS
Enterprise software needs a PaaSEnterprise software needs a PaaS
Enterprise software needs a PaaShmalphettes
 
OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012Steven Pousty
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationErica Windisch
 

Similar to Midwest php 2013 deploying php on paas- why & how (20)

Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCats
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
 
Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
 
321 codeincontainer brewbox
321 codeincontainer brewbox321 codeincontainer brewbox
321 codeincontainer brewbox
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
 
Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewCeph, Docker, Heroku Slugs, CoreOS and Deis Overview
Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 
Getting Started Running Apache Spark on Apache Mesos
Getting Started Running Apache Spark on Apache MesosGetting Started Running Apache Spark on Apache Mesos
Getting Started Running Apache Spark on Apache Mesos
 
Intalio create and cloudfoudry - short
Intalio create and cloudfoudry - shortIntalio create and cloudfoudry - short
Intalio create and cloudfoudry - short
 
Enterprise software needs a PaaS
Enterprise software needs a PaaSEnterprise software needs a PaaS
Enterprise software needs a PaaS
 
Docker 101
Docker 101 Docker 101
Docker 101
 
OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 

More from dotCloud

Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2dotCloud
 
Docker at Spotify - Dockercon14
Docker at Spotify - Dockercon14Docker at Spotify - Dockercon14
Docker at Spotify - Dockercon14dotCloud
 
John Engates Keynote at Dockercon 14
John Engates Keynote at Dockercon 14John Engates Keynote at Dockercon 14
John Engates Keynote at Dockercon 14dotCloud
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpdotCloud
 
DockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubDockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubdotCloud
 
Are VM Passé?
Are VM Passé? Are VM Passé?
Are VM Passé? dotCloud
 
OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQdotCloud
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifeidotCloud
 
Wot2013云计算架构师峰会 -陈轶飞2
Wot2013云计算架构师峰会 -陈轶飞2Wot2013云计算架构师峰会 -陈轶飞2
Wot2013云计算架构师峰会 -陈轶飞2dotCloud
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...dotCloud
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQdotCloud
 
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire dotCloud
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewiredotCloud
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwiliodotCloud
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013dotCloud
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterdotCloud
 
Introduction to Docker - Docker workshop @Twitter
Introduction to Docker - Docker workshop @TwitterIntroduction to Docker - Docker workshop @Twitter
Introduction to Docker - Docker workshop @TwitterdotCloud
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registrydotCloud
 
Docker links | Docker workshop #2 at Twitter
Docker links | Docker workshop #2 at TwitterDocker links | Docker workshop #2 at Twitter
Docker links | Docker workshop #2 at TwitterdotCloud
 

More from dotCloud (20)

Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2
 
Docker at Spotify - Dockercon14
Docker at Spotify - Dockercon14Docker at Spotify - Dockercon14
Docker at Spotify - Dockercon14
 
John Engates Keynote at Dockercon 14
John Engates Keynote at Dockercon 14John Engates Keynote at Dockercon 14
John Engates Keynote at Dockercon 14
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from Yelp
 
DockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubDockerCon Keynote Ben Golub
DockerCon Keynote Ben Golub
 
Are VM Passé?
Are VM Passé? Are VM Passé?
Are VM Passé?
 
OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQ
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifei
 
Wot2013云计算架构师峰会 -陈轶飞2
Wot2013云计算架构师峰会 -陈轶飞2Wot2013云计算架构师峰会 -陈轶飞2
Wot2013云计算架构师峰会 -陈轶飞2
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
 
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @Twitter
 
Introduction to Docker - Docker workshop @Twitter
Introduction to Docker - Docker workshop @TwitterIntroduction to Docker - Docker workshop @Twitter
Introduction to Docker - Docker workshop @Twitter
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registry
 
Docker links | Docker workshop #2 at Twitter
Docker links | Docker workshop #2 at TwitterDocker links | Docker workshop #2 at Twitter
Docker links | Docker workshop #2 at Twitter
 

Midwest php 2013 deploying php on paas- why & how

  • 1. Deploying PHP on PAAS: Why & How? Midwest PHP — March 2013, Minnesota
  • 2.
  • 3. Outline •  PHP deployment "back then" o  a (biased) history •  PHP deployment today o  unresolved issues •  How PaaS can help o  any PaaS—not just dotCloud! ☺ •  How to help yourself with PaaS o  and make your lives (as developers) easier •  What's next?
  • 4. Who am I? Who was I? •  Sysadmin in a (French) PHP shop during the "dotcom bubble" (1999-2001) •  What did it mean to "create a site?" o  Apache <VirtualHost> section o  FTP account o  MySQL database o  sendmail aliases (hellyeah!) o  DNS zone •  What did it mean to "go to production?" o  Easy! Update the <VirtualHost>
  • 5. The awful truth •  Repetitive tasks are error-prone o  Script everything! •  Custom setups are error-prone o  Knowing where to differentiate is black magic •  Moving development→production is easy o  Having development+production is hard A production environment is a customized, repeat version of the development environment. I don't see how anything could possibly go wrong.
  • 6. PaaS 2000: Account creation •  Summer 1999: Apache mod_vhost_alias (Apache 1.3.7/1.3.9) o  Create a directory, boom, you're done! •  April 1999: proftpd mod_mysql ("experimental and utterly undocumented") o  INSERT a user, boom, you're done! •  Postfix virtual domains o  With all due respect, sendmail was creepy •  BIND generic zones (PowerDNS later) Bliss level: 9000!
  • 7. PaaS 2000: Go to production •  Move directories, rename users o  Error prone! •  Create a new, clean account; copy DB o  Different from the dev environment! Whatever you do: if you push the wrong code to the wrong place, something hits the fan.
  • 8. PaaS 2000: Musings with SQLite •  In May 2000, two great things happen: PHP4 and SQLite. •  Deployment of simple PHP apps is easy: Just upload the code. No DB creation. •  Migration of said PHP apps is easy: Just copy the code (and the .db file). •  As long as you have this non-standard PHP. •  And you don't mind blewing up the DB.
  • 11. PaaS 2000: It's Web Scale! •  No load balancer yet, DNS round robin o  Then HAProxy arrived, and Nginx, and F5... •  Files (PHP and static assets) over NFS o  Today, we could talk about GlusterFS, S3... •  User accounts shared with NIS o  LDAP is the new cool (... kind of) •  MySQL: no replication yet o  But if you like, we can talk about 3-way multi-master
  • 12. PaaS 2000: The Downfall "We need this Java thing" • mod_jk, mod_jserv, mod_ajp, ... "And media streaming, too" • realserver, ... Those things were changing quickly. We needed test environments. Virtualization wasn't there yet. ☹
  • 14. Let's talk about you! Please raise your hand if you... •  Write PHP code? •  Use (mainly) FTP to deploy? •  Use SCP/rsync/similar to deploy? •  Use capistrano/fabric/similar to deploy? •  Deploy to a PaaS? •  Deploy to something else? •  Always use a staging environment? •  Have a clean staging→production workflow?
  • 15. What I do today •  Server-whisperer for dotCloud o  ...Among other things •  Tackling the PaaS challenge again o  development→production workflow o  deployment should be as easy as "upload, done!" o  ... even when $language  !=  "php"   •  Trying to steal NetBSD's motto o  "Of course it runs on dotCloud"
  • 18. Waitaminute... What's a PaaS? You The Great Internet Load balancer Load balancer Tools: CLI, API... A large number of beefy servers running apps
  • 19. PaaS: What's the point? (1/5) Deploying new environments ... •  It's fast! o  In minutes, you have your whole stack, complete with DB, memcached, bells & whistles o  Cool to test some now code o  Or to deploy older code to find regressions •  It's cheap! o  On most PaaS, development = free
  • 20. PaaS: What's the point? (2/5) Leverage git, hg, ... •  If you don't know git, I beg you to attend Mike Stowe's talk in Room 62 at 10:30am! •  Keep all versions of your code, ever; go back to any of them •  Redeploy the exact version which was online last week before that horrible bug happened •  Compare conversion rates on two variants of your site
  • 21. PaaS: What's the point? (3/5) Someone else takes care of ... •  Optimizing your stack (≠code) o  Crafting that crazy Nginx/PHP-FPM setup o  Lower memory footprint o  Better performance (APC...) •  Upgrading your stack o  Watch security disclosure mailing lists o  Roll out performance and security updates o  Give you new versions of PHP, MySQL, etc.
  • 22. PaaS: What's the point? (4/5) Comprehensive HTTP routing •  Attach/detach domains (virtualhosts) o  Easy transitions to new versions (And you keep the old version around) •  Get nice metrics o  Request rate, error rate, latency o  (See screenshots!) •  WebSocket support o  And other languages as well
  • 23.
  • 24.
  • 25. PaaS: What's the point? (5/5) Be Web Scale! •  Scale horizontally and vertically o  horizontally = more servers o  vertically = bigger servers •  Reliability o  horizontal scaling for web tier o  replication for database tier → Deploy to the Cloud
  • 26.
  • 27. PaaS: What's the point? (5/5) Be Web Scale! •  Scale horizontally and vertically o  horizontally = more servers o  vertically = bigger servers •  Reliability o  horizontal scaling for web tier o  replication for database tier → Deploy to the Cloud without the hassle
  • 28. How to deploy PHP to PaaS Note: my example will use dotCloud. But the principle is the same on any PAAS.
  • 29. Deployment example: Symfony2 "KnpIpsum" Original code:https://github.com/KnpLabs/KnpIpsum   dotCloudized version:https://github.com/jpetazzo/ KnpIpsum/tree/dotcloud   (Make sure you use the "dotcloud" branch)
  • 30. To the Cloud, and beyond! 0: setup environment •  Create (free) account on www.dotcloud.com •  Install Python (!) •  pip  install  dotcloud   •  dotcloud  setup(Asks for login+password) (Note: web-based push is →← that close)
  • 31. To the Cloud, and beyond! 1: dotcloud.yml   •  The app is described by a small YAML file www:      type:  php      approot:  web   mongodb:      type:  mongodb   mysql:      type:  mysql  
  • 32. To the Cloud, and beyond! 2: dotCloud+Symfony2 •  dotCloud has Symfony2 docs •  The docs tell us we need a nginx.conf file •  That's because most people deploy Symfony2 on Apache + mod_php •  Symfony2 apps typically ship .htaccess  file •  We need the equivalent of that file → Drop nginx.conf file in the web directory.
  • 33. To the Cloud, and beyond! 3: application specifics •  README says to run a few manual steps:bin/vendors  install   php  app/console  doctrine:database:create   php  app/console  doctrine:schema:create   •  We will put those steps in a postinstall script (that's just a shell script called "postinstall"), and the postinstall script will be executed automatically when we deploy
  • 34. To the Cloud, and beyond! 4: deploy application $  dotcloud  create  symfonipsum   [...]   $  dotcloud  push   ==>  Pushing  code  with  rsync  from  "./"  to  application  symfonipsum   building  file  list  ...  done   [...uploading...]   [...and  a  couple  of  minutes  later...]   14:38:10.312838:  -­‐-­‐>  Application  (symfonipsum)  fully  installed   ==>  Application  is  live  at  http://symfonipsum-­‐skaya.dotcloud.com   But of course, it doesn't work: we never configured the database host/port/etc.
  • 35. To the Cloud, and beyond! 5: configure database •  Find out database information: $  dotcloud  info  mysql   [...]   ports:      ssh:      ssh://mysql@symfonipsum-­‐skaya.azva.dotcloud.net:12345      mysql:  mysql://root:XXX@symfonipsum-­‐skaya.azva.dotcloud.net:23456   •  Edit app/config/config.yml, update host/port/login/password •  Push again
  • 36. Quick break: "The Twelve Factor App" •  http://www.12factor.net/ •  http://www.12factor.net/config •  "Store config in the environment" o  App config = everything that is likely to vary between deploys (staging, production, developer env., etc.) o  Includes: database/memcached access information, credentials to external services (Twitter, S3...) o  Storing config as constants in the code is wrong! Please don't do it! o  A good test: can you open source the code without compromising any credential?
  • 37. To the Cloud, and beyond! 5bis: configure database •  dotCloud will put all information in two files: o  ~/environment.json   o  ~/environment.yml   •  We do the following changes: o  Update postinstall to generate ~/symfony.yml (using the information in environment.json) o  Update app/config/config.yml to import ~/symfony.yml   •  Push again
  • 38. To the Cloud, and beyond! 6: Multiplicate the Loaves $  dotcloud  create  ipsumdev   $  dotcloud  push   [...]   $  dotcloud  create  symfonymongotest   $  dotcloud  push   [...]  
  • 39. To the Cloud, and beyond! 7: Go live! $  dotcloud  create  ipsumprod  -­‐f  live   $  dotcloud  push   $  dotcloud  scale  db:instances=2   $  dotcloud  scale  www:memory=800M   $  dotcloud  domain  add  www  www.loremipsum.com  
  • 40. Drawbacks of PaaS •  One-time initial investment (small) o  Get familiar with the CLI, tools... •  Per-app initial investment (variable) o  Inject configuration variables o  Rework your app "for the Cloud" (when needed) o  Meddle Not In The Affairs Of Wizards!
  • 41.
  • 42. Drawbacks of PaaS •  One-time initial investment (small) o  Get familiar with the CLI, tools... •  Per-app initial investment (variable) o  Inject configuration variables o  Rework your app "for the Cloud" (when needed) o  Meddle Not In The Affairs Of Wizards! •  Higher apparent cost o  PaaS hosting can be 4x-10x more expensive o  Comes with 24x7 ops team, scaling, support o  Current PaaS don't leverage cheap hosts yet
  • 43. One more (semi-) Drawback of PaaS •  "dotcloud  run" (SSH access) doesn't work on the WiFi access in this conference! •  But we're working on that... (WebSocket tunneling of SSH) •  And you can't access your server, neither. (Unless you have a cunning VPN; OpenVPN running on 443/tcp anyone?) •  Meawhile, you can still push to dotCloud! Yaaay!
  • 44. Future of PaaS •  PaaS on your servers / local machine •  PaaS on a wide range of platforms (from cheap entry-level to high-end SSD) •  Support for more languages & databases •  Support for more frameworks •  More integration with 3rd parties (e.g. github)
  • 45. Thank you! Questions? @jpetazzo jerome@dotcloud.com www.dotcloud.com Slides deck: http://goo.gl/jZwdC Feedback: http://joind.in/8217