SlideShare uma empresa Scribd logo
1 de 94
Vagrant
                          A Crash Course



Marcus Deglos [@manarth]
TECHITO: Drupal. Architecture. Integration. Performance.
AN OVERVIEW




TECHITO: Drupal. Architecture. Integration. Performance.
What is Vagrant?
  • A tool for developers
  • A VM management tool
  • Automate the setup of your
    development environment


TECHITO: Drupal. Architecture. Integration. Performance.
Has this happened to you?




TECHITO: Drupal. Architecture. Integration. Performance.
New starter
  • Someone joins your project…
  • They pick up their laptop…
  • Then spend the next 1-2 days following
    instructions on setting up their
    environment, tools, etc.




TECHITO: Drupal. Architecture. Integration. Performance.
Instead, lets do this.




TECHITO: Drupal. Architecture. Integration. Performance.
New starter
  • Someone joins your project…
  • They pick up their laptop…
  • Then spend the next 10 minutes running a
    script which sets their environment up for
    them.




TECHITO: Drupal. Architecture. Integration. Performance.
STEP BY STEP




TECHITO: Drupal. Architecture. Integration. Performance.
Prerequisites
  • Virtualbox
  • Vagrant

  • Both Virtualbox and Vagrant have great,
    simple installation instructions.




TECHITO: Drupal. Architecture. Integration. Performance.
SETTING UP THE BOX
      Follow these steps once Virtualbox and Vagrant
      are installed.



TECHITO: Drupal. Architecture. Integration. Performance.
Getting set up
  •    Add a Vagrant box
  •    Create the VM
  •    Configure the VM
  •    Set up your project environment




TECHITO: Drupal. Architecture. Integration. Performance.
Adding a box*


                             *What’s a box? We’ll cover that shortly.




TECHITO: Drupal. Architecture. Integration. Performance.
Setting up Ubuntu Precise
     • vagrant box add ubuntu-precise
       http://cloud-
       images.ubuntu.com/precise/curren
       t/precise-server-cloudimg-
       vagrant-i386-disk1.box
     • vagrant init ubuntu-precise
     • vagrant up




TECHITO: Drupal. Architecture. Integration. Performance.
Adding the box
     • vagrant box add ubuntu-precise
       http://cloud-
       images.ubuntu.com/precise/curren
       t/precise-server-cloudimg-
       vagrant-i386-disk1.box




TECHITO: Drupal. Architecture. Integration. Performance.
Adding the box
     • vagrant box add ubuntu-precise
       http://cloud-
       images.ubuntu.com/precise/curren
       t/precise-server-cloudimg-
       vagrant-i386-disk1.box




TECHITO: Drupal. Architecture. Integration. Performance.
Adding the box
     • vagrant box add ubuntu-precise
       http://cloud-
       images.ubuntu.com/precise/curren
                         385 MB.
       t/precise-server-cloudimg-
       vagrant-i386-disk1.box boxes are
                         Most
                                                           350 – 500MB.




TECHITO: Drupal. Architecture. Integration. Performance.
Adding the box




TECHITO: Drupal. Architecture. Integration. Performance.
Getting set up
  •    Add a Vagrant box
  •    Create the VM
  •    Configure the VM
  •    Set up your project environment




TECHITO: Drupal. Architecture. Integration. Performance.
Start with a working dir.
  • mkdir –p ~/Development/awesome_project
  • cd ~/Development/awesome_project




TECHITO: Drupal. Architecture. Integration. Performance.
Initialise the Vagrant setup
  • vagrant init ubuntu-precise




TECHITO: Drupal. Architecture. Integration. Performance.
Launch the Vagrant VM
  • vagrant up




TECHITO: Drupal. Architecture. Integration. Performance.
Launch the Vagrant VM
  • vagrant up

            Your vagrant VM is built
            and ready to use.




TECHITO: Drupal. Architecture. Integration. Performance.
Getting set up
  •    Add a Vagrant box
  •    Create the VM
  •    Configure the VM
  •    Set up your project environment




TECHITO: Drupal. Architecture. Integration. Performance.
SSH to the VM
  • vagrant ssh




TECHITO: Drupal. Architecture. Integration. Performance.
Install all the things!
  • sudo apt-get install curl apache2 avahi-
    daemon avahi-discover avahi-utils gcc git-
    core libapache2-mod-dnssd make mysql-server
    samba subversion unzip vim php5 php-apc php5-
    cli php5-curl php5-dev php5-gd php5-memcache
    php5-memcached php5-mysqlnd php5-xdebug


  • These aren’t all essential, but make a good
    base for a good development environment.




TECHITO: Drupal. Architecture. Integration. Performance.
Install all the things!
  • sudo apt-get install curl apache2 avahi-
    daemon avahi-discover avahi-utils gcc git-
    core libapache2-mod-dnssd make mysql-server
    samba subversion unzip vim php5 php-apc php5-
    cli php5-curl php5-dev php5-gd php5-memcache
    php5-memcached php5-mysqlnd php5-xdebug




TECHITO: Drupal. Architecture. Integration. Performance.
Getting set up
  •    Add a Vagrant box
  •    Create the VM
  •    Configure the VM
  •    Set up your project environment




TECHITO: Drupal. Architecture. Integration. Performance.
Create a Drupal setup
  • sudo mkdir /srv/awesome_project
  • sudo chown vagrant:vagrant
    /srv/awesome_project
  • cd /srv/awesome_project
  • git clone
    git@github.com/example/awesome_project.git
    htdocs
  • mkdir /srv/awesome_project/conf
  • touch /srv/awesome_project/conf/httpd.conf
  • sudo ln –s
    /srv/awesome_project/conf/httpd.conf
    /etc/apache2/sites-
    available/awesome_project.conf
  • sudo ln –s ../sites-
    available/awesome_project.conf
    /etc/apache2/sites-enabled
TECHITO: Drupal. Architecture. Integration. Performance.
Set up your environment
  • mysql –e “GRANT ALL ON *.* TO
    „vagrant‟@‟localhost‟ IDENTIFIED BY „‟
    WITH GRANT OPTION”

  • Add whichever setup instructions are
    appropriate for your environment




TECHITO: Drupal. Architecture. Integration. Performance.
Manual
                                            setup


      MANUAL SETUP IS BAAD, MMKAY?




TECHITO: Drupal. Architecture. Integration. Performance.
STREAMLINING THE SETUP
      Manual installation is never efficient




TECHITO: Drupal. Architecture. Integration. Performance.
A stream-lined setup
                    Option 1 – A magick box.




TECHITO: Drupal. Architecture. Integration. Performance.
Start with a customised box
     • vagrant box add
       awesome_project
       http://boxes.example.com/super
       cool_drupal_project.box




TECHITO: Drupal. Architecture. Integration. Performance.
Start with a customised box
     • vagrant box add
       awesome_project
       http://boxes.example.com/super
       cool_drupal_project.box




                                           A magick box.
                                           I’ll explain later!
TECHITO: Drupal. Architecture. Integration. Performance.
Follow the standard setup
     • mkdir –p
       ~/Development/awesome_project
     • cd ~/Development/awesome_project
     • vagrant init awesome_project
     • vagrant up




TECHITO: Drupal. Architecture. Integration. Performance.
Connect to the box
     • vagrant ssh




TECHITO: Drupal. Architecture. Integration. Performance.
Verify what’s in the box
     • ls /srv/
     • which drush
     • mysql -e 'show databases;'




TECHITO: Drupal. Architecture. Integration. Performance.
Verify what’s in the box
     • ls /srv/
     • which drush
     • mysql -e 'show databases;'
     vagrant@vm-druprecise:~$ ls -l /srv/
     total 4
     drwxr-xr-x 3 root root 4096 Mar 10 18:28 foo.local




TECHITO: Drupal. Architecture. Integration. Performance.
Verify what’s in the box
     • ls /srv/
     • which drush
     • mysql -e 'show databases;'
     vagrant@vm-druprecise:~$ which drush
     /usr/local/bin/drush




TECHITO: Drupal. Architecture. Integration. Performance.
Verify what’s in the box
     • ls /srv/
     • which drush
     • mysql -e 'show databases;'
     vagrant@vm-druprecise:~$ mysql -e 'show databases';
     +--------------------+
     | Database           |
     +--------------------+
     | information_schema |
     | foo_local          |
     | mysql              |
     | performance_schema |
     | phpmyadmin         |
     +--------------------+
TECHITO: Drupal. Architecture. Integration. Performance.
Recap of all those steps
     • vagrant box add awesome_project
       http://boxes.example.com/superco
       ol_drupal_project.box
     • mkdir –p
       ~/Development/awesome_project
     • cd ~/Development/awesome_project
     • vagrant init awesome_project
     • vagrant up



TECHITO: Drupal. Architecture. Integration. Performance.
TECHITO: Drupal. Architecture. Integration. Performance.
A stream-lined setup
                 Option 2 – A vagrant config.




TECHITO: Drupal. Architecture. Integration. Performance.
Start with a build directory
     • mkdir –p
       ~/Development/awesome_project
     • cd ~/Development/awesome_project




TECHITO: Drupal. Architecture. Integration. Performance.
Checkout a Vagrant config
     • git clone
       git@github.com/Techito/vagrant_d
       rupal_box.git .




TECHITO: Drupal. Architecture. Integration. Performance.
Verify the checkout
     • ls -l




TECHITO: Drupal. Architecture. Integration. Performance.
Verify the checkout
     • ls -l




                                           Vagrantfile is
                                           required
TECHITO: Drupal. Architecture. Integration. Performance.
Verify the checkout
     • ls -l




                                           Puppet/chef setup
                                           automates the box
                                           provisioning
TECHITO: Drupal. Architecture. Integration. Performance.
Get Vagrant going
     • vagrant up




TECHITO: Drupal. Architecture. Integration. Performance.
Connect to the box
     • vagrant ssh




TECHITO: Drupal. Architecture. Integration. Performance.
Verify what’s in the box
     • ls /srv/
     • which drush
     • mysql -e 'show databases;'




TECHITO: Drupal. Architecture. Integration. Performance.
Verify what’s in the box
     • ls /srv/
     • which drush
     • mysql -e 'show databases;'
     vagrant@vm-druprecise:~$ ls -l /srv/
     total 4
     drwxr-xr-x 3 root root 4096 Mar 10 18:28 foo.local




TECHITO: Drupal. Architecture. Integration. Performance.
Verify what’s in the box
     • ls /srv/
     • which drush
     • mysql -e 'show databases;'
     vagrant@vm-druprecise:~$ which drush
     /usr/local/bin/drush




TECHITO: Drupal. Architecture. Integration. Performance.
Verify what’s in the box
     • ls /srv/
     • which drush
     • mysql -e 'show databases;'
     vagrant@vm-druprecise:~$ mysql -e 'show databases';
     +--------------------+
     | Database           |
     +--------------------+
     | information_schema |
     | foo_local          |
     | mysql              |
     | performance_schema |
     | phpmyadmin         |
     +--------------------+
TECHITO: Drupal. Architecture. Integration. Performance.
Recap of all those steps
     • mkdir –p
       ~/Development/awesome_project
     • cd
       ~/Development/awesome_project
     • git clone
       git@github.com/example/awesome
       _project.git .
     • vagrant up


TECHITO: Drupal. Architecture. Integration. Performance.
TECHITO: Drupal. Architecture. Integration. Performance.
Automated provisioning
                              =
                       super-quick setup




TECHITO: Drupal. Architecture. Integration. Performance.
VAGRANT VOCABULARY




TECHITO: Drupal. Architecture. Integration. Performance.
Vagrant Vocabulary
  • Virtualbox
    An application to run "Virtual machines" on your
    laptop/desktop.
  • Vagrant
    An application that automates the setup of VMs.
  • Host
    The laptop/desktop that runs Virtualbox +
    Vagrant.
  • Guest / Guest VM / Instance
    The virtual machine running within the host.

TECHITO: Drupal. Architecture. Integration. Performance.
Vagrant Vocabulary
  • Mount
    A way of sharing files between the host and guest (this
    is a simplification – search for "disk mount" for a more
    detailed explanation).
  • Provision / Provisioning
    Setting up the VM, installing packages, configuring
    users, etc.
  • Box / Base box
    A template for a Virtual Machine.
  • Vagrantfile
    A set of instructions to Vagrant on how to build and
    configure a VM.


TECHITO: Drupal. Architecture. Integration. Performance.
TWO APPROACHES
      A "magick" pre-packaged box, or a vagrant config
      structure.



TECHITO: Drupal. Architecture. Integration. Performance.
Standard practice
  • Start with a base-box of choice.
        – Ubuntu, CentOS, Debian…?
        – 32 bit vs 64 bit




TECHITO: Drupal. Architecture. Integration. Performance.
Standard practice
  • Start with a base-box of choice.
        – Ubuntu, CentOS, Debian…?
        – 32 bit vs 64 bit
  • Add a Vagrantfile.
        – `vagrant init` will give you a template




TECHITO: Drupal. Architecture. Integration. Performance.
Standard practice
  • Start with a base-box of choice.
        – Ubuntu, CentOS, Debian…?
        – 32 bit vs 64 bit
  • Add a Vagrantfile.
        – `vagrant init` will give you a template
  • Configure the Vagrantfile.
        – Hostname, network adapters, config paths…



TECHITO: Drupal. Architecture. Integration. Performance.
Standard practice
  • Start with a base-box of choice.
        – Ubuntu, CentOS, Debian…?
        – 32 bit vs 64 bit
  • Add a Vagrantfile.
        – `vagrant init` will give you a template
  • Configure the Vagrantfile.
        – Hostname, network adapters, config paths…

       Great docs at http://vagrantup.com/
TECHITO: Drupal. Architecture. Integration. Performance.
Standard practice
  • Start with a base-box of choice.
        – Ubuntu, CentOS, Debian…?
        – 32 bit vs 64 bit
  • Add a Vagrantfile.
        – `vagrant init` will give you a template
  • Configure the Vagrantfile.
        – Hostname, network adapters, config paths…



TECHITO: Drupal. Architecture. Integration. Performance.
Standard practice
  • Start with a base-box of choice.
        – Ubuntu, CentOS, Debian…?
        – 32 bit vs 64 bit
  • Add a Vagrantfile.
        – `vagrant init` will give you a template
  • Configure the Vagrantfile.
        – Hostname, network adapters, config paths…
  • Add puppet/chef manifests

TECHITO: Drupal. Architecture. Integration. Performance.
Standard practice
  • Start with a base-box of choice.
        – Ubuntu, CentOS, Debian…?
        – 32 bit vs 64 bit
  • Add a Vagrantfile.
        – `vagrant init` will giveI'll talk briefly on
                                   you a template
  • Configure the Vagrantfile.
                        puppet + chef shortly
        – Hostname, network adapters, config paths…
  • Add puppet/chef manifests

TECHITO: Drupal. Architecture. Integration. Performance.
What's in the "magick" box?
     • vagrant box add
       awesome_project
       http://boxes.example.com/super
       cool_drupal_project.box




                                           A magick box.

TECHITO: Drupal. Architecture. Integration. Performance.
What's in the "magick" box?
  • I started with a standard Vagrant base-box
    (I used the ubuntu-precise package, supplied
    by Canonical).
  • I tweaked the Vagrantfile, and added puppet
    config (in the same way as setting up a regular
    Vagrant VM).
  • I used a special packaging script to package
    the base-box, with the Vagrantfile and the
    puppet manifests included.

TECHITO: Drupal. Architecture. Integration. Performance.
What's in the "magick" box?
  • I started with a standard Vagrant base-box
    (I used the ubuntu-precise package, supplied
    by Canonical).
  • I tweaked the Vagrantfile, and added puppet
    config (in the same way as setting up a regular
    Vagrant VM).
  • I used a special packaging script to package
    the base-box, with the Vagrantfile and the
    puppet manifests included.

TECHITO: Drupal. Architecture. Integration. Performance.
What's in the "magick" box?
  • I started with a standard Vagrant base-box
    (I used the ubuntu-precise package, supplied
    by Canonical).
  • I tweaked the Vagrantfile, and added puppet
  Vagrant(in the same way as setting up a regular
    config  will package:
   Vagrant VM). (a virtual-disk standard)
      the 'vmdk'
   I used'ovf' (a Virtualbox script to package
  • the a special packaging VM descriptor)
    the base-box, with the Vagrantfile and the
    puppet manifests included.

TECHITO: Drupal. Architecture. Integration. Performance.
What's in the "magick" box?
  • I started with a standard Vagrant base-box
     (I used the ubuntu-precise package, supplied
     by Canonical).
  • I tweaked the Vagrantfile, and added puppet
     config (in the same way as setting up a regular
  It Vagrant VM).
     also added:
  • I usedVagrantfile
   My a special packaging script to package
     the base-box, with the Vagrantfile and the
   My custom puppet scripts
     puppet manifests included.

TECHITO: Drupal. Architecture. Integration. Performance.
What's in the "magick" box?
  • I started with a standard Vagrant base-box
    (I used the ubuntu-precise package, supplied
        Essentially the same as a
    by Canonical).
        standard Vagrant
  • I tweaked the Vagrantfile, and added puppet
    config (in the same way as setting up a regular
        config, except that
    Vagrant VM).
  • I used a special packaging packaged
        everything is all script to package
    the base-box, with the Vagrantfile and the
        together. included.
    puppet manifests

TECHITO: Drupal. Architecture. Integration. Performance.
Magick box vs standard config
  Magick                                              Standard
  • Simpler for junior                                • Standard practice.
    developers.                                       • No surprises, everything
  • Puppet/chef config tucked                            visible.
    away out of sight.                                • Easily updateable (and
  • Base-box and config stored                           version-controllable).
    together in one place.                            • No special packaging
  • Streamlined setup.                                   required.




TECHITO: Drupal. Architecture. Integration. Performance.
MAGICK BOX PACKAGING
      Two approaches: puppet/chef config only, or
      complete packaging.



TECHITO: Drupal. Architecture. Integration. Performance.
Packaging practices
  Puppet/chef only                                    Complete packaging
  • Smaller base-box.                                 • Larger base-box.
  • Requires internet access to                       • Ready to go without
    build.                                              needing internet access.
  • Always fetches latest                             • Packages may become out-
    version of the packages.                            of-date.




TECHITO: Drupal. Architecture. Integration. Performance.
CREATING YOUR OWN BASE BOX




TECHITO: Drupal. Architecture. Integration. Performance.
Why create a base box?
  • More flexibility than puppet/chef alone
  • Trusted source
  • Specific version of O/S (maybe you really want
    to run Slackware as your O/S of choice!)




TECHITO: Drupal. Architecture. Integration. Performance.
How to create a base box
  • Start by creating the VM in Virtualbox* as usual.
  • Follow community standards where possible
    (sizing of VM, disk, RAM, etc).
  • Add several Vagrant-specific tools (an SSH
    key, etc). Instructions on http://vagrantup.com/.
  • OR: use Veewee to build it for you.

  * Vagrant is becoming less Virtualbox-specific, so you may be
  able to use a different provider, such as VMWare.


TECHITO: Drupal. Architecture. Integration. Performance.
CHOOSING A BASEBOX




TECHITO: Drupal. Architecture. Integration. Performance.
Choosing a base box


                     http://vagrantbox.es/




TECHITO: Drupal. Architecture. Integration. Performance.
PUPPET OR CHEF?




TECHITO: Drupal. Architecture. Integration. Performance.
Puppet or Chef?
  • Puppet and Chef do the same thing –
    automated provisioning:
        – Installing packages (apt-get install / yum install)
        – Creating users + groups
        – Managing config files
        – Any provisioning task imaginable
          (but you might have to write the plugin)
  • Both are Ruby applications.
  • Both have an active open-source community.
TECHITO: Drupal. Architecture. Integration. Performance.
Puppet or Chef?
  • How do you choose?
        – Is anyone in your team familiar with either of
          them?
        – Do you use any modules/packages/vagrant setups
          which expect one or the other?
        – Can you easily find support (either paid-for or
          free) in your community?




TECHITO: Drupal. Architecture. Integration. Performance.
Puppet or chef resources
  Puppet                                              Chef
  • The Drupal.org testbots                           • Megalodon
    http://drupal.org/project/dr                        https://github.com/msonna
    upaltestbot-puppet                                  baum/megalodon
  • Demo from this talk                                 (native install, rather than
    https://github.com/Techito/                         VM).
    vagrant_drupal_box                                • Drupal Vagrant project
  • Project Oscar                                       http://drupal.org/project/v
    https://github.com/manart                           agrant
    h/oscar


TECHITO: Drupal. Architecture. Integration. Performance.
Key resources
  • Virtualbox
    https://www.virtualbox.org/
  • Vagrant
    http://vagrantup.com/
  • Base-box list
    http://www.vagrantbox.es/
  • Puppet resources
    http://puppetlabs.com/
  • Chef resources
    http://www.opscode.com/chef/

TECHITO: Drupal. Architecture. Integration. Performance.
Other resources
  • Drush Vagrant
    http://drupal.org/project/drush-vagrant
  • Veewee (to build base boxes)
    https://github.com/jedi4ever/veewee
  • IRC: #vagrant




TECHITO: Drupal. Architecture. Integration. Performance.
BEYOND VAGRANT & DEV VMS




TECHITO: Drupal. Architecture. Integration. Performance.
Beyond Vagrant & dev VMs
  • Vagrant is expanding to cover other provisioning
    tools:
        –   VMWare Fusion
        –   ESXi
        –   Amazon
        –   ???
  • Puppet and Chef can manage your
    test/stage/CI/production environments too.
  • Tools like Cobbler and Satellite can fully-automate
    the build of new VMs

TECHITO: Drupal. Architecture. Integration. Performance.
A QUICK SUMMARY




TECHITO: Drupal. Architecture. Integration. Performance.
Vagrant…
  • Automates the setup and installation of a local
    dev VM.
  • Create a fully-configured ready-to-go VM in
    minutes.
  • Basic usage doesn't need any new skills.
  • Advanced configuration possible with
    Veewee, Puppet and Chef.
  • To get started: download an open-source
    Vagrant setup, or build your own.

TECHITO: Drupal. Architecture. Integration. Performance.
Thanks for coming!
   Marcus Deglos
   Blog: http://deglos.com
   Email: marcus@techito.co.uk
   Slides: http://slideshare.net/manarth
   Twitter: @manarth

                                    Questions?
TECHITO: Drupal. Architecture. Integration. Performance.
 Build websites
     Develop modules
     Offer technical consultancy

    http://techito.co.uk/


TECHITO: Drupal. Architecture. Integration. Performance.

Mais conteúdo relacionado

Mais procurados

Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-OverviewCrifkin
 
Vagrant vs Docker
Vagrant vs DockerVagrant vs Docker
Vagrant vs Dockerjchase50
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and AgentRanjit Avasarala
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerGeorge Miranda
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeSarah Z
 
An Introduction to Vagrant and Docker
An Introduction to Vagrant and DockerAn Introduction to Vagrant and Docker
An Introduction to Vagrant and DockerScott Lowe
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
 
Vagrant + Ansible + Docker
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + DockerVijay Selvaraj
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetMichael Lessard
 
Automated Deployment with Capistrano
Automated Deployment with CapistranoAutomated Deployment with Capistrano
Automated Deployment with CapistranoSumit Chhetri
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...Puppet
 
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...Sebastian Neubauer
 
Building (localized) Vagrant boxes with Packer
Building (localized) Vagrant boxes with PackerBuilding (localized) Vagrant boxes with Packer
Building (localized) Vagrant boxes with PackerCristovao G. Verstraeten
 

Mais procurados (20)

Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
Vagrant vs Docker
Vagrant vs DockerVagrant vs Docker
Vagrant vs Docker
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
 
An Introduction to Vagrant and Docker
An Introduction to Vagrant and DockerAn Introduction to Vagrant and Docker
An Introduction to Vagrant and Docker
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Vagrant + Ansible + Docker
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + Docker
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
 
Automated Deployment with Capistrano
Automated Deployment with CapistranoAutomated Deployment with Capistrano
Automated Deployment with Capistrano
 
Vagrant
Vagrant Vagrant
Vagrant
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
 
Vagrant
VagrantVagrant
Vagrant
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
Exploring Docker Security
Exploring Docker SecurityExploring Docker Security
Exploring Docker Security
 
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
 
Building (localized) Vagrant boxes with Packer
Building (localized) Vagrant boxes with PackerBuilding (localized) Vagrant boxes with Packer
Building (localized) Vagrant boxes with Packer
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
 

Destaque

Linux Container Technology inside Docker with RHEL7
Linux Container Technology inside Docker with RHEL7Linux Container Technology inside Docker with RHEL7
Linux Container Technology inside Docker with RHEL7Etsuji Nakai
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Alex S
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker文峰 眭
 

Destaque (6)

Vagrant presentation
Vagrant presentationVagrant presentation
Vagrant presentation
 
Linux Container Technology inside Docker with RHEL7
Linux Container Technology inside Docker with RHEL7Linux Container Technology inside Docker with RHEL7
Linux Container Technology inside Docker with RHEL7
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker
 

Semelhante a Vagrant crash course

Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014Rafe Colton
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...Docker, Inc.
 
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016Patrick Chanezon
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoHannes Hapke
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzurePatrick Chanezon
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Patrick Chanezon
 
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
 
Deploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersDeploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersImesh Gunaratne
 
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on ContainersWSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on ContainersLakmal Warusawithana
 
Taking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetTaking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetPuppet
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013Tomas Doran
 
20150425 experimenting with openstack sahara on docker
20150425 experimenting with openstack sahara on docker20150425 experimenting with openstack sahara on docker
20150425 experimenting with openstack sahara on dockerWei Ting Chen
 
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
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkJérôme Petazzoni
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Jérôme Petazzoni
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandTroublemaker Khunpech
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsMicael Gallego
 

Semelhante a Vagrant crash course (20)

Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
 
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...
 
Deploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersDeploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on Containers
 
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on ContainersWSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
 
Taking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetTaking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and Puppet
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013
 
20150425 experimenting with openstack sahara on docker
20150425 experimenting with openstack sahara on docker20150425 experimenting with openstack sahara on docker
20150425 experimenting with openstack sahara on docker
 
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
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
 

Mais de Marcus Deglos

Drupal feature proposal: two new stream-wrappers
Drupal feature proposal: two new stream-wrappersDrupal feature proposal: two new stream-wrappers
Drupal feature proposal: two new stream-wrappersMarcus Deglos
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh thingsMarcus Deglos
 
Drupal haters gonna hate
Drupal haters gonna hateDrupal haters gonna hate
Drupal haters gonna hateMarcus Deglos
 
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2Marcus Deglos
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The SnailMarcus Deglos
 

Mais de Marcus Deglos (10)

Drupal feature proposal: two new stream-wrappers
Drupal feature proposal: two new stream-wrappersDrupal feature proposal: two new stream-wrappers
Drupal feature proposal: two new stream-wrappers
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh things
 
Drupal haters gonna hate
Drupal haters gonna hateDrupal haters gonna hate
Drupal haters gonna hate
 
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
 
With one click
With one clickWith one click
With one click
 
Panels rocks!
Panels rocks!Panels rocks!
Panels rocks!
 
Varnish bof
Varnish bofVarnish bof
Varnish bof
 
SSO To go
SSO To goSSO To go
SSO To go
 
Where in the world
Where in the worldWhere in the world
Where in the world
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
 

Vagrant crash course

  • 1. Vagrant A Crash Course Marcus Deglos [@manarth] TECHITO: Drupal. Architecture. Integration. Performance.
  • 2. AN OVERVIEW TECHITO: Drupal. Architecture. Integration. Performance.
  • 3. What is Vagrant? • A tool for developers • A VM management tool • Automate the setup of your development environment TECHITO: Drupal. Architecture. Integration. Performance.
  • 4. Has this happened to you? TECHITO: Drupal. Architecture. Integration. Performance.
  • 5. New starter • Someone joins your project… • They pick up their laptop… • Then spend the next 1-2 days following instructions on setting up their environment, tools, etc. TECHITO: Drupal. Architecture. Integration. Performance.
  • 6. Instead, lets do this. TECHITO: Drupal. Architecture. Integration. Performance.
  • 7. New starter • Someone joins your project… • They pick up their laptop… • Then spend the next 10 minutes running a script which sets their environment up for them. TECHITO: Drupal. Architecture. Integration. Performance.
  • 8. STEP BY STEP TECHITO: Drupal. Architecture. Integration. Performance.
  • 9. Prerequisites • Virtualbox • Vagrant • Both Virtualbox and Vagrant have great, simple installation instructions. TECHITO: Drupal. Architecture. Integration. Performance.
  • 10. SETTING UP THE BOX Follow these steps once Virtualbox and Vagrant are installed. TECHITO: Drupal. Architecture. Integration. Performance.
  • 11. Getting set up • Add a Vagrant box • Create the VM • Configure the VM • Set up your project environment TECHITO: Drupal. Architecture. Integration. Performance.
  • 12. Adding a box* *What’s a box? We’ll cover that shortly. TECHITO: Drupal. Architecture. Integration. Performance.
  • 13. Setting up Ubuntu Precise • vagrant box add ubuntu-precise http://cloud- images.ubuntu.com/precise/curren t/precise-server-cloudimg- vagrant-i386-disk1.box • vagrant init ubuntu-precise • vagrant up TECHITO: Drupal. Architecture. Integration. Performance.
  • 14. Adding the box • vagrant box add ubuntu-precise http://cloud- images.ubuntu.com/precise/curren t/precise-server-cloudimg- vagrant-i386-disk1.box TECHITO: Drupal. Architecture. Integration. Performance.
  • 15. Adding the box • vagrant box add ubuntu-precise http://cloud- images.ubuntu.com/precise/curren t/precise-server-cloudimg- vagrant-i386-disk1.box TECHITO: Drupal. Architecture. Integration. Performance.
  • 16. Adding the box • vagrant box add ubuntu-precise http://cloud- images.ubuntu.com/precise/curren 385 MB. t/precise-server-cloudimg- vagrant-i386-disk1.box boxes are Most 350 – 500MB. TECHITO: Drupal. Architecture. Integration. Performance.
  • 17. Adding the box TECHITO: Drupal. Architecture. Integration. Performance.
  • 18. Getting set up • Add a Vagrant box • Create the VM • Configure the VM • Set up your project environment TECHITO: Drupal. Architecture. Integration. Performance.
  • 19. Start with a working dir. • mkdir –p ~/Development/awesome_project • cd ~/Development/awesome_project TECHITO: Drupal. Architecture. Integration. Performance.
  • 20. Initialise the Vagrant setup • vagrant init ubuntu-precise TECHITO: Drupal. Architecture. Integration. Performance.
  • 21. Launch the Vagrant VM • vagrant up TECHITO: Drupal. Architecture. Integration. Performance.
  • 22. Launch the Vagrant VM • vagrant up Your vagrant VM is built and ready to use. TECHITO: Drupal. Architecture. Integration. Performance.
  • 23. Getting set up • Add a Vagrant box • Create the VM • Configure the VM • Set up your project environment TECHITO: Drupal. Architecture. Integration. Performance.
  • 24. SSH to the VM • vagrant ssh TECHITO: Drupal. Architecture. Integration. Performance.
  • 25. Install all the things! • sudo apt-get install curl apache2 avahi- daemon avahi-discover avahi-utils gcc git- core libapache2-mod-dnssd make mysql-server samba subversion unzip vim php5 php-apc php5- cli php5-curl php5-dev php5-gd php5-memcache php5-memcached php5-mysqlnd php5-xdebug • These aren’t all essential, but make a good base for a good development environment. TECHITO: Drupal. Architecture. Integration. Performance.
  • 26. Install all the things! • sudo apt-get install curl apache2 avahi- daemon avahi-discover avahi-utils gcc git- core libapache2-mod-dnssd make mysql-server samba subversion unzip vim php5 php-apc php5- cli php5-curl php5-dev php5-gd php5-memcache php5-memcached php5-mysqlnd php5-xdebug TECHITO: Drupal. Architecture. Integration. Performance.
  • 27. Getting set up • Add a Vagrant box • Create the VM • Configure the VM • Set up your project environment TECHITO: Drupal. Architecture. Integration. Performance.
  • 28. Create a Drupal setup • sudo mkdir /srv/awesome_project • sudo chown vagrant:vagrant /srv/awesome_project • cd /srv/awesome_project • git clone git@github.com/example/awesome_project.git htdocs • mkdir /srv/awesome_project/conf • touch /srv/awesome_project/conf/httpd.conf • sudo ln –s /srv/awesome_project/conf/httpd.conf /etc/apache2/sites- available/awesome_project.conf • sudo ln –s ../sites- available/awesome_project.conf /etc/apache2/sites-enabled TECHITO: Drupal. Architecture. Integration. Performance.
  • 29. Set up your environment • mysql –e “GRANT ALL ON *.* TO „vagrant‟@‟localhost‟ IDENTIFIED BY „‟ WITH GRANT OPTION” • Add whichever setup instructions are appropriate for your environment TECHITO: Drupal. Architecture. Integration. Performance.
  • 30. Manual setup MANUAL SETUP IS BAAD, MMKAY? TECHITO: Drupal. Architecture. Integration. Performance.
  • 31. STREAMLINING THE SETUP Manual installation is never efficient TECHITO: Drupal. Architecture. Integration. Performance.
  • 32. A stream-lined setup Option 1 – A magick box. TECHITO: Drupal. Architecture. Integration. Performance.
  • 33. Start with a customised box • vagrant box add awesome_project http://boxes.example.com/super cool_drupal_project.box TECHITO: Drupal. Architecture. Integration. Performance.
  • 34. Start with a customised box • vagrant box add awesome_project http://boxes.example.com/super cool_drupal_project.box A magick box. I’ll explain later! TECHITO: Drupal. Architecture. Integration. Performance.
  • 35. Follow the standard setup • mkdir –p ~/Development/awesome_project • cd ~/Development/awesome_project • vagrant init awesome_project • vagrant up TECHITO: Drupal. Architecture. Integration. Performance.
  • 36. Connect to the box • vagrant ssh TECHITO: Drupal. Architecture. Integration. Performance.
  • 37. Verify what’s in the box • ls /srv/ • which drush • mysql -e 'show databases;' TECHITO: Drupal. Architecture. Integration. Performance.
  • 38. Verify what’s in the box • ls /srv/ • which drush • mysql -e 'show databases;' vagrant@vm-druprecise:~$ ls -l /srv/ total 4 drwxr-xr-x 3 root root 4096 Mar 10 18:28 foo.local TECHITO: Drupal. Architecture. Integration. Performance.
  • 39. Verify what’s in the box • ls /srv/ • which drush • mysql -e 'show databases;' vagrant@vm-druprecise:~$ which drush /usr/local/bin/drush TECHITO: Drupal. Architecture. Integration. Performance.
  • 40. Verify what’s in the box • ls /srv/ • which drush • mysql -e 'show databases;' vagrant@vm-druprecise:~$ mysql -e 'show databases'; +--------------------+ | Database | +--------------------+ | information_schema | | foo_local | | mysql | | performance_schema | | phpmyadmin | +--------------------+ TECHITO: Drupal. Architecture. Integration. Performance.
  • 41. Recap of all those steps • vagrant box add awesome_project http://boxes.example.com/superco ol_drupal_project.box • mkdir –p ~/Development/awesome_project • cd ~/Development/awesome_project • vagrant init awesome_project • vagrant up TECHITO: Drupal. Architecture. Integration. Performance.
  • 42. TECHITO: Drupal. Architecture. Integration. Performance.
  • 43. A stream-lined setup Option 2 – A vagrant config. TECHITO: Drupal. Architecture. Integration. Performance.
  • 44. Start with a build directory • mkdir –p ~/Development/awesome_project • cd ~/Development/awesome_project TECHITO: Drupal. Architecture. Integration. Performance.
  • 45. Checkout a Vagrant config • git clone git@github.com/Techito/vagrant_d rupal_box.git . TECHITO: Drupal. Architecture. Integration. Performance.
  • 46. Verify the checkout • ls -l TECHITO: Drupal. Architecture. Integration. Performance.
  • 47. Verify the checkout • ls -l Vagrantfile is required TECHITO: Drupal. Architecture. Integration. Performance.
  • 48. Verify the checkout • ls -l Puppet/chef setup automates the box provisioning TECHITO: Drupal. Architecture. Integration. Performance.
  • 49. Get Vagrant going • vagrant up TECHITO: Drupal. Architecture. Integration. Performance.
  • 50. Connect to the box • vagrant ssh TECHITO: Drupal. Architecture. Integration. Performance.
  • 51. Verify what’s in the box • ls /srv/ • which drush • mysql -e 'show databases;' TECHITO: Drupal. Architecture. Integration. Performance.
  • 52. Verify what’s in the box • ls /srv/ • which drush • mysql -e 'show databases;' vagrant@vm-druprecise:~$ ls -l /srv/ total 4 drwxr-xr-x 3 root root 4096 Mar 10 18:28 foo.local TECHITO: Drupal. Architecture. Integration. Performance.
  • 53. Verify what’s in the box • ls /srv/ • which drush • mysql -e 'show databases;' vagrant@vm-druprecise:~$ which drush /usr/local/bin/drush TECHITO: Drupal. Architecture. Integration. Performance.
  • 54. Verify what’s in the box • ls /srv/ • which drush • mysql -e 'show databases;' vagrant@vm-druprecise:~$ mysql -e 'show databases'; +--------------------+ | Database | +--------------------+ | information_schema | | foo_local | | mysql | | performance_schema | | phpmyadmin | +--------------------+ TECHITO: Drupal. Architecture. Integration. Performance.
  • 55. Recap of all those steps • mkdir –p ~/Development/awesome_project • cd ~/Development/awesome_project • git clone git@github.com/example/awesome _project.git . • vagrant up TECHITO: Drupal. Architecture. Integration. Performance.
  • 56. TECHITO: Drupal. Architecture. Integration. Performance.
  • 57. Automated provisioning = super-quick setup TECHITO: Drupal. Architecture. Integration. Performance.
  • 58. VAGRANT VOCABULARY TECHITO: Drupal. Architecture. Integration. Performance.
  • 59. Vagrant Vocabulary • Virtualbox An application to run "Virtual machines" on your laptop/desktop. • Vagrant An application that automates the setup of VMs. • Host The laptop/desktop that runs Virtualbox + Vagrant. • Guest / Guest VM / Instance The virtual machine running within the host. TECHITO: Drupal. Architecture. Integration. Performance.
  • 60. Vagrant Vocabulary • Mount A way of sharing files between the host and guest (this is a simplification – search for "disk mount" for a more detailed explanation). • Provision / Provisioning Setting up the VM, installing packages, configuring users, etc. • Box / Base box A template for a Virtual Machine. • Vagrantfile A set of instructions to Vagrant on how to build and configure a VM. TECHITO: Drupal. Architecture. Integration. Performance.
  • 61. TWO APPROACHES A "magick" pre-packaged box, or a vagrant config structure. TECHITO: Drupal. Architecture. Integration. Performance.
  • 62. Standard practice • Start with a base-box of choice. – Ubuntu, CentOS, Debian…? – 32 bit vs 64 bit TECHITO: Drupal. Architecture. Integration. Performance.
  • 63. Standard practice • Start with a base-box of choice. – Ubuntu, CentOS, Debian…? – 32 bit vs 64 bit • Add a Vagrantfile. – `vagrant init` will give you a template TECHITO: Drupal. Architecture. Integration. Performance.
  • 64. Standard practice • Start with a base-box of choice. – Ubuntu, CentOS, Debian…? – 32 bit vs 64 bit • Add a Vagrantfile. – `vagrant init` will give you a template • Configure the Vagrantfile. – Hostname, network adapters, config paths… TECHITO: Drupal. Architecture. Integration. Performance.
  • 65. Standard practice • Start with a base-box of choice. – Ubuntu, CentOS, Debian…? – 32 bit vs 64 bit • Add a Vagrantfile. – `vagrant init` will give you a template • Configure the Vagrantfile. – Hostname, network adapters, config paths… Great docs at http://vagrantup.com/ TECHITO: Drupal. Architecture. Integration. Performance.
  • 66. Standard practice • Start with a base-box of choice. – Ubuntu, CentOS, Debian…? – 32 bit vs 64 bit • Add a Vagrantfile. – `vagrant init` will give you a template • Configure the Vagrantfile. – Hostname, network adapters, config paths… TECHITO: Drupal. Architecture. Integration. Performance.
  • 67. Standard practice • Start with a base-box of choice. – Ubuntu, CentOS, Debian…? – 32 bit vs 64 bit • Add a Vagrantfile. – `vagrant init` will give you a template • Configure the Vagrantfile. – Hostname, network adapters, config paths… • Add puppet/chef manifests TECHITO: Drupal. Architecture. Integration. Performance.
  • 68. Standard practice • Start with a base-box of choice. – Ubuntu, CentOS, Debian…? – 32 bit vs 64 bit • Add a Vagrantfile. – `vagrant init` will giveI'll talk briefly on you a template • Configure the Vagrantfile. puppet + chef shortly – Hostname, network adapters, config paths… • Add puppet/chef manifests TECHITO: Drupal. Architecture. Integration. Performance.
  • 69. What's in the "magick" box? • vagrant box add awesome_project http://boxes.example.com/super cool_drupal_project.box A magick box. TECHITO: Drupal. Architecture. Integration. Performance.
  • 70. What's in the "magick" box? • I started with a standard Vagrant base-box (I used the ubuntu-precise package, supplied by Canonical). • I tweaked the Vagrantfile, and added puppet config (in the same way as setting up a regular Vagrant VM). • I used a special packaging script to package the base-box, with the Vagrantfile and the puppet manifests included. TECHITO: Drupal. Architecture. Integration. Performance.
  • 71. What's in the "magick" box? • I started with a standard Vagrant base-box (I used the ubuntu-precise package, supplied by Canonical). • I tweaked the Vagrantfile, and added puppet config (in the same way as setting up a regular Vagrant VM). • I used a special packaging script to package the base-box, with the Vagrantfile and the puppet manifests included. TECHITO: Drupal. Architecture. Integration. Performance.
  • 72. What's in the "magick" box? • I started with a standard Vagrant base-box (I used the ubuntu-precise package, supplied by Canonical). • I tweaked the Vagrantfile, and added puppet Vagrant(in the same way as setting up a regular config will package:  Vagrant VM). (a virtual-disk standard) the 'vmdk'  I used'ovf' (a Virtualbox script to package • the a special packaging VM descriptor) the base-box, with the Vagrantfile and the puppet manifests included. TECHITO: Drupal. Architecture. Integration. Performance.
  • 73. What's in the "magick" box? • I started with a standard Vagrant base-box (I used the ubuntu-precise package, supplied by Canonical). • I tweaked the Vagrantfile, and added puppet config (in the same way as setting up a regular It Vagrant VM). also added: • I usedVagrantfile  My a special packaging script to package the base-box, with the Vagrantfile and the  My custom puppet scripts puppet manifests included. TECHITO: Drupal. Architecture. Integration. Performance.
  • 74. What's in the "magick" box? • I started with a standard Vagrant base-box (I used the ubuntu-precise package, supplied Essentially the same as a by Canonical). standard Vagrant • I tweaked the Vagrantfile, and added puppet config (in the same way as setting up a regular config, except that Vagrant VM). • I used a special packaging packaged everything is all script to package the base-box, with the Vagrantfile and the together. included. puppet manifests TECHITO: Drupal. Architecture. Integration. Performance.
  • 75. Magick box vs standard config Magick Standard • Simpler for junior • Standard practice. developers. • No surprises, everything • Puppet/chef config tucked visible. away out of sight. • Easily updateable (and • Base-box and config stored version-controllable). together in one place. • No special packaging • Streamlined setup. required. TECHITO: Drupal. Architecture. Integration. Performance.
  • 76. MAGICK BOX PACKAGING Two approaches: puppet/chef config only, or complete packaging. TECHITO: Drupal. Architecture. Integration. Performance.
  • 77. Packaging practices Puppet/chef only Complete packaging • Smaller base-box. • Larger base-box. • Requires internet access to • Ready to go without build. needing internet access. • Always fetches latest • Packages may become out- version of the packages. of-date. TECHITO: Drupal. Architecture. Integration. Performance.
  • 78. CREATING YOUR OWN BASE BOX TECHITO: Drupal. Architecture. Integration. Performance.
  • 79. Why create a base box? • More flexibility than puppet/chef alone • Trusted source • Specific version of O/S (maybe you really want to run Slackware as your O/S of choice!) TECHITO: Drupal. Architecture. Integration. Performance.
  • 80. How to create a base box • Start by creating the VM in Virtualbox* as usual. • Follow community standards where possible (sizing of VM, disk, RAM, etc). • Add several Vagrant-specific tools (an SSH key, etc). Instructions on http://vagrantup.com/. • OR: use Veewee to build it for you. * Vagrant is becoming less Virtualbox-specific, so you may be able to use a different provider, such as VMWare. TECHITO: Drupal. Architecture. Integration. Performance.
  • 81. CHOOSING A BASEBOX TECHITO: Drupal. Architecture. Integration. Performance.
  • 82. Choosing a base box http://vagrantbox.es/ TECHITO: Drupal. Architecture. Integration. Performance.
  • 83. PUPPET OR CHEF? TECHITO: Drupal. Architecture. Integration. Performance.
  • 84. Puppet or Chef? • Puppet and Chef do the same thing – automated provisioning: – Installing packages (apt-get install / yum install) – Creating users + groups – Managing config files – Any provisioning task imaginable (but you might have to write the plugin) • Both are Ruby applications. • Both have an active open-source community. TECHITO: Drupal. Architecture. Integration. Performance.
  • 85. Puppet or Chef? • How do you choose? – Is anyone in your team familiar with either of them? – Do you use any modules/packages/vagrant setups which expect one or the other? – Can you easily find support (either paid-for or free) in your community? TECHITO: Drupal. Architecture. Integration. Performance.
  • 86. Puppet or chef resources Puppet Chef • The Drupal.org testbots • Megalodon http://drupal.org/project/dr https://github.com/msonna upaltestbot-puppet baum/megalodon • Demo from this talk (native install, rather than https://github.com/Techito/ VM). vagrant_drupal_box • Drupal Vagrant project • Project Oscar http://drupal.org/project/v https://github.com/manart agrant h/oscar TECHITO: Drupal. Architecture. Integration. Performance.
  • 87. Key resources • Virtualbox https://www.virtualbox.org/ • Vagrant http://vagrantup.com/ • Base-box list http://www.vagrantbox.es/ • Puppet resources http://puppetlabs.com/ • Chef resources http://www.opscode.com/chef/ TECHITO: Drupal. Architecture. Integration. Performance.
  • 88. Other resources • Drush Vagrant http://drupal.org/project/drush-vagrant • Veewee (to build base boxes) https://github.com/jedi4ever/veewee • IRC: #vagrant TECHITO: Drupal. Architecture. Integration. Performance.
  • 89. BEYOND VAGRANT & DEV VMS TECHITO: Drupal. Architecture. Integration. Performance.
  • 90. Beyond Vagrant & dev VMs • Vagrant is expanding to cover other provisioning tools: – VMWare Fusion – ESXi – Amazon – ??? • Puppet and Chef can manage your test/stage/CI/production environments too. • Tools like Cobbler and Satellite can fully-automate the build of new VMs TECHITO: Drupal. Architecture. Integration. Performance.
  • 91. A QUICK SUMMARY TECHITO: Drupal. Architecture. Integration. Performance.
  • 92. Vagrant… • Automates the setup and installation of a local dev VM. • Create a fully-configured ready-to-go VM in minutes. • Basic usage doesn't need any new skills. • Advanced configuration possible with Veewee, Puppet and Chef. • To get started: download an open-source Vagrant setup, or build your own. TECHITO: Drupal. Architecture. Integration. Performance.
  • 93. Thanks for coming!  Marcus Deglos  Blog: http://deglos.com  Email: marcus@techito.co.uk  Slides: http://slideshare.net/manarth  Twitter: @manarth Questions? TECHITO: Drupal. Architecture. Integration. Performance.
  • 94.  Build websites  Develop modules  Offer technical consultancy http://techito.co.uk/ TECHITO: Drupal. Architecture. Integration. Performance.

Notas do Editor

  1. Nearly 100 boxes.