35
Undine Turnkey Drupal Development Environments David Watson DrupalCon Austin - Drupal in Education Summit June 2, 2014

Undine: Turnkey Drupal Development Environments

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

Page 1: Undine: Turnkey Drupal Development Environments

UndineTurnkey Drupal Development Environments

David WatsonDrupalCon Austin - Drupal in Education Summit

June 2, 2014

Page 2: Undine: Turnkey Drupal Development Environments

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.

Page 3: Undine: Turnkey Drupal Development Environments

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

Page 4: Undine: Turnkey Drupal Development Environments

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?

Page 5: Undine: Turnkey Drupal Development Environments

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

Page 6: Undine: Turnkey Drupal Development Environments

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.”

Page 7: Undine: Turnkey Drupal Development Environments

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.”

Page 8: Undine: Turnkey Drupal Development Environments

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!”

Page 9: Undine: Turnkey Drupal Development Environments

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

Page 10: Undine: Turnkey Drupal Development Environments

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?

Page 11: Undine: Turnkey Drupal Development Environments

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?

Page 12: Undine: Turnkey Drupal Development Environments

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?

Page 13: Undine: Turnkey Drupal Development Environments

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?

Page 14: Undine: Turnkey Drupal Development Environments

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?

Page 15: Undine: Turnkey Drupal Development Environments

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...

Page 16: Undine: Turnkey Drupal Development Environments

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

Page 17: Undine: Turnkey Drupal Development Environments

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

Page 18: Undine: Turnkey Drupal Development Environments

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)

Page 19: Undine: Turnkey Drupal Development Environments

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?

Page 20: Undine: Turnkey Drupal Development Environments

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

Page 21: Undine: Turnkey Drupal Development Environments

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?

Page 22: Undine: Turnkey Drupal Development Environments

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

Page 23: Undine: Turnkey Drupal Development Environments

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

Page 24: Undine: Turnkey Drupal Development Environments

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?

Page 25: Undine: Turnkey Drupal Development Environments

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

Page 26: Undine: Turnkey Drupal Development Environments

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?

Page 27: Undine: Turnkey Drupal Development Environments

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

Page 28: Undine: Turnkey Drupal Development Environments

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

Page 29: Undine: Turnkey Drupal Development Environments

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?

Page 30: Undine: Turnkey Drupal Development Environments

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

Page 31: Undine: Turnkey Drupal Development Environments

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

Page 32: Undine: Turnkey Drupal Development Environments

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

Page 33: Undine: Turnkey Drupal Development Environments

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

Page 34: Undine: Turnkey Drupal Development Environments

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

Page 35: Undine: Turnkey Drupal Development Environments

Thank You!

David Watson

@caughtexception

in/davidmwatson

davidwatson (drupal.org/user/533896)