Post on 12-May-2015
description
boxen
wfarr
ops
friction
what is boxen?
STORY TIME
@jbarnette + @wfarr
developing software isharder than it used to be
our toolchains have gottenmore robust
our toolchains have gottenmore complicated
want to work on $anything?
better install a ruby version manager, like 8 versions of ruby, a handful of gems to try and make the behavior remotely sane, and
then pray it doesn't break
s/ruby/literally everything but bash/g
let's make it better
THINGS BOXEN IS
a framework
stdlib
wat
THINGS BOXEN IS NOT
nope
nope
newp
sadly,no
why should i use boxen?
FRICTION SUCKS
frictionis anything that
gets in the way of doing stuff
frictionis the greatest source of
frustration in every organization
configuring development environments is a week-long
marathon in friction
"all right, new work laptop! i wonder where that blog post i used last time to set up ruby,
python, go, and git is. hopefully it still works and by the end of the
week i can start shipping."
"all right, new work laptop! i wonder where that blog post i used last time to set up ruby,
python, go, and git is. hopefully it still works and by the end of the
week i can start shipping."lame
getting any part of the stack running locally should never block
someone from shipping
USS COOL STU
FF
INCONSISTENCY SUCKS
when was the last time you knew every human was running the
same services in dev and prod?
"hey so my postgresql isn't working. is yours working? it is?
huh. i have no idea what's wrong."
"hey so my postgresql isn't working. is yours working? it is?
huh. i have no idea what's wrong."lame
manual audits aretedious
manual audits areerror-prone
ask software instead of humans
lock every core component to the same version as in prod
UPDATING SUCKS
"jeeeeeez the mac app store has been bugging me for like forever! i
have a billion updates... meh"
"jeeeeeez the mac app store has been bugging me for like forever! i
have a billion updates... meh"lame
maybe you use CM in dev already,but when was the last time
you updated and ran it?
SECURITY SUCKS
security is a war of attrition
bug people enough about security and they stop caring about it
"ugh, another security thing? whatever, i have way more
important things to do"
"ugh, another security thing? whatever, i have way more
important things to do"lame
let code handle security,then inform people so they know why the code's making changes
no surprises
BOXEN ENABLES YOU TO MAKE THESE THINGS
BETTER FOR YOUR ORG
what do i get?
RUNNER
boxen is run via some ruby
it collects info for facter
it checks for prerequisites and conflicts before each run
it detects certain changes post-run
it has hooks too
PUPPET
"the core"
homebrew, git, hub, gcc, rbenv, ruby 1.8.7, ruby 1.9.3, ruby 2.0.0, nvm, nodejs 0.4.x, nodejs 0.6.x,
nodejs 0.8.x, nginx, .dev dns, FDE, and puppetlabs-stdlib
rbenv_gem, repository, osx_chsh, osx_login_item, boxen::project,
ruby::local, mysql::database, etc.
package: homebrew, compressed_app
repository: git
service: ghlaunchd
"the library"
130+ modules on GitHub
GitHub uses ~81 of those
travis-ci
CARDBOARD
gem that simplifies creating new puppet modules, optimized for the
boxen-recommended stack
librarian-puppet, rspec-puppet, puppet-lint, etc.
PUPPET-TEMPLATE
example module using cardboard
OUR-BOXEN
template boxen project
BOXEN-WEB
small rails app to allow distributing your boxen easily, with auth
how do i get it?
Automate Everything
boxen/boxen-web
how do i use it?
CLI
$ boxen
# run it
$ boxen --projects
# list projects Boxen knows about
$ boxen <project>
# run it but include <project> in the catalog automatically
PROJECT MANIFESTS
i want to hack on my project
# modules/projects/manifests/team.pp
class projects::team { boxen::project { 'team': dotenv => true, mysql => true, nginx => true, ruby => '1.9.3', source => 'github/team', }}
$ boxen team
warning: Setting up 'team'. This can be made permanent by having 'include projects::team' in your personal manifest.
cloned repo
nginx vhost
ruby version
mysql databases
.env file
PERSONAL MANIFESTS
i want to install $x but only for me
# modules/people/manifests/wfarr.pp
class people::wfarr { include minecraft}
# modules/people/manifests/wfarr.pp
class people::wfarr { include zsh}
# modules/people/manifests/wfarr.pp
class people::wfarr { case $::hostname { 'bender': { include projects::all }
'scruffy': { include projects::team }
default: {} }}
# modules/people/manifests/wfarr.pp
class people::wfarr { git::config::global { 'alias.st': value => 'status'; 'alias.ci': value => 'commit'; 'alias.di': value => 'diff'; 'alias.lp': value => 'log -p'; 'color.ui': value => 'true'; 'user.name': value => 'Will Farrington'; 'user.email': value => 'wfarr@github.com'; }}
# modules/people/manifests/wfarr.pp
class people::wfarr { include osx::example_things}
ISSUES
$ boxenError: 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.
CODEZ
CODEZ
who failed
CODEZ
how long ago
CODEZ machine
CODEZ
os version
CODEZ shell
CODEZref
CODEZcompare view
CODEZgit status
CODEZ
full command
CODEZ
full log
i fix the error and run `boxen`
CODEZ
via issues api
# config/boxen.rb
ENV['BOXEN_REPO_NAME'] = \ 'github/boxen'
ENV['BOXEN_ISSUES_ENABLED'] = 'yes'
UPDATES
$ boxen
Boxen is up-to-date.
$ boxen
Boxen has a dirty tree, won't auto-update!
$ boxen
Boxen has unpushed commits on master, won't auto-update!
$ boxen
Boxen on a non-master branch 'new-project', won't auto-update!
i'm sold.
what if i have problems?
file issues
irc.freenode.net
be chuck yeager
"So, we're uh in the air. We made it. That's uh good news,
obviously."
"Flight attendants, if you could just hang on to uh... whatever..."
detail text
wfarr
come work with me on things like boxen
CODEZ
thanks
speakerdeck.com/wfarr/boxen-puppetcamp-atl