SlideShare una empresa de Scribd logo
1 de 44
Vagrant for Developers
Presenter
- Technology Architect at Accenture
- 10+ years Enterprise Java Developmentg
- Areas of work:
- Open Source activist
- DevOps evangelist
- Technical and OO Trainer
- Cloud and PaaS development
http://www.linkedin.com/in/antonskranga
Motivation
Basic Vagrant Usage
Provisioning with Cookbooks
Base Images Creation
Agenda
Motivation
Basic Vagrant Usage
Provisioning with Cookbooks
Base Images Creation
Agenda
How do you manage your Dev Env?
Low or no automation at all
Long error-prone install guides
Painful maintenance or recovery
Painful rollback
No team collaboration
Host everything natviely
Master Image contains:
- All software installed
- All configuration
Hosted typically in project File Server
Often maintained by one Person
No team collaboration
Master Image
Master Image: Problems
Hard to distribute in big teams
Maintenance process is manual
Hard to maintain in parallel
Cannot use Version Control System
Just Enough Operating System
- Written declaratively
(just enough ruby DSL)
- Repeatable
- OS agnostic
- Source control
- Help from Community
- Testable
JEOS
Naked OS Configuration
V for Vagrant
www.vagrantup.com Off Site
www.vagrantbox.es VM Images
https://github.com/opscode/bento VM Images from Chef
Useful Links:
Vagrant
- Vagrant will mange VM for you
- Can create whole stack of VMs
- Describe VM resources in Configuration
- Can put configuration in Source Control
- Easy to distribute and update
Motivation
Basic Vagrant Usage
Provisioning with Cookbooks
Base Images Creation
Agenda
Quick start
shell
$ vagrant up
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-1"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
end
Quick start v2
shell
$ vagrant box add NAME http://files.vagrantup.com/precise64.box
$ vagrant init
# modify Vagrantfile until you happy
$ vagrant up
Most useful commands
shell
$ vagrant ssh # Connect to VM
$ vagrant reload # Connect to VM
$ vagrant halt # Stop VM
$ vagrant destroy # delete VM
$ vagrant package # Create snapshot (.box file)
Modifying scripts
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-1"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
end
Modifying scripts
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-1"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “vmhost"
end
Modifying scripts
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-1"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “vmhost"
config.vm.network :forwarded_port, guest: 80, host: 1080
end
Modifying scripts
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-1"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “vmhost"
config.vm.network :forwarded_port, guest: 80, host: 1080
config.vm.synced_folder “webapp/", "/var/www"
end
Modifying scripts
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-1"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “vmhost"
config.vm.network :forwarded_port, guest: 80, host: 1080
config.vm.synced_folder “webapp/", "/var/www“
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 1024]
end
end
Demo
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.define :ubuntu1204 do |ubuntu1204|
ubuntu1204.vm.box = "example4-ubuntu-12.10"
ubuntu1204.vm.box_url = "http://files.vagrantup..."
ubuntu1204.vm.hostname = "example4-ubuntu-1210"
ubuntu1204.vm.network :forwarded_port, guest: 80, host: 1080
ubuntu1204.vm.network :private_network, ip: "34.33.33.10"
end
config.vm.define :ubuntu1310 do |ubuntu1310|
ubuntu1310.vm.box = "example4-ubuntu-13.10"
ubuntu1310.vm.box_url = "http://files.vagrantup..."
ubuntu1310.vm.hostname = "example4-ubuntu-1310"
ubuntu1204.vm.network :forwarded_port, guest: 80, host: 2080
ubuntu1204.vm.network :private_network, ip: "34.33.33.11"
end
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 1024]
end
end
Motivation
Basic Vagrant Usage
Provisioning with Cookbooks
Base Images Creation
Agenda
- You declare what software you want
- Chef will provision it for you
- Over 1300 cookbooks
Chef
Before you start
shell
# install Chef plugin
$ vagrant plugin install vagrant-omnibus
# install Berkshelf plugin
$ vagrant plugin install vagrant-berkshelf
# Kind of apt-cache for Vagrant
$ vagrant plugin install vagrant-cachier
Update configuration
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-5"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “localhost"
config.vm.network :forwarded_port, guest: 80, host: 1080
config.vm.synced_folder “webapp/", "/var/www“
config.omnibus.chef_version = :latest
config.berkshelf.enabled = true
config.cache.auto_detect = true
end
Update configuration
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-5"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “localhost"
config.vm.network :forwarded_port, guest: 80, host: 1080
config.vm.synced_folder “webapp/", "/var/www“
config.omnibus.chef_version = :latest
config.berkshelf.enabled = true
config.cache.auto_detect = true
config.vm.provision :chef_solo do |chef|
chef.add_recipe “apache2“
end
end
Create berkshelf configuration
Berksfile
site :opscode
metadata
cookbook "apache2"
Provisioning commands
shell
# to provision for first time just enough
$ vagrant up
# to restart VM
$ vagrant reload --provision
# to provision without restart
$ vagrant provision
Demo
Create berkshelf configuration
Berksfile
site :opscode
metadata
cookbook 'apt'
cookbook 'git'
cookbook 'tomcat', git: "https://github.com/opscode-cookbooks/tomcat.git"
cookbook 'maven'
cookbook 'mongodb'
# cookbook 'mycookbook', :path => "cookbooks/mycookbook"
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-5"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “localhost"
config.vm.network :forwarded_port, guest: 8080, host: 1080
config.omnibus.chef_version = :latest
config.berkshelf.enabled = true
config.cache.auto_detect = true
config.vm.provision :chef_solo do |chef|
chef.add_recipe "mongodb::10gen_repo"
chef.add_recipe "apt"
chef.add_recipe "git"
chef.add_recipe "maven"
chef.add_recipe "mongodb"
chef.add_recipe "tomcat"
end
end
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-5"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “localhost"
config.vm.network :forwarded_port, guest: 8080, host: 1080
...
config.vm.provision :chef_solo do |chef|
chef.add_recipe "mongodb::10gen_repo"
chef.add_recipe "apt"
chef.add_recipe "git"
chef.add_recipe "maven"
chef.add_recipe "mongodb"
chef.add_recipe "tomcat"
chef.json = {
"java" => {
"jdk_version" => "7",
"install_flavor" => "openjdk"
}
}
end
end
Vagrantfile
Vagrant.configure "2" do |config|
config.vm.box = "vagrant-5"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = “localhost"
config.vm.network :forwarded_port, guest: 8080, host: 1080
...
config.vm.provision :chef_solo do |chef|
chef.add_recipe "mongodb::10gen_repo"
chef.add_recipe "apt"
chef.add_recipe "git"
chef.add_recipe "maven"
chef.add_recipe "mongodb"
chef.add_recipe "tomcat"
chef.json = {
"java" => {
"jdk_version" => "7",
"install_flavor" => "oracle",
"accept_oracle_download_terms" => true
}
}
end
end
Motivation
Basic Vagrant Usage
Provisioning with Cookbooks
Base Images Creation
Agenda
Motivation
Custom project specifics
OS-level patching
Produce Stemcells
(preinstalled images)
True Infra-as-code
Tools we need
“Packer is a tool for creating identical
machine images for multiple platforms…”
- Off Site: packer.io
- Written in Go
- Must be installed to ~/pakcer
“Bento is set of Packer templates for
building Vagrant baseboxes”
- Off Site: opscode.github.io/bento/
- Maintained by Chef
Shell
$ git clone https://github.com/opscode/bento.git
$ cd bento/packer
bento/packer $ packer build ubuntu-13.10-amd64.json
Quick start with Packer
Shell
$ git clone https://github.com/opscode/bento.git
$ cd bento/packer
bento/packer $ packer build ubuntu-13.10-amd64.json
Quick start with Packer
Shell
bento/packer $ packer build 
-only=virtualbox-iso 
ubuntu-13.10-amd64.json
Little bit more tuning
Shell
bento/packer $ packer build 
-only=virtualbox 
-var-file=variables.json
ubuntu-13.10-amd64.json
Little bit more tuning
variables.json
{
"chef_version": "latest",
"mirror": "../builds/iso/"
}
Demo
Thank You!

Más contenido relacionado

La actualidad más candente

Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaJuan Diego Pereiro Arean
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Puppet
 
It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentCarlos Perez
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3kognate
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreChef Software, Inc.
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = CodeGeorg Sorst
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year laterChristian Ortner
 
Docker Docker Docker Chef
Docker Docker Docker ChefDocker Docker Docker Chef
Docker Docker Docker ChefSean OMeara
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Carlos Sanchez
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingRed Hat Developers
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Michele Orselli
 
London Community Summit - Habitat 2016
London Community Summit - Habitat 2016London Community Summit - Habitat 2016
London Community Summit - Habitat 2016Sarah Richards
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Deploying an application with Chef and Docker
Deploying an application with Chef and DockerDeploying an application with Chef and Docker
Deploying an application with Chef and DockerDaniel Ku
 
Docker for (Java) Developers
Docker for (Java) DevelopersDocker for (Java) Developers
Docker for (Java) DevelopersRafael Benevides
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Julian Dunn
 

La actualidad más candente (20)

Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers Galicia
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and more
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 
Docker Docker Docker Chef
Docker Docker Docker ChefDocker Docker Docker Chef
Docker Docker Docker Chef
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scripting
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
London Community Summit - Habitat 2016
London Community Summit - Habitat 2016London Community Summit - Habitat 2016
London Community Summit - Habitat 2016
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Deploying an application with Chef and Docker
Deploying an application with Chef and DockerDeploying an application with Chef and Docker
Deploying an application with Chef and Docker
 
Docker for (Java) Developers
Docker for (Java) DevelopersDocker for (Java) Developers
Docker for (Java) Developers
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
 

Destacado

Riga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWSRiga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWSAntons Kranga
 
DevOps Days Tel Aviv - Serverless Architecture
DevOps Days Tel Aviv - Serverless ArchitectureDevOps Days Tel Aviv - Serverless Architecture
DevOps Days Tel Aviv - Serverless ArchitectureAntons Kranga
 
DevTernity - DevOps with smell
DevTernity - DevOps with smellDevTernity - DevOps with smell
DevTernity - DevOps with smellAntons Kranga
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile InfrastructuresAntons Kranga
 
JavaDay Lviv: Serverless Archtiectures
JavaDay Lviv: Serverless ArchtiecturesJavaDay Lviv: Serverless Archtiectures
JavaDay Lviv: Serverless ArchtiecturesAntons Kranga
 
OpenSlava Infrastructure Automation Patterns
OpenSlava   Infrastructure Automation PatternsOpenSlava   Infrastructure Automation Patterns
OpenSlava Infrastructure Automation PatternsAntons Kranga
 
DevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven InfrastructureDevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven InfrastructureAntons Kranga
 
OpenSlava 2014 - CloudFoundry inside-out
OpenSlava 2014 - CloudFoundry inside-outOpenSlava 2014 - CloudFoundry inside-out
OpenSlava 2014 - CloudFoundry inside-outAntons Kranga
 
Dev ops with smell v1.2
Dev ops with smell v1.2Dev ops with smell v1.2
Dev ops with smell v1.2Antons Kranga
 

Destacado (10)

Riga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWSRiga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWS
 
DevOps Days Tel Aviv - Serverless Architecture
DevOps Days Tel Aviv - Serverless ArchitectureDevOps Days Tel Aviv - Serverless Architecture
DevOps Days Tel Aviv - Serverless Architecture
 
Robert kiyosaki pdf
Robert kiyosaki pdfRobert kiyosaki pdf
Robert kiyosaki pdf
 
DevTernity - DevOps with smell
DevTernity - DevOps with smellDevTernity - DevOps with smell
DevTernity - DevOps with smell
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
 
JavaDay Lviv: Serverless Archtiectures
JavaDay Lviv: Serverless ArchtiecturesJavaDay Lviv: Serverless Archtiectures
JavaDay Lviv: Serverless Archtiectures
 
OpenSlava Infrastructure Automation Patterns
OpenSlava   Infrastructure Automation PatternsOpenSlava   Infrastructure Automation Patterns
OpenSlava Infrastructure Automation Patterns
 
DevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven InfrastructureDevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven Infrastructure
 
OpenSlava 2014 - CloudFoundry inside-out
OpenSlava 2014 - CloudFoundry inside-outOpenSlava 2014 - CloudFoundry inside-out
OpenSlava 2014 - CloudFoundry inside-out
 
Dev ops with smell v1.2
Dev ops with smell v1.2Dev ops with smell v1.2
Dev ops with smell v1.2
 

Similar a Vagrant introduction for Developers

Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
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
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de VagrantLeandro Nunes
 
Using Vagrant
Using VagrantUsing Vagrant
Using Vagrantandygale
 
Vagrant and Configuration Management
Vagrant and Configuration ManagementVagrant and Configuration Management
Vagrant and Configuration ManagementGareth Rushgrove
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015yfauser
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp HamiltonPaul Bearne
 
Professional deployment
Professional deploymentProfessional deployment
Professional deploymentIvelina Dimova
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for realCodemotion
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012Carlos Sanchez
 
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
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012Carlos Sanchez
 

Similar a Vagrant introduction for Developers (20)

Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
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
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
 
Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
 
Vagrant and Configuration Management
Vagrant and Configuration ManagementVagrant and Configuration Management
Vagrant and Configuration Management
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp Hamilton
 
Professional deployment
Professional deploymentProfessional deployment
Professional deployment
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
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
 
Vagrant
Vagrant Vagrant
Vagrant
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Vagrant introduction for Developers

  • 2. Presenter - Technology Architect at Accenture - 10+ years Enterprise Java Developmentg - Areas of work: - Open Source activist - DevOps evangelist - Technical and OO Trainer - Cloud and PaaS development http://www.linkedin.com/in/antonskranga
  • 3. Motivation Basic Vagrant Usage Provisioning with Cookbooks Base Images Creation Agenda
  • 4. Motivation Basic Vagrant Usage Provisioning with Cookbooks Base Images Creation Agenda
  • 5. How do you manage your Dev Env?
  • 6. Low or no automation at all Long error-prone install guides Painful maintenance or recovery Painful rollback No team collaboration Host everything natviely
  • 7. Master Image contains: - All software installed - All configuration Hosted typically in project File Server Often maintained by one Person No team collaboration Master Image
  • 8. Master Image: Problems Hard to distribute in big teams Maintenance process is manual Hard to maintain in parallel Cannot use Version Control System
  • 10. - Written declaratively (just enough ruby DSL) - Repeatable - OS agnostic - Source control - Help from Community - Testable JEOS Naked OS Configuration
  • 11. V for Vagrant www.vagrantup.com Off Site www.vagrantbox.es VM Images https://github.com/opscode/bento VM Images from Chef Useful Links:
  • 12. Vagrant - Vagrant will mange VM for you - Can create whole stack of VMs - Describe VM resources in Configuration - Can put configuration in Source Control - Easy to distribute and update
  • 13. Motivation Basic Vagrant Usage Provisioning with Cookbooks Base Images Creation Agenda
  • 14. Quick start shell $ vagrant up Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-1" config.vm.box_url = "http://files.vagrantup.com/precise64.box" end
  • 15. Quick start v2 shell $ vagrant box add NAME http://files.vagrantup.com/precise64.box $ vagrant init # modify Vagrantfile until you happy $ vagrant up
  • 16. Most useful commands shell $ vagrant ssh # Connect to VM $ vagrant reload # Connect to VM $ vagrant halt # Stop VM $ vagrant destroy # delete VM $ vagrant package # Create snapshot (.box file)
  • 17. Modifying scripts Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-1" config.vm.box_url = "http://files.vagrantup.com/precise64.box" end
  • 18. Modifying scripts Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-1" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “vmhost" end
  • 19. Modifying scripts Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-1" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “vmhost" config.vm.network :forwarded_port, guest: 80, host: 1080 end
  • 20. Modifying scripts Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-1" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “vmhost" config.vm.network :forwarded_port, guest: 80, host: 1080 config.vm.synced_folder “webapp/", "/var/www" end
  • 21. Modifying scripts Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-1" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “vmhost" config.vm.network :forwarded_port, guest: 80, host: 1080 config.vm.synced_folder “webapp/", "/var/www“ config.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--memory", 1024] end end
  • 22. Demo
  • 23. Vagrantfile Vagrant.configure "2" do |config| config.vm.define :ubuntu1204 do |ubuntu1204| ubuntu1204.vm.box = "example4-ubuntu-12.10" ubuntu1204.vm.box_url = "http://files.vagrantup..." ubuntu1204.vm.hostname = "example4-ubuntu-1210" ubuntu1204.vm.network :forwarded_port, guest: 80, host: 1080 ubuntu1204.vm.network :private_network, ip: "34.33.33.10" end config.vm.define :ubuntu1310 do |ubuntu1310| ubuntu1310.vm.box = "example4-ubuntu-13.10" ubuntu1310.vm.box_url = "http://files.vagrantup..." ubuntu1310.vm.hostname = "example4-ubuntu-1310" ubuntu1204.vm.network :forwarded_port, guest: 80, host: 2080 ubuntu1204.vm.network :private_network, ip: "34.33.33.11" end config.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--memory", 1024] end end
  • 24. Motivation Basic Vagrant Usage Provisioning with Cookbooks Base Images Creation Agenda
  • 25. - You declare what software you want - Chef will provision it for you - Over 1300 cookbooks Chef
  • 26. Before you start shell # install Chef plugin $ vagrant plugin install vagrant-omnibus # install Berkshelf plugin $ vagrant plugin install vagrant-berkshelf # Kind of apt-cache for Vagrant $ vagrant plugin install vagrant-cachier
  • 27. Update configuration Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-5" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “localhost" config.vm.network :forwarded_port, guest: 80, host: 1080 config.vm.synced_folder “webapp/", "/var/www“ config.omnibus.chef_version = :latest config.berkshelf.enabled = true config.cache.auto_detect = true end
  • 28. Update configuration Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-5" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “localhost" config.vm.network :forwarded_port, guest: 80, host: 1080 config.vm.synced_folder “webapp/", "/var/www“ config.omnibus.chef_version = :latest config.berkshelf.enabled = true config.cache.auto_detect = true config.vm.provision :chef_solo do |chef| chef.add_recipe “apache2“ end end
  • 29. Create berkshelf configuration Berksfile site :opscode metadata cookbook "apache2"
  • 30. Provisioning commands shell # to provision for first time just enough $ vagrant up # to restart VM $ vagrant reload --provision # to provision without restart $ vagrant provision
  • 31. Demo
  • 32. Create berkshelf configuration Berksfile site :opscode metadata cookbook 'apt' cookbook 'git' cookbook 'tomcat', git: "https://github.com/opscode-cookbooks/tomcat.git" cookbook 'maven' cookbook 'mongodb' # cookbook 'mycookbook', :path => "cookbooks/mycookbook"
  • 33. Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-5" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “localhost" config.vm.network :forwarded_port, guest: 8080, host: 1080 config.omnibus.chef_version = :latest config.berkshelf.enabled = true config.cache.auto_detect = true config.vm.provision :chef_solo do |chef| chef.add_recipe "mongodb::10gen_repo" chef.add_recipe "apt" chef.add_recipe "git" chef.add_recipe "maven" chef.add_recipe "mongodb" chef.add_recipe "tomcat" end end
  • 34. Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-5" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “localhost" config.vm.network :forwarded_port, guest: 8080, host: 1080 ... config.vm.provision :chef_solo do |chef| chef.add_recipe "mongodb::10gen_repo" chef.add_recipe "apt" chef.add_recipe "git" chef.add_recipe "maven" chef.add_recipe "mongodb" chef.add_recipe "tomcat" chef.json = { "java" => { "jdk_version" => "7", "install_flavor" => "openjdk" } } end end
  • 35. Vagrantfile Vagrant.configure "2" do |config| config.vm.box = "vagrant-5" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.hostname = “localhost" config.vm.network :forwarded_port, guest: 8080, host: 1080 ... config.vm.provision :chef_solo do |chef| chef.add_recipe "mongodb::10gen_repo" chef.add_recipe "apt" chef.add_recipe "git" chef.add_recipe "maven" chef.add_recipe "mongodb" chef.add_recipe "tomcat" chef.json = { "java" => { "jdk_version" => "7", "install_flavor" => "oracle", "accept_oracle_download_terms" => true } } end end
  • 36. Motivation Basic Vagrant Usage Provisioning with Cookbooks Base Images Creation Agenda
  • 37. Motivation Custom project specifics OS-level patching Produce Stemcells (preinstalled images) True Infra-as-code
  • 38. Tools we need “Packer is a tool for creating identical machine images for multiple platforms…” - Off Site: packer.io - Written in Go - Must be installed to ~/pakcer “Bento is set of Packer templates for building Vagrant baseboxes” - Off Site: opscode.github.io/bento/ - Maintained by Chef
  • 39. Shell $ git clone https://github.com/opscode/bento.git $ cd bento/packer bento/packer $ packer build ubuntu-13.10-amd64.json Quick start with Packer
  • 40. Shell $ git clone https://github.com/opscode/bento.git $ cd bento/packer bento/packer $ packer build ubuntu-13.10-amd64.json Quick start with Packer
  • 41. Shell bento/packer $ packer build -only=virtualbox-iso ubuntu-13.10-amd64.json Little bit more tuning
  • 42. Shell bento/packer $ packer build -only=virtualbox -var-file=variables.json ubuntu-13.10-amd64.json Little bit more tuning variables.json { "chef_version": "latest", "mirror": "../builds/iso/" }
  • 43. Demo