SlideShare a Scribd company logo
1 of 89
Download to read offline
Holy shitthe Polish
knowhowto drink. I
hope nobodycantell
thatI'm stilldrunk
from lastnight
ByJamieWinsor
BerkshelfCoreTeam
» Jamie Winsor <jamie@vialstudios.com>
» Seth Vargo <sethvargo@gmail.com>
» Michael Ivey <michael.ivey@riotgames.com>
berkshelf
Chef Cookbook manager and
dependency resolver
» Retrieve a cookbooks
dependencies
» Package cookbooks and their
dependencies
» Author new cookbooks
» League of Legends
» Guild Wars 2
» TERA
» Lord of The Rings Online
» Dungeons and Dragons Online
» Asheron's Call
"DeployWindows"
Risk Mitigation
Introducing change
intoasystem isa
synonym for
introducing risk
Notdeploying isa
risk,too
Q.What?
A. Graphingthe risk
ofmultiple changes
overtime isn'tlinear
Risk is exponentiallygreater
irb> changes = ChangeSet.new
irb> changes.add Change.new
irb> changes.risk_level
=> 1
irb> 5.times do
irb> changes.add Change.new
irb> end
irb> changes.risk_level
=> 46656
Risk Level: 6 ^ 6
Notdeployingat5pm
isn'tRobbing peter
to paypaul
Notdeployingat5PM is:
1.Killing Peter
a. Framing it as a suicide
b. Making his wife your wife
c. Stealing his entire family inheritence
d. Telling his children you're their new dad
e. Defecating on his grave
To payPaul
When shouldwe
deploy?
Yeah, I'm gonna
release itat5PM ona
Friday.
DeployWindows
Aclear indicatorthatyour
release process is broken
Whataboutthe
risk?
That'swhywe have
deploywindows
Theyexistbecause
Deployment
wasan
afterthought
And it'swithinyour
powerto control
deploymenttimesto
reduce risk
Thatsoftware doesn'teven
wantto be deployed
JustDeployAlready
Howdowe reduce risk
while stillallowing for change
Continuous Delivery&
Devops
Tothe rescue
“Justrub some
DevOps on it.”
Joshua Timberman
DevOps isasoftware
developmentpattern
DevOps is not
» A position
» A team
» A department
» Or an organization
“Disruptive startup
is hiring DevOps
ninjas”
LinkedIn Spammer
You can'tbuya
DevOpstooland
You can'tbuyacontinuous
deliverytool
Software doesn't
solve problems.
People do.
“Ifyou putthe right
people inthe right
roomthey'llsolve
the problemthe
rightway”
Jeff Hackert
ComingTogether
Youwillneedto
changeyour
developmentand
release process
Adopting devops is
MUCH EASIER
on newprojects
Startsmall
Your firstprogram is
typically"Hello,World!"
Automateandtest
everything
Version, package,
and release
EVERYTHING
Let's build something
Application Checklist
» Source code
» Build tasks
» Release tasks
» Cookbook
Resulting in
1.Software Artifact (app.tar.gz)
2.Cookbook Artifact (cookbooks.tar.gz)
3.Installation | Upgrade | Configuration Docs
Ifyou'readeveloper
Give these three things to your Operators for every
release.
Elixir
GenerateYour Project
$ mix new highfive
Addto source control
$ cd highfive
$ git init .
$ git remote add origin git@github.com:reset/highfive.git
GenerateYour application's
Cookbook
$ berks cookbook highfive ./cookbook --pattern environment --skip-git
Make deployment
partofyour build
process
CookbookAndApplication Share
Version
$ cat cookbook/metadata.rb
name "highfive"
maintainer "Jamie Winsor"
maintainer_email "jamie@vialstudios.com"
license "All rights reserved"
description "Installs/Configures highfive"
long_description "Installs/Configures highfive"
version File.read(File.expand_path("../../VERSION", __FILE__))
$ cat cookbook/attributes/default.rb
#
# Cookbook Name:: highfive
# Attribute:: default
#
default[:highfive][:release] =
Highfive::Chef.cookbook_version(run_context)}
$ cat cookbook/libraries/highfive.rb
#
# Cookbook Name:: highfive
# Libraries:: highfive
#
module Highfive
module Chef
class << self
# Returns the version of the loaded highfive cookbook
#
# @param [Chef::RunContext] context
#
# @return [String]
def cookbook_version(context)
context.cookbook_collection["highfive"].version
end
end
end
end
EnvironmentCookbook
» Nearly identical to an Application Cookbook
» Has it's Berksfile.lock committed into version
control
BuildTasks
» Version bump
$ mix version.bump patch
» Compile
$ mix compile
» Test
$ mix test
Version Bumping
Generates a VERSION file at the root of the project
$ cat VERSION
1.0.0
Howdowe getour
compiled software
in ourvm?
Buildand package release
» OTP Release assemble
$ mix release.assemble
» Package
$ mix package
$ ls pkg
highfive-osx.tar.gz
We needtoassemble
arelease forthe os
we're deployingto
BuildaBuild Server
Build Server Recipe
$ cat cookbook/recipe/build_server.rb
include_recipe "highfive::_common"
include_recipe "build-essential::default"
include_recipe "elixir::default"
Editmetadata.rb
$ cat cookbook/metadata.rb
name "highfive"
maintainer "Jamie Winsor"
maintainer_email "jamie@vialstudios.com"
license "All rights reserved"
description "Installs/Configures highfive"
long_description "Installs/Configures highfive"
version "0.1.0"
supports "ubuntu"
depends "build-essential", "~> 2.0"
depends "elixir", "~> 0.5"
VagrantBuilderOn-demandvirtualized build server
Vagrant.configure("2") do |config|
# ... additional configuration ...
config.vm.synced_folder File.dirname(__FILE__), "/builder"
config.vm.provision :chef_solo do |chef|
chef.run_list = [ "recipe[highfive::build_server]" ]
end
config.vm.provision :shell, inline: <<-SCRIPT
export PATH=/usr/local/lib/elixir/bin::$PATH
export ELIXIR_EBIN=/usr/local/lib/elixir/lib/elixir/ebin
export MIX_ENV=prod
mix clean --all
mix version.bump patch
mix deps.get
mix compile
mix release.assemble
mix package
SCRIPT
end
Build it(from our hostmachine)
$ vagrant up --provision
.... provisioning ...
$ ls pkg
highfive-linux-x86-tar.gz
deploying our
artifact
Create app.rb recipe
node.set[:'build-essential'][:compile_time] = true
include_recipe "libarchive::default"
include_recipe "runit"
libarchive_file "highfive-linux-x86.tar.gz" do
path "/pkg"
extract_to "/opt/highfive"
owner "highfive"
group "highfive"
action :extract
notifies :restart, "runit_service[highfive]"
only_if { ::File.exist?(asset.asset_path) }
end
runit_service "highfive"
Update Cookbook Dependencies
depends "build-essential", "~> 2.0"
depends "elixir", "~> 0.5"
depends "libarchive"
Edit.kitchen.yml
$ cat cookbook/.kitchen.yml
driver:
name: vagrant
synced_folders:
- ["<%= File.expand_path("../../pkg", __FILE__) %>", "/pkg"]
provisioner:
name: chef_solo
platforms:
- name: ubuntu-12.04
suites:
- name: default
run_list:
- recipe[highfive::default]
attributes:
Kitchen Converge
$ cd cookbook
$ kitchen converge
-----> Starting Kitchen (v1.2.2.dev)
...
-----> Kitchen is finished. (14m6.31s)
Generatingthe Cookbookartifact
$ berks package pkg/cookbooks.tar.gz -b cookbook/Berksfile
Cookbook(s) packaged to pkg/cookbooks.tar.gz
Thearchive contains
» The Berksfile.lock from resolution
» A cookbooks directory containing each cookbook
found in the Berksfile.lock
Putthesearchives in
anartifactserver
ArtifactServers
» Github | Github Enterprise
» Sonatype's Nexus
» Artifactory
» Basic Auth HTTP Server (sadface)
(https://artifacts.myorg.com/myapp/1.2.3/
myapp.tar.gz)
Github Releasesand
ReleaseAssets
GitHub Deploy
asset_path = "/pkg"
unless node[:highfive][:_local_deploy]
asset = github_asset "berkshelf-api.tar.gz" do
repo "berkshelf/berkshelf-api"
release "v1.2.1"
end
asset_path = asset.path
end
libarchive_file "highfive-linux-x86.tar.gz" do
path asset_path
extract_to "/opt/highfive"
owner "highfive"
group "highfive"
action :extract
notifies :restart, "runit_service[highfive]"
only_if { ::File.exist?(asset.asset_path) }
end
Update .kitchen.yml
driver:
name: vagrant
synced_folders:
- ["<%= File.expand_path("../../pkg", __FILE__) %>", "/pkg"]
provisioner:
name: chef_solo
platforms:
- name: ubuntu-12.04
suites:
- name: default
run_list:
- recipe[highfive::default]
attributes: {
highfive: {
_local_deploy: true
}
}
Releaseartifactsallowusto
» Build a new environment with a specific version
» Upgrade pre-existing environments
» Promote through logical environments
(Dev, Stage, Production)
DeployIt
Create Environment
$ knife environment create highfive-dev
BootstrapANode
$ knife ec2 server create -I ami-0eb2d83e -E highfive-dev
Berkflow
ACookbook-Centric
Deploymentworkflowtool
InstallBerkflowwith Chef-DK
$ chef gem install berkflow
$ export PATH=/opt/chefdk/embedded/bin:$PATH
$ which blo
/opt/chefdk/embedded/bin/blo
"Install"the cookbookartifact
intoyour ChefServer
$ blo install https://github.com/reset/highfive/releases/download/v1.0.0/cookbooks.tar.gz
"Upgrading"aChefEnvironment
$ blo upgrade highfive-dev highfive 1.2.1
Or upgrade to latest
$ blo upgrade highfive-dev highfive latest
One Button Upgrade
Beacatalystfor change
Butdon'texpecta
parade. It's not
coming.
Even ifitdoes
Youwon'thaveyour own
float
WannaMake Games?
http://undeadlabs.com/jobs/
» Game Programmer
» Game Producer
» Game Animator
» Game Designer
JamieWinsor
@resetexistence
github.com/reset

More Related Content

What's hot

What's hot (20)

어릴 적 할머니가 들려주신 옛 wsgi
어릴 적 할머니가 들려주신 옛 wsgi어릴 적 할머니가 들려주신 옛 wsgi
어릴 적 할머니가 들려주신 옛 wsgi
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Flask With Server-Sent Event
Flask With Server-Sent EventFlask With Server-Sent Event
Flask With Server-Sent Event
 
Ansible Crash Course
Ansible Crash CourseAnsible Crash Course
Ansible Crash Course
 
Triple Blitz Strike
Triple Blitz StrikeTriple Blitz Strike
Triple Blitz Strike
 
Designing net-aws-glacier
Designing net-aws-glacierDesigning net-aws-glacier
Designing net-aws-glacier
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done right
 
Introduction to Elixir
Introduction to ElixirIntroduction to Elixir
Introduction to Elixir
 
Automation and Ansible
Automation and AnsibleAutomation and Ansible
Automation and Ansible
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECS
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Using Terraform.io (Human Talks Montpellier, Epitech, 2014/09/09)
Using Terraform.io (Human Talks Montpellier, Epitech, 2014/09/09)Using Terraform.io (Human Talks Montpellier, Epitech, 2014/09/09)
Using Terraform.io (Human Talks Montpellier, Epitech, 2014/09/09)
 
Refactoring terraform
Refactoring terraformRefactoring terraform
Refactoring terraform
 
Introduction to Ansible (Pycon7 2016)
Introduction to Ansible (Pycon7 2016)Introduction to Ansible (Pycon7 2016)
Introduction to Ansible (Pycon7 2016)
 
A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices
 

Viewers also liked

Viewers also liked (8)

The Berkshelf Way
The Berkshelf WayThe Berkshelf Way
The Berkshelf Way
 
Stay Awhile And Fiddle With Your Smartphone
Stay Awhile And Fiddle With Your SmartphoneStay Awhile And Fiddle With Your Smartphone
Stay Awhile And Fiddle With Your Smartphone
 
Managing PTZ cameras using Elixir and the Phoenix Framework
Managing PTZ cameras using Elixir and the Phoenix FrameworkManaging PTZ cameras using Elixir and the Phoenix Framework
Managing PTZ cameras using Elixir and the Phoenix Framework
 
Habitat 301: Building Habitats
Habitat 301: Building HabitatsHabitat 301: Building Habitats
Habitat 301: Building Habitats
 
Building And Releasing A Massively Multiplayer Online Game
Building And Releasing A Massively Multiplayer Online GameBuilding And Releasing A Massively Multiplayer Online Game
Building And Releasing A Massively Multiplayer Online Game
 
Build Your Own Real-Time Web Service with Elixir Phoenix
Build Your Own Real-Time Web Service with Elixir PhoenixBuild Your Own Real-Time Web Service with Elixir Phoenix
Build Your Own Real-Time Web Service with Elixir Phoenix
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using Erlang
 
Phoenix Framework
Phoenix FrameworkPhoenix Framework
Phoenix Framework
 

Similar to Atmosphere 2014

Sane SQL Change Management with Sqitch
Sane SQL Change Management with SqitchSane SQL Change Management with Sqitch
Sane SQL Change Management with Sqitch
David Wheeler
 
chef loves windows
chef loves windowschef loves windows
chef loves windows
Mat Schaffer
 

Similar to Atmosphere 2014 (20)

Using Test Kitchen for testing Chef cookbooks
Using Test Kitchen for testing Chef cookbooksUsing Test Kitchen for testing Chef cookbooks
Using Test Kitchen for testing Chef cookbooks
 
Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Chef Workshop: Setup Environment with Chef,Vagrant, and Berkshelf
Chef Workshop: Setup Environment with Chef,Vagrant, and BerkshelfChef Workshop: Setup Environment with Chef,Vagrant, and Berkshelf
Chef Workshop: Setup Environment with Chef,Vagrant, and Berkshelf
 
Chef conf-2014
Chef conf-2014Chef conf-2014
Chef conf-2014
 
DevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven InfrastructureDevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven Infrastructure
 
Chef infrastructure as code - paris.rb
Chef infrastructure as code - paris.rbChef infrastructure as code - paris.rb
Chef infrastructure as code - paris.rb
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Dev ops meetup
Dev ops meetupDev ops meetup
Dev ops meetup
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부
 
What Makes a Good Cookbook?
What Makes a Good Cookbook?What Makes a Good Cookbook?
What Makes a Good Cookbook?
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)
 
Sane SQL Change Management with Sqitch
Sane SQL Change Management with SqitchSane SQL Change Management with Sqitch
Sane SQL Change Management with Sqitch
 
chef loves windows
chef loves windowschef loves windows
chef loves windows
 
Configuration management with Chef
Configuration management with ChefConfiguration management with Chef
Configuration management with Chef
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Atmosphere 2014