Slide 1

Slide 1 text

boxen

Slide 2

Slide 2 text

 wfarr

Slide 3

Slide 3 text

 ops and friction

Slide 4

Slide 4 text

boxen

Slide 5

Slide 5 text

why should i care about this?

Slide 6

Slide 6 text

STORY TIME

Slide 7

Slide 7 text

once upon a shitty time

Slide 8

Slide 8 text

Time to get set up. I want to hack on stuff! once upon a shitty time

Slide 9

Slide 9 text

Okay, install XCode... once upon a shitty time

Slide 10

Slide 10 text

and rbenv... once upon a shitty time

Slide 11

Slide 11 text

and a bunch of rubies... once upon a shitty time

Slide 12

Slide 12 text

and pow... once upon a shitty time

Slide 13

Slide 13 text

and nodejs... once upon a shitty time

Slide 14

Slide 14 text

and bower... once upon a shitty time

Slide 15

Slide 15 text

and bundler... once upon a shitty time

Slide 16

Slide 16 text

and mysql... once upon a shitty time

Slide 17

Slide 17 text

and postgresql... once upon a shitty time

Slide 18

Slide 18 text

probably okay without mongodb... once upon a shitty time

Slide 19

Slide 19 text

definitely need elasticsearch though... once upon a shitty time

Slide 20

Slide 20 text

huh... well I can't connect to the db! once upon a shitty time

Slide 21

Slide 21 text

and now ruby is segfaulting?! once upon a shitty time

Slide 22

Slide 22 text

wat once upon a shitty time

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

I just want to ship cool stuff...

Slide 27

Slide 27 text

USS COOL STUFF

Slide 28

Slide 28 text

I thought I wrote an install guide that people could just walk through. I wonder what broke... Ops Person

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

A SOLUTION IS BORN

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

once upon an awesome time

Slide 35

Slide 35 text

Time to get set up. I want to hack on stuff! once upon an awesome time

Slide 36

Slide 36 text

Okay, I go to https://boxen.company.com once upon an awesome time

Slide 37

Slide 37 text

It says I should install Xcode real quick. Sure. once upon an awesome time

Slide 38

Slide 38 text

Now I copy and paste this one line into the Terminal. once upon an awesome time

Slide 39

Slide 39 text

Oh, hey! It's doing stuff. I guess I'll grab a coffee. once upon an awesome time

Slide 40

Slide 40 text

I swear this is a different coffee cup from before

Slide 41

Slide 41 text

Rad! It says it's done and to open a new Terminal. once upon an awesome time

Slide 42

Slide 42 text

Holy automated awesome, Batman! I'm ready to work! once upon an awesome time

Slide 43

Slide 43 text

so like what is boxen actually?

Slide 44

Slide 44 text

 

Slide 45

Slide 45 text

 stdlib

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

wtf is a devops

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

homebrew, git, gcc, .dev dns, nginx, rbenv, ruby-build, a bunch of ruby versions, nodenv, a bunch of nodejs versions, heroku toolchain, hub, mysql, postgresql, elasticsearch, riak, java, and a whole lot more available

Slide 52

Slide 52 text

what do i do with boxen?

Slide 53

Slide 53 text

MANAGE PROJECTS

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

Hmm. Let's hack on github/github!

Slide 56

Slide 56 text

The README says to run `boxen github`

Slide 57

Slide 57 text

Okay, it's doing stuff... I think? The Puppet logging format is hella confusing to most people, seriously.

Slide 58

Slide 58 text

What just happened?

Slide 59

Slide 59 text

1. Clone github/github 2. Make sure dpkg is installed 3. Make sure icu4c is installed 4. Make sure libgithub is installed 5. Make sure md5sha1sum is installed 6. Make sure solr is installed 7. Make sure mysql is installed and running 8. Make sure elasticsearch is installed and running 9. Make sure memcached is installed and running 10. Make sure the dev and tests DBs are created 11. Make sure python is installed 12. Make sure redis is installed and running 13. Make sure Ruby 1.9.3 is installed 14. Make sure ~/github/github is set to use 1.9.3 15. Notify the user of any new environment variables Boxen provides and let them know to restart their shell 16. Make sure github/pages-jekyll is cloned 17. Make sure github/pages-jekyll is set to use 1.9.3 18. Make sure environment config for github/pages-jekyll is setup

Slide 60

Slide 60 text

1. Clone github/github 2. Make sure dpkg is installed 3. Make sure icu4c is installed 4. Make sure libgithub is installed 5. Make sure md5sha1sum is installed 6. Make sure solr is installed 7. Make sure mysql is installed and running 8. Make sure elasticsearch is installed and running 9. Make sure memcached is installed and running 10. Make sure the dev and tests DBs are created 11. Make sure python is installed 12. Make sure redis is installed and running 13. Make sure Ruby 1.9.3 is installed 14. Make sure ~/github/github is set to use 1.9.3 15. Notify the user of any new environment variables Boxen provides and let them know to restart their shell 16. Make sure github/pages-jekyll is cloned 17. Make sure github/pages-jekyll is set to use 1.9.3 18. Make sure environment config for github/pages-jekyll is setup i had to decrease the font size by 24pt just to fit it all on one slide and this is the annotated version

Slide 61

Slide 61 text

okay, well, what about the code to make this happen?

Slide 62

Slide 62 text

class projects::github { include dpkg include icu4c include libgithub include projects::pages-jekyll boxen::project { 'github': elasticsearch => true, memcached => true, mysql => [ 'github_enterprise', 'github_development', 'github_test' ], nginx => 'projects/github/nginx.conf.erb', python => true, redis => true, ruby => '1.9.3', source => 'github/github' } package { 'md5sha1sum': } }

Slide 63

Slide 63 text

what about your "average" app?

Slide 64

Slide 64 text

class projects::battle_station { boxen::project { 'battle_station': dotenv => true, mysql => true, nginx => true, redis => true, ruby => '2.0.0', source => 'github/battle_station' } }

Slide 65

Slide 65 text

MANAGE EVERYTHING ELSE TOO

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

That's cool and all, but what about me?

Slide 68

Slide 68 text

I need to live on the bleeding edge version of `sl`.

Slide 69

Slide 69 text

And my screensaver needs 100% more lasers.

Slide 70

Slide 70 text

Hmm. Some documentation! "Personal manifests?"

Slide 71

Slide 71 text

Oh, this looks kind of neat. Maybe I'll do it.

Slide 72

Slide 72 text

class people::wfarr { include emacs include zsh include projects::battle_station }

Slide 73

Slide 73 text

class people::wfarr { git::config::global { 'alias.st': value => 'status' ; 'alias.ci': value => 'commit' ; 'user.name': value => 'wfarr' ; } }

Slide 74

Slide 74 text

class people::wfarr { repository { "/Users/${::boxen_user}/.emacs.d": source => 'wfarr/.emacs.d' } }

Slide 75

Slide 75 text

class people::wfarr { boxen::osx_defaults { 'Fix bluetooth audio streaming because OSX is dumb': ensure => present, domain => 'com.apple.BluetoothAudioAgent', key => shellquote('Apple Bitpool Min (editable)'), value => 50, user => $::boxen_user ; } }

Slide 76

Slide 76 text

CLI

Slide 77

Slide 77 text

$ boxen # run it

Slide 78

Slide 78 text

$ boxen --projects # list projects Boxen knows about

Slide 79

Slide 79 text

$ boxen # run it but include in the catalog automatically

Slide 80

Slide 80 text

$ boxen --debug # run it but include in the catalog automatically

Slide 81

Slide 81 text

UPDATE EASILY

Slide 82

Slide 82 text

$ boxen Boxen is up-to-date.

Slide 83

Slide 83 text

$ boxen Boxen has a dirty tree, won't auto- update!

Slide 84

Slide 84 text

$ boxen Boxen has unpushed commits on master, won't auto-update!

Slide 85

Slide 85 text

$ boxen Boxen on a non-master branch 'new- project', won't auto-update!

Slide 86

Slide 86 text

FAIL GRACEFULLY

Slide 87

Slide 87 text

$ boxen Error: ZOMG at /opt/boxen/repo/ modules/people/manifests/wfarr.pp:8 on node scruffy.gateway.github.lan Sorry! Creating an issue on github/ totally-a-madeup-repo-name.

Slide 88

Slide 88 text

CODEZ

Slide 89

Slide 89 text

CODEZ who failed

Slide 90

Slide 90 text

CODEZ how long ago

Slide 91

Slide 91 text

CODEZ machine

Slide 92

Slide 92 text

CODEZ os version

Slide 93

Slide 93 text

CODEZ shell

Slide 94

Slide 94 text

CODEZ ref

Slide 95

Slide 95 text

CODEZ compare view

Slide 96

Slide 96 text

CODEZ git status

Slide 97

Slide 97 text

CODEZ full command

Slide 98

Slide 98 text

CODEZ full log

Slide 99

Slide 99 text

i fix the error and run `boxen`

Slide 100

Slide 100 text

CODEZ

Slide 101

Slide 101 text

via issues api

Slide 102

Slide 102 text

# config/boxen.rb ENV['BOXEN_REPO_NAME'] = \ 'github/boxen' ENV['BOXEN_ISSUES_ENABLED'] = 'yes'

Slide 103

Slide 103 text

This is pretty freaking rad!

Slide 104

Slide 104 text

It's just code. Maybe I can write this too...

Slide 105

Slide 105 text

             64 GitHubbers have contributed personal manifests or project manifests since October. That's 40.5% if we include the 5 new Hubbernauts that started Monday.

Slide 106

Slide 106 text

4 Supportocats 5 Designers 43 Devs         7 Ops 3 Trainers 1 Education Liaison 1 Enterprise Salesperson

Slide 107

Slide 107 text

No content

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

really using it

Slide 110

Slide 110 text

EMBRACE AND EXTEND

Slide 111

Slide 111 text

create higher level abstractions

Slide 112

Slide 112 text

class projects::battle_station { boxen::project { 'battle_station': dotenv => true, mysql => true, nginx => true, redis => true, ruby => '2.0.0', source => 'github/battle_station' } } This is the same for 80% of cases

Slide 113

Slide 113 text

let's optimize for our use-case

Slide 114

Slide 114 text

define github::project( $source = "github/${title}" # a whole bunch of other params ) { boxen::project { $name: source => $source, # that bunch of other params } } The sanest default, but easy to override

Slide 115

Slide 115 text

maybe all of our ops team should get certain things by default

Slide 116

Slide 116 text

class github::environment { include_github_team_environments() }

Slide 117

Slide 117 text

class github::environment::ops { include github::environment::ops::vagrant include projects::battle_station include projects::octostatus include projects::puppet }

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

START SIMPLE

Slide 120

Slide 120 text

write new modules inside your repo first and extract later

Slide 121

Slide 121 text

~/github/boxen » ls -1 modules cmake ctags github libgithub libmicrohttpd nodejs people projects strap

Slide 122

Slide 122 text

~/github/boxen » ls -1 modules cmake ctags github libgithub libmicrohttpd nodejs people projects strap WIP v2.0.0 nodejs module

Slide 123

Slide 123 text

start abstractions in Puppet

Slide 124

Slide 124 text

refactor into Ruby later if performance demands it

Slide 125

Slide 125 text

define nodejs::version( $ensure = present, $compile = false, $version = $title, ) { require nodejs case $ensure { present: { # exec to install } absent: { # exec or file to rm } } }

Slide 126

Slide 126 text

Time: Filebucket: 0.00 Vagrant plugin: 0.00 Nodejs: 4.37 Sudoers: 0.00 File line: 0.00 Ini setting: 0.01 Group: 0.10 Repository: 0.12 File: 0.66 Service: 1.54 Package: 112.76 Total: 130.29 Last run: 1365003143 Rbenv gem: 2.23 Exec: 3.36 Config retrieval: 7.27

Slide 127

Slide 127 text

if it's consistently slowing down the run, then optimize

Slide 128

Slide 128 text

define nodejs::version( $ensure = present, $compile = false, $version = $title, ) { require nodejs nodejs { $version: ensure => $ensure, compile => $compile, } } This impl. happens to fork less

Slide 129

Slide 129 text

DO WHATEVER WORKS

Slide 130

Slide 130 text

practicality beats purity

Slide 131

Slide 131 text

but...

Slide 132

Slide 132 text

WHY ISN'T THIS JUST A BUNCH OF SCRIPTS?

Slide 133

Slide 133 text

idempotent behavior is kind of a big deal

Slide 134

Slide 134 text

shell scripts get the job done if you live in a wonderful vacuum where constraints never change and the dependencies between resources are forever static

Slide 135

Slide 135 text

the real world really doesn't care one bit

Slide 136

Slide 136 text

telling people "if it breaks, just reinstall" is a copout

Slide 137

Slide 137 text

if people expect to your software to behave a certain way, and you have the power to automate that behavior and then don't, you're being a jerk to your users user experience common sense 101

Slide 138

Slide 138 text

WHY ISN'T THIS IN CHEF?

Slide 139

Slide 139 text

chef is pretty cool

Slide 140

Slide 140 text

but it's in puppet now

Slide 141

Slide 141 text

the reasons don't much matter because a rewrite would be silly

Slide 142

Slide 142 text

transcend tools; write beautiful porcelain

Slide 143

Slide 143 text

No content

Slide 144

Slide 144 text

WHAT ABOUT SECURITY UPDATES?

Slide 145

Slide 145 text

 THE DARK AGES OF SECURITY INTERACTION

Slide 146

Slide 146 text

 THE DARK AGES OF SECURITY INTERACTION Java browser plugins are literally going to beat you up, kick your puppy, and eat all of your Doritos! zomg!

Slide 147

Slide 147 text

lol are you kidding me? I have important codez to write. I'll do it later. Now be gone, demon! HINT: They're never going to do it.

Slide 148

Slide 148 text

Slide 149

Slide 149 text

Slide 150

Slide 150 text

no surprises

Slide 151

Slide 151 text

 THE awesome AGES OF SECURITY INTERACTION

Slide 152

Slide 152 text

 THE awesome AGES OF SECURITY INTERACTION Hey folks! I just had to push an update to Boxen to disable Java plugins in browsers. Sorry about that! Here's a PR with more context: .

Slide 153

Slide 153 text

 THE awesome AGES OF SECURITY INTERACTION Oh snap - audit season! Let me just review our code to see if we're in the clear and secure.

Slide 154

Slide 154 text

what if i have problems?

Slide 155

Slide 155 text

file issues

Slide 156

Slide 156 text

irc.freenode.net

Slide 157

Slide 157 text

haters anonymous

Slide 158

Slide 158 text

No content

Slide 159

Slide 159 text

GitHub sucks!

Slide 160

Slide 160 text

ignore the haters; build cool software

Slide 161

Slide 161 text

No content

Slide 162

Slide 162 text

 wfarr speakerdeck.com/wfarr/boxen-mwrc

Slide 163

Slide 163 text

CODEZ drinkup TONIGHT little america sports bar @ 8:30

Slide 164

Slide 164 text

thanks