Slide 1

Slide 1 text

Much more Eggs than Bacon 
 A Development Environment
 Jacob Mather Software Engineer, Mashery Cookbook


Slide 2

Slide 2 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Who am I? What I do: • Software Engineer at Mashery • Co-organizer of the
 San Francisco PHP User Group • Community Evangelist Where I can be found: • Blog: http://jmather.com • Twitter: @thejmather

Slide 3

Slide 3 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Why I am giving this talk

Slide 4

Slide 4 text

Let’s talk about
 why we need environments

Slide 5

Slide 5 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 What environments could we have? • Production • Where people paying money interact • Staging • Test your production deployment plan • Quality Assurance • Cheaper version of staging to do comprehensive testing • Development • Designed for easy debugging

Slide 6

Slide 6 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Production Server Server Server Load Balancer Service 1 Server Server Server Load Balancer Service 2 Server Server Server Load Balancer Web Portal DB Cache

Slide 7

Slide 7 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Staging Server Server Load Balancer Service 1 Server Server Load Balancer Service 2 Server Server Load Balancer Web Portal DB Cache

Slide 8

Slide 8 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 QA Server Service 1 Server Service 2 Server Web Portal DB Cache

Slide 9

Slide 9 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Development Server Service 1 Service 2 DB Cache Web Portal

Slide 10

Slide 10 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Why are these differences important?

Slide 11

Slide 11 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development

Slide 12

Slide 12 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA

Slide 13

Slide 13 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA Staging

Slide 14

Slide 14 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA Staging Production

Slide 15

Slide 15 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 What happens when they are too different?

Slide 16

Slide 16 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development

Slide 17

Slide 17 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA

Slide 18

Slide 18 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA

Slide 19

Slide 19 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA

Slide 20

Slide 20 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA Staging

Slide 21

Slide 21 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA Staging

Slide 22

Slide 22 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA Staging

Slide 23

Slide 23 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA Staging Production

Slide 24

Slide 24 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA Staging Production

Slide 25

Slide 25 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Lifecycle of Code Development QA Staging Production

Slide 26

Slide 26 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Why where you develop matters • Environment based bugs are costly to track down • If you can't reproduce in dev, you are shooting in the dark • Devs need to share code without slowing down • Makes infrastructure more transparent

Slide 27

Slide 27 text

Let’s talk about
 getting ready for change

Slide 28

Slide 28 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Devise your minimum viable stack

Slide 29

Slide 29 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Server configuration automation • If you have no current automation • Chef • Puppet • Ansible • If you do have automation • Ops will need to find and remove all production secrets • Ops will need to add a way for you to customize

Slide 30

Slide 30 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Code cleanup • Force all configuration to be explicit • Not based on path or host name • Remove magic strings

Slide 31

Slide 31 text

Let’s talk about
 your choices when implementing

Slide 32

Slide 32 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Choose your platform • Traditional VM • VirtualBox (version 4.2.16 — trust me.) • VMWare • Parallels • Cloud • AWS • Digital Ocean • Rackspace • Container VM (Docker)

Slide 33

Slide 33 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Verification • Smoke tests • Manual inspection • Functional tests

Slide 34

Slide 34 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Points to consider • CLI interface • Learn from my mistake • Use un-routed domains for virtual hosts • Test with all internet disabled

Slide 35

Slide 35 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 At this point you should be able to build a fully functional environment that you are capable of developing software in.

Slide 36

Slide 36 text

Let’s talk about
 getting in to the hands of users

Slide 37

Slide 37 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Make or break time • Prepare as much documentation as you can stomach • Prepare for lots of confusion and frustration

Slide 38

Slide 38 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Choose your timing carefully You only get one chance at a first impression. ! The first time a user spins up their new environment, it must work flawlessly. ! The entire rest of their experience will be influenced by this very first interaction.

Slide 39

Slide 39 text

Let’s talk about
 what happens after deployment

Slide 40

Slide 40 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 One thing we all have in common... Everyone loves to customize their computer! ! Someone will use CDPATH which makes cd output text. ! A few will use rvm and not appreciate your automated (and incorrect) help installing gems. ! Nobody likes you fiddling with their computer.

Slide 41

Slide 41 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Start building a troubleshooting document The less time you have to spend debugging other people’s environments, the more time you have to rapidly iterate. ! No only do you need to have them, they need to be accessible, and make sense, and have enough context.

Slide 42

Slide 42 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Document how to tinker with the system The sooner you can get others involved with adding features, the faster you will be able to keep up with the ever changing needs of your new development environment. ! It also lets others try things experimentally, without involving you at all!

Slide 43

Slide 43 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Tips for making improvements • Slow and steady wins the race. • Do not change your environment’s interface. • Except when there’s great value in it. • Even then it’s really hard to justify.

Slide 44

Slide 44 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 48 Minutes

Slide 45

Slide 45 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 30 Minutes

Slide 46

Slide 46 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 22 Minutes

Slide 47

Slide 47 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Replicating production bugs in development

Slide 48

Slide 48 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Make reporting problems easy . easy

Slide 49

Slide 49 text

Let’s talk about
 chasing the myth of stability

Slide 50

Slide 50 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 The march of progress will continue • Ops updates will break your dev environments. • You will find new third parties your builds depend on. • 100 scratch environment builds a week will make 1 in 100 events happen once a week. • You’ll start to have others contribute infrastructure changes to meet their project’s needs.

Slide 51

Slide 51 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Finding your environment’s dependencies • Your environment depends on: • Your own bootstrapping code • Ops automation code • Random third party software Ops is installing • … anything else?

Slide 52

Slide 52 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Managing your environment’s dependencies • Time to build a CI process • You’ll need a desktop to test accurately • Watch for changes from all relevant repos • Remember it is pairs of commits that are tested

Slide 53

Slide 53 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Making a quick recovery Check to see if your platform of choice supports snapshots. ! When environments go sideways, they can be hard to restore. ! Snapshots eliminate troubleshooting, and take ~20 seconds to run a restore.

Slide 54

Slide 54 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 “I just updated trunk and EVERYTHING IS BROKEN!”

Slide 55

Slide 55 text

Let’s talk about
 handing off to a team

Slide 56

Slide 56 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Eventually you will need to scale, but… • There’s a lot of domain specific knowledge in your head. • Do you know how to run a team? • Do you know how to lead a team? • Do you know how to be a product owner?

Slide 57

Slide 57 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Plus, letting go is hard.

Slide 58

Slide 58 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 So…

Slide 59

Slide 59 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 this is cool and all but…

Slide 60

Slide 60 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 what’s that stuff about eggs and bacon?

Slide 61

Slide 61 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 The chicken and the pig.

Slide 62

Slide 62 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Cool story bro, but what are you really trying to say?

Slide 63

Slide 63 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 ! We are hiring at

Slide 64

Slide 64 text

Much more Eggs than Bacon: A Development Environment Cookbook - Code PaLOUsa - February 26th, 2014 Thank you! More information about this talk can be found at: ! http://bit.ly/clp14-cookbook ! RATE MY TALK AT: http://spkr8.com/t/29431 ! PLEASE LEAVE FEEDBACK It’s the only way I can improve