Modern developers use virtualized "single use" development environments to reduce time tweaking servers, allowing more time developing. Teams share configurations to eliminate endless "works for me" debug loops, while rebuilding and/or setup is a simple command taking minutes, not hours or days. This intro talk will create a base for attendees to build from and investigate the various technologies like Vagrant, VirtualBox, Puppet, Containers, and Virtual PHP. If your development environment is not virtualized, catch up, it's what all the "cool kids" are doing.
2. 2
Virtualizing Development
●
About me
– PHP 5.3 Certified
– Consultant at Zend Technologies
– Zend Certification Advisory Board
– Organizer SoFloPHP (South Florida)
– Organized SunshinePHP (Miami)
– Long distance (ultra) runner
– Judo Black Belt Instructor
3. 3
Virtualizing Development
● Traditional environments
– “Development”, “testing”, “staging” and “production” setup.
Server
Linux / Windows / MAC
Apache / Nginx
MySQL
PHP
X 4
4. 4
Virtualizing Development
● Shortfalls of development environments
– Different “Development”,“testing”, “staging” and “production” setup.
Development Staging
Testing
Production
5. 5
Virtualizing Development
● Shortfalls of development environments
– Each developer has a different one.
●
Easily out of sync with standards
●
Many versions of (php, mysql, apache, etc.)
Dev #1
Apache 2.2.3
PHP 5.5.1
MySQL 5.4.3
Dev #2
Apache 2.2.15
PHP 5.5.4
MySQL 5.4.5
Dev #3
Apache 2.2.24
PHP 5.4.3
MySQL 5.2.5
Dev #4
Apache 2.1.8
PHP 5.3.24
MySQL 5.1.6
6. 6
Virtualizing Development
● Shortfalls of development environments
– Long ramp-up/training for new developers
Configure
Hardware
Install
Apache
Install
PHP
Install
MySQL
Install
More, more, more
Configure
ALL The Things!
Get Code
Configure,
Configure,
Configure
10. 10
Virtualizing Development
● Puppet
– http://puppetlabs.com
– Many learning resources
– Large community
– http://forge.puppetlabs.com
– Free and paid plans
15. 15
Virtualizing Development
● Benefits
– Managing Data Centers
●
Space
●
Hardware $$$
● Energy $$$
– Security and Backup
● Backup entire image, not just certain files
● Quick re-deployment
● Limit access
– Manage hardware
●
Move VM to different hardware
●
Faster Deployment
●
More flexible infrastructure
16. 16
Virtualizing Development
● Multiple servers, one hardware computer
Hardware
LAMP
Server
LAMP
Server
LAMP
Server
LAMP
Server
LAMP
Server
LAMP
Server
LAMP
Server
17. 17
Virtualizing Development
● Downside
– Time consuming
– Loading
● OS
● Apps (Apache, MySQL, PHP, etc.)
– Distribute
– Update, redistribute
– Inconvenient
– Works on my machine is back!
– End up back to local dev environments
19. 19
Virtualizing Development
● Vagrant - http://vagrantup.com
– Virtualized development environments made easy
●
Command line tool
●
Lowers setup time
● Fully control entire environments and versions
● Eliminates “works on my machine” excuse
● Uses:
– VirtualBox
– VMWare
– AWS
– Others....
● Can use Puppet or Chef
● FREE and open source
20. 20
Virtualizing Development
● Host Based Project Files
– Uses shared folders
– Application files on host OS
– VM is totally disposable
– Script out DB generation
– Editor on host machine faster than in VM
21. 21
Virtualizing Development
● PuPHPet - http://puPHPet.com
– Web-based tool
– Creates Puppet manifests
– To be used with Vagrant
– Advanced setups
– Files downloaded as script runs
● Internet required
– Open source
23. 23
Virtualizing Development
● Docker – http://docker.com
– Manages Linux containers
●
Packaging
●
Hub
● Cloud service
● Automating workflow
– Very small, lightweight versus large VM files
– Able to be versioned
24. 24
Virtualizing Development
● VirtPHP – http://virtphp.org
– CLI
– Multiple PHP environments
● Creates/Manages
● Different PEAR packages
● Different PECL extensions
● Isolated
● Single machine
27. 27
Virtualizing Development
● Now we have
– Easy to share
●
Create scripts, distribute
– Same versions across multiple systems
– Consistency
– Faster ramp-up
– Easier promotion to testing, staging, production
– “Works on OUR machine”