SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
Vagrant
Version control your dev environment

Bob Cribbs
Bob Cribbs
Software developer.
Focused mainly on Python, junior on Ruby and
getting started with mobile.
bocribbz

bocribbz

bocribbz

bocribbz

bocribbz

bocribbz.com
Development
environments
made easy.

www.vagrantup.com

Brasov Tech Meet | September 2013
You’re hired. Get the project up and running
on your new machine.
newguy$ git clone git://path-to-code-repo/super_project.git
Cloning into super_project
newguy$ cd super_project
newguy$ ...
newguy$ ./start.sh
Server listening on 127.0.0.1
We have a setup script!
newguy$ ./setup.sh
Installing software.
Installing dependencies.
Configuring.
Success!
We have a setup script!
● multiple ecosystems Win/Linux/MacOS
● multiple package managers yum, apt, homebrew, macports
● its likely some configuration will be done
differently
● its likely it will diverge from the production
environment
We have a README!
It gives precise instructions about what should
be installed and how it should be configured.

For a mature project, the README file ends up
being a few screens long.
We have a README!
● multiple ecosystems Win/Linux/MacOS
● very high chances something will be
misconfigured
● unlikely to be maintained, (most) developers
don’t write English
● time consuming
I’m sure you can do it!
newguy$ start.sh
Failed to connect to MySql at localhost:3333
newguy$ install mysql
newguy$ start.sh
Failed to connect to Redis at localhost:3334
newguy$ install redis
newguy$ start.sh
Missing ImageMagick extensions.
newguy$ install imagemagick
newguy$ start.sh
Server listening on 127.0.0.1
I’m sure you can do it!
Internal Server Error!
Problems
Not repeatable.
Not verifiably correct.
Not isolated.
Difficult to understand.
Problems
Not repeatable.
Not verifiably correct.
Not isolated.
Difficult to understand.

SLOW, SLOW, SLOW!
Vagrant
Its a tool for creating, managing and distributing
portable development environments.
Zero to VM in seconds
$ vagrant init precise32 
http://files.vagrantup.com/precise32.box
...
$ vagrant up
...
$ vagrant ssh
vagrant@precisebox32:~$ echo hello
hello
Problems solved
Repeatable
you can do the exact same thing when needed

Verifiably correct
you should have automation to check this

Isolated
its in a virtual machine (Vbox, VMWare, etc.)

Understandable
You can read it to understand

Fast(er)
It still takes some time, but it is much faster
Some Terms
Boxes
templates for creating a machine, preinstalled OS
Boxes
Snapshots / base operating system images.
Initial state of the VM.
Operating system (Ubuntu 12.04, CentOS 5.9,
etc.)
Can be packaged and shared.
eg. https://github.com/opscode/bento
Some Terms
Boxes
templates for creating a machine, preinstalled OS

Vagrantfile
configuration read by vagrant to create your machine
Vagrantfile samples
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
end

Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.provision "shell"
inline "apt-get update"
config.vm.provision "shell"
inline "apt-get install apache2"
end
Some Terms
Boxes
templates for creating a machine, preinstalled OS

Vagrantfile
configuration read by vagrant to create your machine

"vagrant" command
manages life cycle of the environment
"vagrant" command
vagrant init

Create a Vagrantfile in the current directory
vagrant up

Boot the VM
vagrant halt

Shutdown the VM
vagrant destroy

Delete the virtual machine
vagrant ssh

SSH into the VM
You’re hired. Get the project up and running
on your new machine.
newguy$ git clone git://path-to-code-repo/super_project.git
Cloning into super_project
newguy$ cd super_project
newguy$ vagrant up
Overview
1. Project specific configuration file
2. Import base box
3. Boot up virtual machine
a. Synced folders
b. Networking

4. Configure / provision software
Synced Folders
Automatically sync files from host to guest so
you can use your prefered editor on the host.
VirtualBox shared folders
VMWare shared folder
rsync (for AWS)
etc...
Synced Folders config
Vagrant.configure("2") do |config|
# ...
config.vm.shared_folder "path/on/host/",
"/path/on/guest/"
end
Networking
Configure how you will communicate with the VM or how
multiple VMs communicate with each other.
You can still use your prefered browser or tools to
communicate with the guest servers.
NAT: usually for port forwarding
Host-Only: private network
Bridge: act like a new device on the router/network
Networking config
Vagrant.configure("2") do |config|
# ...
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :private_network, ip: "192.168.3.10"
config.vm.network :public_network
end
Provisioning
You can use shell scripts, Puppet or Chef to
install and configure software.
Berkshelf
Create and manage cookbooks that install and
configure software dependencies.
Chef
Automation platform and nodes manager.
Transforms infrastructure into code.
Provisioning configs
Vagrant.configure("2") do |config|
# ...
config.vm.provision "shell", script "setup.sh"
end
Berkshelf
Manage cookbook and it’s dependencies.
http://community.opscode.com/
Create new cookbook and boilerplate configuration:
berks cookbook cookbook-projectname
Example
https://github.com/bocribbz/cookbook-lampdemo
LAMP demo
Show how Vagrant and Berkshelf work together.
Simple cookbook that installs Ubuntu, Apache,
MySQL, PHP and shows phpinfo().
LAMP demo
berks cookbook cookbook-lampdemo
LAMP demo - Vagrantfile
LAMP demo - metadata.rb
LAMP demo - Apache attributes
Setting attributes/apache.rb paths and other
variables used in the recipe.
LAMP demo - Apache recipe
LAMP demo - PHP recipe
LAMP demo - MySQL attrs & recipe
LAMP demo - vagrant up
LAMP demo
Questions
Thank you!

Mais conteúdo relacionado

Mais procurados

Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013Tomas Doran
 
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
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-OverviewCrifkin
 
Vagrant 101 Workshop
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 WorkshopLiora Milbaum
 
Using filesystem capabilities with rsync
Using filesystem capabilities with rsyncUsing filesystem capabilities with rsync
Using filesystem capabilities with rsyncHazel Smith
 
How we setup Rsync-powered Incremental Backups
How we setup Rsync-powered Incremental BackupsHow we setup Rsync-powered Incremental Backups
How we setup Rsync-powered Incremental Backupsnicholaspaun
 
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
 
Lightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetLightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetHendrik Ebbers
 
Automated reproducible images on openstack using vagrant and packer
Automated reproducible images on openstack using vagrant and packerAutomated reproducible images on openstack using vagrant and packer
Automated reproducible images on openstack using vagrant and packerJan Collijs
 
Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Kite Koga
 
Node.js Cloud deployment
Node.js Cloud deploymentNode.js Cloud deployment
Node.js Cloud deploymentNicholas McClay
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Puppet
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development SystemPaul Bearne
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechChristopher Bumgardner
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentTakayuki Miyauchi
 

Mais procurados (20)

Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013
 
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-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
 
Vagrant presentation
Vagrant presentationVagrant presentation
Vagrant presentation
 
Vagrant 101 Workshop
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 Workshop
 
Using filesystem capabilities with rsync
Using filesystem capabilities with rsyncUsing filesystem capabilities with rsync
Using filesystem capabilities with rsync
 
How we setup Rsync-powered Incremental Backups
How we setup Rsync-powered Incremental BackupsHow we setup Rsync-powered Incremental Backups
How we setup Rsync-powered Incremental Backups
 
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
 
Lightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetLightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and Puppet
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Automated reproducible images on openstack using vagrant and packer
Automated reproducible images on openstack using vagrant and packerAutomated reproducible images on openstack using vagrant and packer
Automated reproducible images on openstack using vagrant and packer
 
Light my-fuse
Light my-fuseLight my-fuse
Light my-fuse
 
Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41
 
Node.js Cloud deployment
Node.js Cloud deploymentNode.js Cloud deployment
Node.js Cloud deployment
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
 
Putting some "logic" in LVM.
Putting some "logic" in LVM.Putting some "logic" in LVM.
Putting some "logic" in LVM.
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development System
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment
 

Semelhante a Vagrant - Version control your dev environment

Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-Anatoly Bubenkov
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardwayDave Pitts
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...Acquia
 
Setup a Dev environment that feels like $HOME on Windows 10
Setup a Dev environment that feels like $HOME on Windows 10Setup a Dev environment that feels like $HOME on Windows 10
Setup a Dev environment that feels like $HOME on Windows 10Stefan Scherer
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easyMarco Silva
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksGlen Ogilvie
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerJohn Rofrano
 

Semelhante a Vagrant - Version control your dev environment (20)

Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Vagrant
VagrantVagrant
Vagrant
 
Vagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy Steps
 
Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
Keep calm and vagrant up
Keep calm and vagrant upKeep calm and vagrant up
Keep calm and vagrant up
 
Tech Talk - Vagrant
Tech Talk - VagrantTech Talk - Vagrant
Tech Talk - Vagrant
 
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
 
Setup a Dev environment that feels like $HOME on Windows 10
Setup a Dev environment that feels like $HOME on Windows 10Setup a Dev environment that feels like $HOME on Windows 10
Setup a Dev environment that feels like $HOME on Windows 10
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easy
 
Using vagrant
Using vagrantUsing vagrant
Using vagrant
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 

Último

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Vagrant - Version control your dev environment

  • 1. Vagrant Version control your dev environment Bob Cribbs
  • 2. Bob Cribbs Software developer. Focused mainly on Python, junior on Ruby and getting started with mobile. bocribbz bocribbz bocribbz bocribbz bocribbz bocribbz.com
  • 4. You’re hired. Get the project up and running on your new machine. newguy$ git clone git://path-to-code-repo/super_project.git Cloning into super_project newguy$ cd super_project newguy$ ... newguy$ ./start.sh Server listening on 127.0.0.1
  • 5. We have a setup script! newguy$ ./setup.sh Installing software. Installing dependencies. Configuring. Success!
  • 6. We have a setup script! ● multiple ecosystems Win/Linux/MacOS ● multiple package managers yum, apt, homebrew, macports ● its likely some configuration will be done differently ● its likely it will diverge from the production environment
  • 7. We have a README! It gives precise instructions about what should be installed and how it should be configured. For a mature project, the README file ends up being a few screens long.
  • 8. We have a README! ● multiple ecosystems Win/Linux/MacOS ● very high chances something will be misconfigured ● unlikely to be maintained, (most) developers don’t write English ● time consuming
  • 9. I’m sure you can do it! newguy$ start.sh Failed to connect to MySql at localhost:3333 newguy$ install mysql newguy$ start.sh Failed to connect to Redis at localhost:3334 newguy$ install redis newguy$ start.sh Missing ImageMagick extensions. newguy$ install imagemagick newguy$ start.sh Server listening on 127.0.0.1
  • 10. I’m sure you can do it! Internal Server Error!
  • 11. Problems Not repeatable. Not verifiably correct. Not isolated. Difficult to understand.
  • 12. Problems Not repeatable. Not verifiably correct. Not isolated. Difficult to understand. SLOW, SLOW, SLOW!
  • 13. Vagrant Its a tool for creating, managing and distributing portable development environments. Zero to VM in seconds $ vagrant init precise32 http://files.vagrantup.com/precise32.box ... $ vagrant up ... $ vagrant ssh vagrant@precisebox32:~$ echo hello hello
  • 14. Problems solved Repeatable you can do the exact same thing when needed Verifiably correct you should have automation to check this Isolated its in a virtual machine (Vbox, VMWare, etc.) Understandable You can read it to understand Fast(er) It still takes some time, but it is much faster
  • 15. Some Terms Boxes templates for creating a machine, preinstalled OS
  • 16. Boxes Snapshots / base operating system images. Initial state of the VM. Operating system (Ubuntu 12.04, CentOS 5.9, etc.) Can be packaged and shared. eg. https://github.com/opscode/bento
  • 17. Some Terms Boxes templates for creating a machine, preinstalled OS Vagrantfile configuration read by vagrant to create your machine
  • 18. Vagrantfile samples Vagrant.configure("2") do |config| config.vm.box = "precise32" end Vagrant.configure("2") do |config| config.vm.box = "precise32" config.vm.provision "shell" inline "apt-get update" config.vm.provision "shell" inline "apt-get install apache2" end
  • 19. Some Terms Boxes templates for creating a machine, preinstalled OS Vagrantfile configuration read by vagrant to create your machine "vagrant" command manages life cycle of the environment
  • 20. "vagrant" command vagrant init Create a Vagrantfile in the current directory vagrant up Boot the VM vagrant halt Shutdown the VM vagrant destroy Delete the virtual machine vagrant ssh SSH into the VM
  • 21. You’re hired. Get the project up and running on your new machine. newguy$ git clone git://path-to-code-repo/super_project.git Cloning into super_project newguy$ cd super_project newguy$ vagrant up
  • 22. Overview 1. Project specific configuration file 2. Import base box 3. Boot up virtual machine a. Synced folders b. Networking 4. Configure / provision software
  • 23. Synced Folders Automatically sync files from host to guest so you can use your prefered editor on the host. VirtualBox shared folders VMWare shared folder rsync (for AWS) etc...
  • 24. Synced Folders config Vagrant.configure("2") do |config| # ... config.vm.shared_folder "path/on/host/", "/path/on/guest/" end
  • 25. Networking Configure how you will communicate with the VM or how multiple VMs communicate with each other. You can still use your prefered browser or tools to communicate with the guest servers. NAT: usually for port forwarding Host-Only: private network Bridge: act like a new device on the router/network
  • 26. Networking config Vagrant.configure("2") do |config| # ... config.vm.network :forwarded_port, guest: 80, host: 8080 config.vm.network :private_network, ip: "192.168.3.10" config.vm.network :public_network end
  • 27. Provisioning You can use shell scripts, Puppet or Chef to install and configure software. Berkshelf Create and manage cookbooks that install and configure software dependencies. Chef Automation platform and nodes manager. Transforms infrastructure into code.
  • 28. Provisioning configs Vagrant.configure("2") do |config| # ... config.vm.provision "shell", script "setup.sh" end
  • 29. Berkshelf Manage cookbook and it’s dependencies. http://community.opscode.com/ Create new cookbook and boilerplate configuration: berks cookbook cookbook-projectname
  • 31. LAMP demo Show how Vagrant and Berkshelf work together. Simple cookbook that installs Ubuntu, Apache, MySQL, PHP and shows phpinfo().
  • 32. LAMP demo berks cookbook cookbook-lampdemo
  • 33. LAMP demo - Vagrantfile
  • 34. LAMP demo - metadata.rb
  • 35. LAMP demo - Apache attributes Setting attributes/apache.rb paths and other variables used in the recipe.
  • 36. LAMP demo - Apache recipe
  • 37. LAMP demo - PHP recipe
  • 38. LAMP demo - MySQL attrs & recipe
  • 39. LAMP demo - vagrant up