0
boxen
wfarr
ops andfriction
boxen
why should icare about this?
STORY TIME
once upon a shitty time
once upon a shitty time               Time to get set up.             I want to hack on stuff!
once upon a shitty time             Okay, install XCode...
once upon a shitty time                and rbenv...
once upon a shitty time             and a bunch of rubies...
once upon a shitty time                 and pow...
once upon a shitty time                and nodejs...
once upon a shitty time                and bower...
once upon a shitty time                and bundler...
once upon a shitty time                and mysql...
once upon a shitty time               and postgresql...
once upon a shitty time             probably okay without                  mongodb...
once upon a shitty time                 definitely need             elasticsearch though...
once upon a shitty time               huh... well I cant              connect to the db!
once upon a shitty time               and now ruby is                segfaulting?!
once upon a shitty time                   wat
I just want toship cool stuff...
STUFF     OOL SS CU
I thought I wrote  an install guide that people couldjust walk through. I wonder what    broke...  Ops Person
A SOLUTION IS BORN
once upon an awesome time
once upon an awesome time                Time to get set up.              I want to hack on stuff!
once upon an awesome time                     Okay, I go to             https://boxen.company.com
once upon an awesome time                It says I should install               Xcode real quick. Sure.
once upon an awesome time              Now I copy and paste this              one line into the Terminal.
once upon an awesome time               Oh, hey! Its doing stuff.              I guess Ill grab a coffee.
I swear this is adifferent coffee cup     from before
once upon an awesome time              Rad! It says its done and              to open a new Terminal.
once upon an awesome time              Holy automated awesome,              Batman! Im ready to work!
so like what isboxen actually?

stdli         b
wtf is a devops
homebrew, git, gcc, .dev dns, nginx, rbenv, ruby-build, a bunchof ruby versions, nodenv, a bunch    of nodejs versions, he...
what do i do with     boxen?
MANAGE PROJECTS
Hmm. Lets hack on  github/github!
The README says to run     `boxen github`
Okay, its doing stuff...        I think?The Puppet logging   format is hella confusing to most people, seriously.
What just happened?
1.  Clone github/github2.  Make sure dpkg is installed3.  Make sure icu4c is installed4.  Make sure libgithub is installed...
1.2.    Clone github/github                         e                       h o    Make sure dpkg is installed3.          ...
okay, well, what about the code to       make this happen?
class projects::github {  include dpkg  include icu4c  include libgithub    include projects::pages-jekyll    boxen::proje...
what about your "average" app?
class projects::battle_station {  boxen::project { battle_station:    dotenv => true,    mysql => true,    nginx => true, ...
MANAGE EVERYTHING    ELSE TOO
Thats cool and all, but   what about me?
I need to live on the bleeding     edge version of `sl`.
And my screensaver needs    100% more lasers.
Hmm. Some documentation!  "Personal manifests?"
Oh, this looks kind of neat.      Maybe Ill do it.
class people::wfarr {  include emacs  include zsh    include projects::battle_station}
class people::wfarr {  git::config::global {    alias.st: value => status ;    alias.ci: value => commit ;    user.name: v...
class people::wfarr {  repository {    "/Users/${::boxen_user}/.emacs.d":      source => wfarr/.emacs.d  }}
class people::wfarr {  boxen::osx_defaults {    Fix bluetooth audio streaming because OSX is dumb:      ensure => present,...
CLI
$ boxen# run it
$ boxen --projects# list projects Boxen knows about
$ boxen <project># run it but include <project> in thecatalog automatically
$ boxen --debug# run it but include <project> in thecatalog automatically
UPDATE EASILY
$ boxenBoxen is up-to-date.
$ boxenBoxen has a dirty tree, wont auto-update!
$ boxenBoxen has unpushed commits onmaster, wont auto-update!
$ boxenBoxen on a non-master branch new-project, wont auto-update!
FAIL GRACEFULLY
$ boxenError: ZOMG at /opt/boxen/repo/modules/people/manifests/wfarr.pp:8on node scruffy.gateway.github.lanSorry! Creating...
CODEZ
who failedCODEZ
how long agoCODEZ
CODEZ        machine
os versionCODEZ
CODEZ   shell
refCODEZ
compare viewCODEZ
git statusCODEZ
CODEZ        full command
CODEZ        full log
i fix the error and run `boxen`
CODEZ
via issues api
# config/boxen.rbENV[BOXEN_REPO_NAME] =   github/boxenENV[BOXEN_ISSUES_ENABLED] = yes
This is pretty freaking rad!
Its just code.Maybe I can write this too...
   66 GitHubbers (~42%)      have contributed...
   44 Devs   7 Ops   5 Designers   4 Supportocats           3 Trainers...
really using it
EMBRACE AND EXTEND
create higher level abstractions
class projects::battle_station {  boxen::project { battle_station:    dotenv => true,    mysql => true,    nginx => true, ...
lets optimize for our use-case
The sanest default, but easy to overridedefine github::project(  $source = "github/${title}"  # a whole bunch of other par...
maybe all of our ops team should get certain things by default
class github::environment {  include_github_team_environments()}
class github::environment::ops {  includegithub::environment::ops::vagrant    include projects::battle_station    include ...
START SIMPLE
write new modules inside your  repo first and extract later
~/github/boxen » ls -1 modulescmakectagsgithublibgithublibmicrohttpdnodejspeopleprojectsstrap
~/github/boxen » ls -1 modulescmakectagsgithublibgithublibmicrohttpdnodejs        WIP v2.0.0 nodejs modulepeopleprojectsst...
start abstractions in Puppet
refactor into Ruby later ifperformance demands it
define nodejs::version(  $ensure = present,  $compile = false,  $version = $title,) {  require nodejs    case $ensure {   ...
Time:       Filebucket: 0.00   Vagrant plugin: 0.00           Nodejs: 4.37          Sudoers: 0.00        File line: 0.00  ...
if its consistently slowing down       the run, then optimize
define nodejs::version(  $ensure = present,  $compile = false,  $version = $title,) {  require nodejs    nodejs { $version...
DO WHATEVER WORKS
practicality beats purity /perfect is the enemy of good enough
but...
WHY ISNT THIS JUST A BUNCH OF SCRIPTS?
idempotent behavior is kind of a big deal
shell scripts get the job done if you live in a wonderful vacuum where constraints never change and the dependencies betwe...
the real world reallydoesnt care one bit
telling people"if it breaks, just reinstall"          is a copout
if people expect to your software  to behave a certain way, and you  have the power to automate that       behavior and th...
WHY ISNT THIS IN CHEF?
so glad people dont ask this one     at puppet conferences!
transcend tools;write beautiful porcelain
WHAT ABOUT SECURITY     UPDATES?
THE DARK AGES OFSECURITY INTERACTION          
THE DARK AGES OFSECURITY INTERACTION          Java browser plugins are        literally going to beat you       up, kick ...
lol are you kidding me?I have important codez to write.           Ill do it later.      Now be gone, demon!    HINT: Theyr...


THE awesome AGES OFSECURITY INTERACTION          
THE awesome AGES OFSECURITY INTERACTION       Hey folks! I just had to push       an update to Boxen to disable         J...
THE awesome AGES OFSECURITY INTERACTION        Oh snap - audit season!          Let me just review our        code to see...
what if i have  problems?
pull requests
issues
irc.freenode.net
be chuck yeager
Atlanta          Savannah
Atlanta          Savannah
Atlanta          Savannah
Atlanta          Savannah
Atlanta          Savannah
"So, were uh in the air. We made     it. Thats uh good news,            obviously."
"Flight attendants, if you couldjust hang on to uh... whatever..."
The point at which Irealize Im going to         dieThe point at which I think the worst is        over
detail text
      wfarr speakerdeck.com/wfarr/boxen-puppetcamp-sf-2013
thanks
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
Upcoming SlideShare
Loading in...5
×

Boxen: How to Manage an Army of Laptops

4,300

Published on

"Boxen: How to Manage an Army of Laptops", a talk about Boxen and related bits of Puppet thoughts by Will Farrington of GitHub at Puppet Camp San Francisco 2013.

Published in: Technology
0 Comments
13 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,300
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
45
Comments
0
Likes
13
Embeds 0
No embeds

No notes for slide

Transcript of "Boxen: How to Manage an Army of Laptops"

  1. 1. boxen
  2. 2. wfarr
  3. 3. ops andfriction
  4. 4. boxen
  5. 5. why should icare about this?
  6. 6. STORY TIME
  7. 7. once upon a shitty time
  8. 8. once upon a shitty time Time to get set up. I want to hack on stuff!
  9. 9. once upon a shitty time Okay, install XCode...
  10. 10. once upon a shitty time and rbenv...
  11. 11. once upon a shitty time and a bunch of rubies...
  12. 12. once upon a shitty time and pow...
  13. 13. once upon a shitty time and nodejs...
  14. 14. once upon a shitty time and bower...
  15. 15. once upon a shitty time and bundler...
  16. 16. once upon a shitty time and mysql...
  17. 17. once upon a shitty time and postgresql...
  18. 18. once upon a shitty time probably okay without mongodb...
  19. 19. once upon a shitty time definitely need elasticsearch though...
  20. 20. once upon a shitty time huh... well I cant connect to the db!
  21. 21. once upon a shitty time and now ruby is segfaulting?!
  22. 22. once upon a shitty time wat
  23. 23. I just want toship cool stuff...
  24. 24. STUFF OOL SS CU
  25. 25. I thought I wrote an install guide that people couldjust walk through. I wonder what broke... Ops Person
  26. 26. A SOLUTION IS BORN
  27. 27. once upon an awesome time
  28. 28. once upon an awesome time Time to get set up. I want to hack on stuff!
  29. 29. once upon an awesome time Okay, I go to https://boxen.company.com
  30. 30. once upon an awesome time It says I should install Xcode real quick. Sure.
  31. 31. once upon an awesome time Now I copy and paste this one line into the Terminal.
  32. 32. once upon an awesome time Oh, hey! Its doing stuff. I guess Ill grab a coffee.
  33. 33. I swear this is adifferent coffee cup from before
  34. 34. once upon an awesome time Rad! It says its done and to open a new Terminal.
  35. 35. once upon an awesome time Holy automated awesome, Batman! Im ready to work!
  36. 36. so like what isboxen actually?
  37. 37. 
  38. 38. stdli b
  39. 39. wtf is a devops
  40. 40. homebrew, git, gcc, .dev dns, nginx, rbenv, ruby-build, a bunchof ruby versions, nodenv, a bunch of nodejs versions, herokutoolchain, hub, mysql, postgresql, elasticsearch, riak, java, and a whole lot more available
  41. 41. what do i do with boxen?
  42. 42. MANAGE PROJECTS
  43. 43. Hmm. Lets hack on github/github!
  44. 44. The README says to run `boxen github`
  45. 45. Okay, its doing stuff... I think?The Puppet logging format is hella confusing to most people, seriously.
  46. 46. What just happened?
  47. 47. 1. Clone github/github2. Make sure dpkg is installed3. Make sure icu4c is installed4. Make sure libgithub is installed5. Make sure md5sha1sum is installed6. Make sure solr is installed7. Make sure mysql is installed and running8. Make sure elasticsearch is installed and running9. Make sure memcached is installed and running10. Make sure the dev and tests DBs are created11. Make sure python is installed12. Make sure redis is installed and running13. Make sure Ruby 1.9.3 is installed14. Make sure ~/github/github is set to use 1.9.315. Notify the user of any new environment variables Boxen provides and let them know to restart their shell16. Make sure github/pages-jekyll is cloned17. Make sure github/pages-jekyll is set to use 1.9.318. Make sure environment config for github/pages-jekyll is setup
  48. 48. 1.2. Clone github/github e h o Make sure dpkg is installed3. t t Make sure icu4c is installed4.5. e t Make sure libgithub is installed s s Make sure md5sha1sum is installed a u e j ide6. Make sure solr is installed7.8. r t Make sure mysql is installed and running c p l Make sure elasticsearch is installed and running9. e 4 d 2 s Make sure memcached is installed and running10. e Make sure the dev and tests DBs are created o y on11. t b Make sure python is installed12.13. d e on Make sure redis is installed and running a iz Make sure Ruby 1.9.3 is installed h s14.i t15. l l Make sure ~/github/github is set to use 1.9.3 Notify the user of any new environment variables Boxen provides a and let them know to restart their shell n itf o t16. Make sure github/pages-jekyll is cloned17. Make sure github/pages-jekyll is set to use 1.9.3 f i18. Make sure environment config for github/pages-jekyll is setup and this is the annotated version
  49. 49. okay, well, what about the code to make this happen?
  50. 50. 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: }}
  51. 51. what about your "average" app?
  52. 52. class projects::battle_station { boxen::project { battle_station: dotenv => true, mysql => true, nginx => true, redis => true, ruby => 2.0.0, source => github/battle_station }}
  53. 53. MANAGE EVERYTHING ELSE TOO
  54. 54. Thats cool and all, but what about me?
  55. 55. I need to live on the bleeding edge version of `sl`.
  56. 56. And my screensaver needs 100% more lasers.
  57. 57. Hmm. Some documentation! "Personal manifests?"
  58. 58. Oh, this looks kind of neat. Maybe Ill do it.
  59. 59. class people::wfarr { include emacs include zsh include projects::battle_station}
  60. 60. class people::wfarr { git::config::global { alias.st: value => status ; alias.ci: value => commit ; user.name: value => wfarr ; }}
  61. 61. class people::wfarr { repository { "/Users/${::boxen_user}/.emacs.d": source => wfarr/.emacs.d }}
  62. 62. 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 ; }}
  63. 63. CLI
  64. 64. $ boxen# run it
  65. 65. $ boxen --projects# list projects Boxen knows about
  66. 66. $ boxen <project># run it but include <project> in thecatalog automatically
  67. 67. $ boxen --debug# run it but include <project> in thecatalog automatically
  68. 68. UPDATE EASILY
  69. 69. $ boxenBoxen is up-to-date.
  70. 70. $ boxenBoxen has a dirty tree, wont auto-update!
  71. 71. $ boxenBoxen has unpushed commits onmaster, wont auto-update!
  72. 72. $ boxenBoxen on a non-master branch new-project, wont auto-update!
  73. 73. FAIL GRACEFULLY
  74. 74. $ boxenError: ZOMG at /opt/boxen/repo/modules/people/manifests/wfarr.pp:8on node scruffy.gateway.github.lanSorry! Creating an issue on github/totally-a-madeup-repo-name.
  75. 75. CODEZ
  76. 76. who failedCODEZ
  77. 77. how long agoCODEZ
  78. 78. CODEZ machine
  79. 79. os versionCODEZ
  80. 80. CODEZ shell
  81. 81. refCODEZ
  82. 82. compare viewCODEZ
  83. 83. git statusCODEZ
  84. 84. CODEZ full command
  85. 85. CODEZ full log
  86. 86. i fix the error and run `boxen`
  87. 87. CODEZ
  88. 88. via issues api
  89. 89. # config/boxen.rbENV[BOXEN_REPO_NAME] = github/boxenENV[BOXEN_ISSUES_ENABLED] = yes
  90. 90. This is pretty freaking rad!
  91. 91. Its just code.Maybe I can write this too...
  92. 92.  66 GitHubbers (~42%) have contributed personal manifests or project manifests since October 
  93. 93.  44 Devs 7 Ops 5 Designers 4 Supportocats 3 Trainers 1 Education Liaison 1 Enterprise Salesperson  1 Security Bloke
  94. 94. really using it
  95. 95. EMBRACE AND EXTEND
  96. 96. create higher level abstractions
  97. 97. 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
  98. 98. lets optimize for our use-case
  99. 99. The sanest default, but easy to overridedefine github::project( $source = "github/${title}" # a whole bunch of other params) { boxen::project { $name: source => $source, # that bunch of other params }}
  100. 100. maybe all of our ops team should get certain things by default
  101. 101. class github::environment { include_github_team_environments()}
  102. 102. class github::environment::ops { includegithub::environment::ops::vagrant include projects::battle_station include projects::octostatus include projects::puppet}
  103. 103. START SIMPLE
  104. 104. write new modules inside your repo first and extract later
  105. 105. ~/github/boxen » ls -1 modulescmakectagsgithublibgithublibmicrohttpdnodejspeopleprojectsstrap
  106. 106. ~/github/boxen » ls -1 modulescmakectagsgithublibgithublibmicrohttpdnodejs WIP v2.0.0 nodejs modulepeopleprojectsstrap
  107. 107. start abstractions in Puppet
  108. 108. refactor into Ruby later ifperformance demands it
  109. 109. define nodejs::version( $ensure = present, $compile = false, $version = $title,) { require nodejs case $ensure { present: { # exec to install } absent: { # exec or file to rm } }}
  110. 110. 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
  111. 111. if its consistently slowing down the run, then optimize
  112. 112. define nodejs::version( $ensure = present, $compile = false, $version = $title,) { require nodejs nodejs { $version: ensure => $ensure, compile => $compile, }} This impl. happens to fork less
  113. 113. DO WHATEVER WORKS
  114. 114. practicality beats purity /perfect is the enemy of good enough
  115. 115. but...
  116. 116. WHY ISNT THIS JUST A BUNCH OF SCRIPTS?
  117. 117. idempotent behavior is kind of a big deal
  118. 118. 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
  119. 119. the real world reallydoesnt care one bit
  120. 120. telling people"if it breaks, just reinstall" is a copout
  121. 121. if people expect to your software to behave a certain way, and you have the power to automate that behavior and then dont, youre being a jerk to your usersuser experience common sense 101
  122. 122. WHY ISNT THIS IN CHEF?
  123. 123. so glad people dont ask this one at puppet conferences!
  124. 124. transcend tools;write beautiful porcelain
  125. 125. WHAT ABOUT SECURITY UPDATES?
  126. 126. THE DARK AGES OFSECURITY INTERACTION 
  127. 127. THE DARK AGES OFSECURITY INTERACTION  Java browser plugins are literally going to beat you up, kick your puppy, and eat all of your Doritos! zomg!
  128. 128. lol are you kidding me?I have important codez to write. Ill do it later. Now be gone, demon! HINT: Theyre never going to do it.
  129. 129.
  130. 130.
  131. 131. THE awesome AGES OFSECURITY INTERACTION 
  132. 132. THE awesome AGES OFSECURITY INTERACTION Hey folks! I just had to push an update to Boxen to disable Java plugins in browsers. Sorry about that! Heres a PR with more context: <link>.
  133. 133. THE awesome AGES OFSECURITY INTERACTION Oh snap - audit season! Let me just review our code to see if were in the clear and secure.
  134. 134. what if i have problems?
  135. 135. pull requests
  136. 136. issues
  137. 137. irc.freenode.net
  138. 138. be chuck yeager
  139. 139. Atlanta Savannah
  140. 140. Atlanta Savannah
  141. 141. Atlanta Savannah
  142. 142. Atlanta Savannah
  143. 143. Atlanta Savannah
  144. 144. "So, were uh in the air. We made it. Thats uh good news, obviously."
  145. 145. "Flight attendants, if you couldjust hang on to uh... whatever..."
  146. 146. The point at which Irealize Im going to dieThe point at which I think the worst is over
  147. 147. detail text
  148. 148.  wfarr speakerdeck.com/wfarr/boxen-puppetcamp-sf-2013
  149. 149. thanks
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×