Atmosphere 2014

1,444 views

Published on

Published in: Technology, Self Improvement
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,444
On SlideShare
0
From Embeds
0
Number of Embeds
99
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Atmosphere 2014

  1. 1. Holy shitthe Polish knowhowto drink. I hope nobodycantell thatI'm stilldrunk from lastnight ByJamieWinsor
  2. 2. BerkshelfCoreTeam » Jamie Winsor <jamie@vialstudios.com> » Seth Vargo <sethvargo@gmail.com> » Michael Ivey <michael.ivey@riotgames.com>
  3. 3. berkshelf Chef Cookbook manager and dependency resolver » Retrieve a cookbooks dependencies » Package cookbooks and their dependencies » Author new cookbooks
  4. 4. » League of Legends » Guild Wars 2 » TERA » Lord of The Rings Online » Dungeons and Dragons Online » Asheron's Call
  5. 5. "DeployWindows"
  6. 6. Risk Mitigation
  7. 7. Introducing change intoasystem isa synonym for introducing risk
  8. 8. Notdeploying isa risk,too
  9. 9. Q.What? A. Graphingthe risk ofmultiple changes overtime isn'tlinear
  10. 10. 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
  11. 11. Notdeployingat5pm isn'tRobbing peter to paypaul
  12. 12. 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
  13. 13. When shouldwe deploy?
  14. 14. Yeah, I'm gonna release itat5PM ona Friday.
  15. 15. DeployWindows Aclear indicatorthatyour release process is broken
  16. 16. Whataboutthe risk? That'swhywe have deploywindows
  17. 17. Theyexistbecause Deployment wasan afterthought And it'swithinyour powerto control deploymenttimesto reduce risk
  18. 18. Thatsoftware doesn'teven wantto be deployed
  19. 19. JustDeployAlready
  20. 20. Howdowe reduce risk while stillallowing for change
  21. 21. Continuous Delivery& Devops Tothe rescue
  22. 22. “Justrub some DevOps on it.” Joshua Timberman
  23. 23. DevOps isasoftware developmentpattern
  24. 24. DevOps is not » A position » A team » A department » Or an organization
  25. 25. “Disruptive startup is hiring DevOps ninjas” LinkedIn Spammer
  26. 26. You can'tbuya DevOpstooland You can'tbuyacontinuous deliverytool
  27. 27. Software doesn't solve problems. People do.
  28. 28. “Ifyou putthe right people inthe right roomthey'llsolve the problemthe rightway” Jeff Hackert
  29. 29. ComingTogether
  30. 30. Youwillneedto changeyour developmentand release process
  31. 31. Adopting devops is MUCH EASIER on newprojects
  32. 32. Startsmall Your firstprogram is typically"Hello,World!"
  33. 33. Automateandtest everything
  34. 34. Version, package, and release EVERYTHING
  35. 35. Let's build something
  36. 36. Application Checklist » Source code » Build tasks » Release tasks » Cookbook
  37. 37. Resulting in 1.Software Artifact (app.tar.gz) 2.Cookbook Artifact (cookbooks.tar.gz) 3.Installation | Upgrade | Configuration Docs
  38. 38. Ifyou'readeveloper Give these three things to your Operators for every release.
  39. 39. Elixir
  40. 40. GenerateYour Project $ mix new highfive
  41. 41. Addto source control $ cd highfive $ git init . $ git remote add origin git@github.com:reset/highfive.git
  42. 42. GenerateYour application's Cookbook $ berks cookbook highfive ./cookbook --pattern environment --skip-git
  43. 43. Make deployment partofyour build process
  44. 44. 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__))
  45. 45. $ cat cookbook/attributes/default.rb # # Cookbook Name:: highfive # Attribute:: default # default[:highfive][:release] = Highfive::Chef.cookbook_version(run_context)}
  46. 46. $ 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
  47. 47. EnvironmentCookbook » Nearly identical to an Application Cookbook » Has it's Berksfile.lock committed into version control
  48. 48. BuildTasks » Version bump $ mix version.bump patch » Compile $ mix compile » Test $ mix test
  49. 49. Version Bumping Generates a VERSION file at the root of the project $ cat VERSION 1.0.0
  50. 50. Howdowe getour compiled software in ourvm?
  51. 51. Buildand package release » OTP Release assemble $ mix release.assemble » Package $ mix package $ ls pkg highfive-osx.tar.gz
  52. 52. We needtoassemble arelease forthe os we're deployingto
  53. 53. BuildaBuild Server
  54. 54. Build Server Recipe $ cat cookbook/recipe/build_server.rb include_recipe "highfive::_common" include_recipe "build-essential::default" include_recipe "elixir::default"
  55. 55. 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"
  56. 56. VagrantBuilderOn-demandvirtualized build server
  57. 57. 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
  58. 58. Build it(from our hostmachine) $ vagrant up --provision .... provisioning ... $ ls pkg highfive-linux-x86-tar.gz
  59. 59. deploying our artifact
  60. 60. 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"
  61. 61. Update Cookbook Dependencies depends "build-essential", "~> 2.0" depends "elixir", "~> 0.5" depends "libarchive"
  62. 62. 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:
  63. 63. Kitchen Converge $ cd cookbook $ kitchen converge -----> Starting Kitchen (v1.2.2.dev) ... -----> Kitchen is finished. (14m6.31s)
  64. 64. Generatingthe Cookbookartifact $ berks package pkg/cookbooks.tar.gz -b cookbook/Berksfile Cookbook(s) packaged to pkg/cookbooks.tar.gz
  65. 65. Thearchive contains » The Berksfile.lock from resolution » A cookbooks directory containing each cookbook found in the Berksfile.lock
  66. 66. Putthesearchives in anartifactserver
  67. 67. ArtifactServers » Github | Github Enterprise » Sonatype's Nexus » Artifactory » Basic Auth HTTP Server (sadface) (https://artifacts.myorg.com/myapp/1.2.3/ myapp.tar.gz)
  68. 68. Github Releasesand ReleaseAssets
  69. 69. 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
  70. 70. 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 } }
  71. 71. Releaseartifactsallowusto » Build a new environment with a specific version » Upgrade pre-existing environments » Promote through logical environments (Dev, Stage, Production)
  72. 72. DeployIt
  73. 73. Create Environment $ knife environment create highfive-dev
  74. 74. BootstrapANode $ knife ec2 server create -I ami-0eb2d83e -E highfive-dev
  75. 75. Berkflow ACookbook-Centric Deploymentworkflowtool
  76. 76. InstallBerkflowwith Chef-DK $ chef gem install berkflow $ export PATH=/opt/chefdk/embedded/bin:$PATH $ which blo /opt/chefdk/embedded/bin/blo
  77. 77. "Install"the cookbookartifact intoyour ChefServer $ blo install https://github.com/reset/highfive/releases/download/v1.0.0/cookbooks.tar.gz
  78. 78. "Upgrading"aChefEnvironment $ blo upgrade highfive-dev highfive 1.2.1 Or upgrade to latest $ blo upgrade highfive-dev highfive latest
  79. 79. One Button Upgrade
  80. 80. Beacatalystfor change Butdon'texpecta parade. It's not coming.
  81. 81. Even ifitdoes Youwon'thaveyour own float
  82. 82. WannaMake Games? http://undeadlabs.com/jobs/ » Game Programmer » Game Producer » Game Animator » Game Designer
  83. 83. JamieWinsor @resetexistence github.com/reset

×