DEVELOPING LOCALLY WITH VIRTUAL MACHINES
William Hurley, Manager of Programming
April 11, 2014
Monday, April 14, 14
About Forum One
1,500	
  projects	
  since	
  1996
Full	
  Service	
  Strategy	
  +	
  UX	
  +	
  Tech	
  +	
  Support
100...
75	
  Staff	
  Members	
  in
Alexandria,	
  SeaJle,
San	
  Francisco	
  and	
  more!
Monday, April 14, 14
The Challenge
Monday, April 14, 14
In 2008
LAMPi
n
u
x
p
a
c
h
e
y
S
q
l
H
P
Monday, April 14, 14
In 2008
4	
  languages
PHP
SQL
CSS	
  /	
  JS
3	
  services
Apache
MySQL
PHP	
  with	
  mod_php
5	
  Developers
1	
  Theme...
In 2014
LNMPSVMi
n
u
x
n
g
i
n
x
y
S
q
l
H
P
o
l
r
a
r
n
i
s
h
e
m
c
a
c
h
e
d
Monday, April 14, 14
In 2014
15	
  Developers
5	
  Interface	
  Engineers
2	
  Technical	
  PM
10	
  Contractors
2	
  System	
  
Administrators...
Develop and Support
Launched	
  29	
  sites	
  in	
  2013
AcUvely	
  host	
  and	
  support	
  65+	
  sites
Drupal	
  6	
 ...
Software and Versions Matter
Apache	
  or	
  nginx?
FPM	
  or	
  mod_php?
PHP	
  5.2,	
  5.3	
  or	
  5.4?
Ruby	
  1.8.7,	...
Looking to the Future
Web	
  properUes	
  ge`ng	
  more	
  complex
New	
  technologies	
  -­‐-­‐	
  not	
  yet	
  easily	
...
Solutions
Monday, April 14, 14
Monday, April 14, 14
What is it?
“Vagrant	
  is	
  a	
  tool	
  for	
  building	
  complete	
  
development	
  environments.	
  With	
  an	
  e...
What Does that Mean?
Manages	
  per-­‐project	
  virtual	
  machines
Eases	
  configuraUon	
  for:
Port	
  forwarding
Share...
Why Does it Matter?
Easily	
  create	
  new	
  projects	
  -­‐-­‐	
  just	
  
run	
  “vagrant	
  up”
Keep	
  each	
  proje...
Vagrant Workflow
Check	
  out	
  repository
Run	
  “vagrant	
  up”
Log	
  in	
  to	
  VM	
  by	
  running	
  “vagrant	
  s...
Easy First Steps
Create	
  a	
  single	
  virtual	
  machine	
  with	
  
sojware	
  you	
  need
Generate	
  template
Share...
Challenges
More	
  system	
  resources	
  necessary
Requires	
  use	
  of	
  the	
  command-­‐line
Does	
  not	
  preserve...
Common Issues
On	
  some	
  machines	
  Intel	
  VirtualizaUon	
  
Technology	
  for	
  Directed	
  I/O	
  (VT-­‐d)	
  is	...
Monday, April 14, 14
What is it?
“Puppet	
  is	
  IT	
  automaUon	
  sojware	
  that	
  helps	
  
system	
  administrators	
  manage	
  infrast...
What Does that Mean?
Ensures	
  current	
  environment	
  matches	
  
configuraUon
Domain	
  specific	
  language	
  to	
  c...
Alternatives
Monday, April 14, 14
Why Does it Matter?
Ability	
  to	
  customize	
  sojware	
  for	
  each	
  
project	
  independently
Ability	
  to	
  cus...
Challenges
Centralizes	
  knowledge	
  and	
  experUse
Takes	
  Ume	
  to	
  provision	
  virtual	
  machine
Achieving	
  ...
PuPHPet
Monday, April 14, 14
Other Examples
Drupal-­‐VM	
  (github.com/Bussmeyer/drupal-­‐vm)
Varying	
  Vagrant	
  Vagrants	
  (github.com/Varying-­‐
...
Or Roll Your Own
Advantages
Control	
  over	
  all	
  aspects	
  of	
  the	
  provisioning
Easy	
  to	
  use	
  organizaUo...
Key Components
Librarian	
  Puppet
Puppet	
  modules	
  -­‐-­‐	
  Puppet	
  Forge,	
  Git
Hiera
Monday, April 14, 14
Hiera
---
classes:
- forumone::varnish
- forumone::nodejs
- forumone::ruby
- memcached
forumone::webserver::webserver: ngi...
THANK YOU!
Any questions?
whurley@forumone.com
Monday, April 14, 14
Upcoming SlideShare
Loading in …5
×

Developing locally with virtual machines

441 views

Published on

How to develop Drupal locally with virtual machines and why you would want to.

Published in: Software, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
441
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Developing locally with virtual machines

  1. 1. DEVELOPING LOCALLY WITH VIRTUAL MACHINES William Hurley, Manager of Programming April 11, 2014 Monday, April 14, 14
  2. 2. About Forum One 1,500  projects  since  1996 Full  Service  Strategy  +  UX  +  Tech  +  Support 100%  Open  Source! Monday, April 14, 14
  3. 3. 75  Staff  Members  in Alexandria,  SeaJle, San  Francisco  and  more! Monday, April 14, 14
  4. 4. The Challenge Monday, April 14, 14
  5. 5. In 2008 LAMPi n u x p a c h e y S q l H P Monday, April 14, 14
  6. 6. In 2008 4  languages PHP SQL CSS  /  JS 3  services Apache MySQL PHP  with  mod_php 5  Developers 1  Themer 2  System   Administrators Everyone  in  one   building Monday, April 14, 14
  7. 7. In 2014 LNMPSVMi n u x n g i n x y S q l H P o l r a r n i s h e m c a c h e d Monday, April 14, 14
  8. 8. In 2014 15  Developers 5  Interface  Engineers 2  Technical  PM 10  Contractors 2  System   Administrators Working  across  the  US   and  Europe 7  languages PHP SQL Ruby Java SASS  /  CSS  /  JS 7  services Apache nginx MySQL PostgreSQL Solr Varnish Memcached Redis NodeJS Monday, April 14, 14
  9. 9. Develop and Support Launched  29  sites  in  2013 AcUvely  host  and  support  65+  sites Drupal  6  and  7,  even  some  Drupal  5 WordPress Custom  applicaUons  in  Python,  NodeJS,  Zend   Framework,  Code  Igniter  and  others Hosted  by  Forum  One,  Acquia,  Pantheon  and   others Monday, April 14, 14
  10. 10. Software and Versions Matter Apache  or  nginx? FPM  or  mod_php? PHP  5.2,  5.3  or  5.4? Ruby  1.8.7,  1.9  or  2.0? Solr  3.5,  3.6,  4.4  or  4.6? Redis  or  memcached Varnish Monday, April 14, 14
  11. 11. Looking to the Future Web  properUes  ge`ng  more  complex New  technologies  -­‐-­‐  not  yet  easily  installed   on  consumer  systems HHVM PageSpeed Mahout  /  Hadoop Larger  and  more  distributed  teams Monday, April 14, 14
  12. 12. Solutions Monday, April 14, 14
  13. 13. Monday, April 14, 14
  14. 14. What is it? “Vagrant  is  a  tool  for  building  complete   development  environments.  With  an  easy-­‐ to-­‐use  workflow  and  focus  on  automaUon,   Vagrant  lowers  development  environment   setup  Ume,  increases  development/ producUon  parity,  and  makes  the  "works  on   my  machine"  excuse  a  relic  of  the  past.” Monday, April 14, 14
  15. 15. What Does that Mean? Manages  per-­‐project  virtual  machines Eases  configuraUon  for: Port  forwarding Shared  folders  including  NFS SSH  agent  forwarding Integrates  with  system  configuraUon   management Monday, April 14, 14
  16. 16. Why Does it Matter? Easily  create  new  projects  -­‐-­‐  just   run  “vagrant  up” Keep  each  project  isolated Keep  everyone  working  in  the   same  environment Monday, April 14, 14
  17. 17. Vagrant Workflow Check  out  repository Run  “vagrant  up” Log  in  to  VM  by  running  “vagrant  ssh” Run  git  or  drush  from  the  VM  or  locally Work  with  files  locally Monday, April 14, 14
  18. 18. Easy First Steps Create  a  single  virtual  machine  with   sojware  you  need Generate  template Share  with  team Monday, April 14, 14
  19. 19. Challenges More  system  resources  necessary Requires  use  of  the  command-­‐line Does  not  preserve  idiosyncraUc  preferences Requires  addiUonal  sojware  -­‐-­‐  some   changing  frequently Not  all  drush  commands  work  well  from   outside  the  VM Monday, April 14, 14
  20. 20. Common Issues On  some  machines  Intel  VirtualizaUon   Technology  for  Directed  I/O  (VT-­‐d)  is  not   enabled SSH  commands  need  the  host  SSH  key  in   the  SSH  agent  -­‐-­‐  ssh-­‐add NaUve  file  sharing  on  OSX  and  Linux  is  slow   -­‐-­‐  use  NFS Monday, April 14, 14
  21. 21. Monday, April 14, 14
  22. 22. What is it? “Puppet  is  IT  automaUon  sojware  that  helps   system  administrators  manage  infrastructure   throughout  its  lifecycle,  from  provisioning  and   configuraUon  to  orchestraUon  and  reporUng.   Using  Puppet,  you  can  easily  automate   repeUUve  tasks,  quickly  deploy  criUcal   applicaUons,  and  proacUvely  manage  change,   scaling  from  10s  of  servers  to  1000s,  on-­‐ premise  or  in  the  cloud.” Monday, April 14, 14
  23. 23. What Does that Mean? Ensures  current  environment  matches   configuraUon Domain  specific  language  to  configure: Services Files Permissions Se`ngs Monday, April 14, 14
  24. 24. Alternatives Monday, April 14, 14
  25. 25. Why Does it Matter? Ability  to  customize  sojware  for  each   project  independently Ability  to  customize  se`ngs  for  each   project  independently  and  share  those   se`ngs  with  each  team  member Leverage  experUse  in  certain  technologies   across  the  enUre  team Monday, April 14, 14
  26. 26. Challenges Centralizes  knowledge  and  experUse Takes  Ume  to  provision  virtual  machine Achieving  parity  with  developer  desired   tools  -­‐-­‐  e.g.  XDebug,  XHProf Change  can  be  difficult Monday, April 14, 14
  27. 27. PuPHPet Monday, April 14, 14
  28. 28. Other Examples Drupal-­‐VM  (github.com/Bussmeyer/drupal-­‐vm) Varying  Vagrant  Vagrants  (github.com/Varying-­‐ Vagrant-­‐Vagrants/VVV) Kalabox  (www.kalamuna.com/products/kalabox) Monday, April 14, 14
  29. 29. Or Roll Your Own Advantages Control  over  all  aspects  of  the  provisioning Easy  to  use  organizaUon  specific  configuraUon  -­‐-­‐   e.g.  Varnish,  Solr,  nginx Challenges Takes  Ume  to  learn  tool Limits  your  community Monday, April 14, 14
  30. 30. Key Components Librarian  Puppet Puppet  modules  -­‐-­‐  Puppet  Forge,  Git Hiera Monday, April 14, 14
  31. 31. Hiera --- classes: - forumone::varnish - forumone::nodejs - forumone::ruby - memcached forumone::webserver::webserver: nginx forumone::php::modules: - pecl-memcached - xcache - gd php::modules: xcache: settings: xcache.size: "96M" --- classes: - forumone::webserver - forumone::php - forumone::drush - forumone::mailcatcher forumone::php::modules: - xml - pdo - mbstring - mysql - pecl-xdebug php::ini: display_errors: "On" memory_limit: "256M" upload_max_filesize: "50M" post_max_size: "100M" sendmail_path: "/usr/bin/env catchmail" percona::conf: max_allowed_packets: content: "[mysqld]nmax_allowed_packet=100M" innodb_file_per_table: content: "[mysqld]ninnodb_file_per_table" query_cache_size: content: "[mysqld]nquery_cache_size = 128M" table_open_cache: content: "[mysqld]ntable_open_cache = 2048" memory_buffers: content: "[mysqld]ntmp_table_size = 128nmax_heap_table_size = 128Mnjoin_buffer_size = 1M nmyisam_sort_buffer_size = 8Mnsort_buffer_size = 2M" php::modules: xdebug: pkgname: "pecl-xdebug" zend: "/usr/lib64/php/modules" settings: --- forumone::databases: web: username: web forumone::webserver::vhosts: vagrant: path: "/vagrant/public" forumone::php::prefix: "php53u" forumone::solr::collections: drupal: order: 1 Server Platform Site Monday, April 14, 14
  32. 32. THANK YOU! Any questions? whurley@forumone.com Monday, April 14, 14

×