Upload
david-watson
View
229
Download
3
Tags:
Embed Size (px)
DESCRIPTION
Undine is a cross-platform, fully-featured development VM (virtual machine) for Drupalistas of all experience levels. Sponsored by Stevens Institute of Technology, it is a turnkey solution to many of the common pain points encountered in developing for Drupal. Download Undine: http://drupal.org/project/undine
Citation preview
UndineTurnkey Drupal Development Environments
David WatsonDrupalCon Austin - Drupal in Education Summit
June 2, 2014
Introductions
About Stevens, EWS• Private research university
• Amazing view of Manhattan!
• Community of 6,000+
• Running 25+ sites on Drupal 7• Most of them on Acquia Cloud
• Enterprise Web Services• Team of four
• Lots of overlap with other depts.
Introductions
David Watson• Web Engineer, Enterprise Web Services
• Heckle @caughtexception
• Five years in the Drupal community• Most of it in #HigherEd
• Maintainer and contributor on Drupal.org• Most work in responsive, distributions
• More recently DevOps slant
Introductions
Undine is a cross-platform turnkey Drupal development VM based
on the Acquia Cloud. The goal of the Undine project
is to quickly provide a powerful, consistent environment to
both new and experienced Drupalistas.
What is Undine?
Overview
• Motivation for the Undine project
• What exactly is Undine, in detail?
• How it works under the hood
• How we use Undine at Stevens
• Future development goals
Unpacking Undine
Motivation
• Slow and tedious, even with package management
• Ramping up...• New full-time developers
• Student employees
• Contractors
• Other collaborators
“Setting up the environment is a pain.”
Motivation
• Heard most often with profiling and debugging
• “Maybe later...” but why?• Difficulty curve
• Limited resources
• Other institutional priorities
“Never got around to using that tool.”
Motivation
• Code that works for one dev but not another
• Code that works for devs but not on QA
• Code not working on production when it passed QA
• Are the environments the same...?
“It works on my machine!”
Motivation
• Expensive and/or time-consuming ramp-up
• High barriers to adopting powerful, time-saving tools
• Inconsistency between development environments
• Inconsistency between dev and deployment environments
(Not So) Unique Challenges
What If...
• Minimize the time between one-time setup and contribution
• Make contribution more accessible to dev community• Student employees
• Collaborators in other units/organizations
• Outside consultants
• Automate the tedium of configuration
• Turnkey development environment
...Project Ramp-up Was Faster?
What If...
• Provide powerful developer tools out of the box• Drush – Drupal site management
• Git – Decentralized version control system
• XDebug – PHP debugger
• XHProf – Resource profiler for PHP, devel module integration
• Configure them for the most generic case
• Allow further customization if necessary
...Tools Were More Accessible?
What If...
• Provide these features in a portable, repeatable way• Configure once, then use everywhere
• Ideally works on Windows, OS X, Linux
• Base the development environment on production• Acquia Cloud
• Standardize (only) what's important• Allow choice of IDEs, etc.
...Environments Were Consistent?
Unpacking Undine
Undine is a cross-platform turnkey Drupal development VM
based on the Acquia Cloud. The goal of the Undine project
is to quickly provide a powerful, consistent environment to
both new and experienced Drupalistas.
What is Undine?
The Basics
Undine is a cross-platform turnkey Drupal development VM
based on the Acquia Cloud. The goal of the Undine project
is to quickly provide a powerful, consistent environment to
both new and experienced Drupalistas.
What is Undine?
The Basics
• Virtual machine runs on your existing OS• Supported on Linux, Mac OS X, Windows
• The full LAMP stack is installed and configured for you• Linux (Ubuntu Lucid), Apache, MySQL (Percona Server), PHP
VM-based, Turnkey...
The Basics
• Access your VM from your host OS• Shell is available via vagrant ssh
• Web server listens on host's :8080 and :8443 (HTTPS)
• ./www shared between host and VM's /var/www• Use your own IDE on your own host environment
• Allows name-based virtual hosts for multiple sites• Just tell Undine the names and update your hosts file to match
...Drupal Development Environment
How Does It Work?
• Vagrant – VM management tool• Ubuntu “base box” is used as a template for Undine's VM
• Puppet – Manages provisioning on the VM• Automates VM setup (package retrieval, installation, configs, etc.)
• Undine API: further customize the environment
• Site-specific configuration
Vagrant and Puppet
How Does It Work?
• Vagrantfile – High-level VM configuration (memory, NFS, etc.)
• manifests/site.pp – Tells Undine what configs to use
• modules/ - Puppet modules core to Undine (“don't hack core!”)
• env/ - User-provided environment configuration
• sites/ - User-provided site-specific configuration
• examples/ - Configuration examples and documentation
• www/ - Shared between VM (/var/www) and host for your projects
• doc/ - API documentation
Directory Structure (Host)
The Basics
Undine is a cross-platform turnkey Drupal development VM
based on the Acquia Cloud. The goal of the Undine project
is to quickly provide a powerful, consistent environment to
both new and experienced Drupalistas.
What is Undine?
The Basics
• Development environments should match production
• Shared dev server less than ideal for multiple contributors
• Solution: Make the VM mimic the Cloud
Based on the Acquia Cloud
The Basics
Undine is a cross-platform turnkey Drupal development VM
based on the Acquia cloud. The goal of the Undine project
is to quickly provide a powerful, consistent environment to
both new and experienced Drupalistas.
What is Undine?
The Basics
• Undine automates the tedium of first-time setup• Package management
• Configuration files
• Retrieval of project resources
• Possible to automate a custom setup for your own projects
Up and Running In Minutes
The Basics
# Get the Ubuntu Lucid 32-bit base boxvagrant box add lucid32 http://files.vagrantup.com/lucid32.box
# Copy configuration files into placecp ./manifests/Vagrantfile.no-nfs ./manifests/Vagrantfilecp ./manifests/default.site.pp ./manifests/site.pp
# Start Undinevagrant up
# Visit localhost:8080 – you're good to go!
Up and Running In Minutes
The Basics
Undine is a cross-platform turnkey Drupal development VM
based on the Acquia cloud. The goal of the Undine project
is to quickly provide a powerful, consistent environment to
both new and experienced Drupalistas.
What is Undine?
The Basics
• Drush and Git ready out of the box• Possible to set up identity automatically, see /examples
• XDebug is enabled by default• Just tell your IDE to use port 9000 and dbgp (XDebug)
• XHProf is available and ready to integrate with Devel• Location: /usr/share/php53-xhprof
• Web front-end at localhost:8080/xhprof_html
Beyond LAMP: Developer Tools
The Basics
Undine is a cross-platform turnkey Drupal development VM
based on the Acquia cloud. The goal of the Undine project
is to quickly provide a powerful, consistent environment to
both new and experienced Drupalistas.
What is Undine?
The Basics
• Separates site configuration from environment configuration
• Configuration is shareable between developers• Personal config (git identity, etc) can be kept separate
• Developers can work locally on production-like environment• No more “works on my machine!”
Consistent, Repeatable Configuration
The Basics
• Experiment with server config safely• Revert Undine-managed configs with vagrant provision
• Environment bricked? No problem!• Start over with vagrant destroy -f; vagrant up
• Like your changes? Extend Undine and share them!
Configuration Management
The Basics
Undine is a cross-platform turnkey Drupal development VM
based on the Acquia cloud. The goal of the Undine project
is to quickly provide a powerful, consistent environment to
both new and experienced Drupalistas.
What is Undine?
Beyond the Basics
• “Make easy things easy, hard things possible.”
• Most Undine users won't have to change the VM at all
• Advanced users may...• Override configuration (memory allocation, MySQL tuning, etc.)
• Add new packages and services
• Automate Drupal site setup on build
• Much more!
Something For Everyone
Beyond the Basics
• Undine exposes Puppet for advanced users
• ./env and ./sites config captured in Puppet modules
• Additional classes provided for convenience• undine::drupal_codebase – Code for a Drupal platform
• undine::drupal_site – Site within a codebase
• Can retrieve and install an entire site for local development
• See ./examples for more information
Advanced Customization, Undine API
Undine@Stevens
• Local development environment, consistent with Acquia• No surprises during deployment
• No “works on my machine”
• Code, files, databases set up via /sites configs
• Configuration overridden where necessary• settings.php, sites.php
• Git identity, LDAP tweaks in /env config
How We Use It
Undine@Stevens
• Keep all environments consistent!• Dev/QA/Prod need to behave identically
• Avoid environment-specific code
• Only federate the functional• Leave content alone (but make import easy)
• Let devs use their own tools
• Use revision control, with a clear approval workflow
Lessons Learned
Questions?
• Installation script to get new devs started even faster
• Varnish and memcached support
• Upcoming beta release
• Improved drush integration
• Stable 7.x-1.x release by end of 2014
• 2.x branch with Ubuntu Precise
The Future of Undine
Thank You!
David Watson
@caughtexception
in/davidmwatson
davidwatson (drupal.org/user/533896)