Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hackademy Devops

ProdOps
November 08, 2013
360

Hackademy Devops

Fast intro to Devops culture, tools and understanding for the students of http://hackademy.500tech.com/.

ProdOps

November 08, 2013
Tweet

Transcript

  1. I like writing code design patterns the Integrated Development Environment

    aka. IDE I like less... reading manual pages troubleshooting servers configuration files lifting heavy things managing services and packages software deployments ... devops heroes
  2. ” “ things developers say ... I don't do system

    related tasks, especially not in production. - Developer can someone else do it this time please? pretty please?
  3. ” “ more things developers say ... - The same

    Developer Give me full control, or else when things go wrong, I am powerless to fix it. Just changed motorcycle wheels. I’ll jump anyway, it will be okay ...
  4. I finished writing the code! Server room Servers Racks Labor

    Electricity & AC Configuration Deployment $150,000,000 + 16 months When can our customers start paying? Oh, we probably need a couple more things ... Oh, oh, and I almost forgot. Ahh, I'm also gonna need you to go ahead and come in on Sunday, too... ... devops heroes
  5. use the Cloud the what? who are you? I'm Joana,

    ... the fairy godmother, ... ahh, never mind me. Just use the Cloud Luke, err.. Peter. ... devops heroes
  6. IaaS vs. PaaS complex painful do it yourself total freedom

    total freedom cheaper better performance simple comfortable someone else "did it" constraints conventions expensive so-so performance ... the cloud
  7. Microsoft IaaS vs. PaaS Microsoft Windows Azure "Virtual Machines" Microsoft

    Windows Azure "Web Sites" everything works git push to deploy infrastructure pain custom deploys has ActiveDirectory! windowsazure.com ... the cloud
  8. Google IaaS vs. PaaS Google "Compute Engine" Google "App Engine"

    custom APIs lots of limitations lots of abilities includes: Java, Go, PHP, Python and much much more... no longer beta! Google I/O release per-minute billing cloud.google.com ... the cloud
  9. less control more comfort Amazon AWS IaaS vs. PaaS AWS

    EC2 AWS BeanStalk almost full control no comfort aws.amazon.com AWS OpsWorks AWS CloudFormation ... the cloud
  10. git push deploy lots of magic easy scalability many partners

    expensive poor performance IaaS vs. PaaS Salesforce Heroku heroku.com I dont like "magic", give me more control! You say its slow and expensive? ... no no, it will not do. ... the cloud
  11. I can't deploy to a "platform" We will use servers

    in the Cloud! Just tell me when customers start paying! ... devops heroes
  12. what someone has to actually do to use Servers in

    the (AWS) Cloud - For each world region - Define architecture (app+db+cache+stuff) - Select instance types and OS images (AMI) - Proper security groups (firewalls) - Generate SSH keys - Install packages - Configure services - Deploy application - Have a nervous breakdown - Repeat from start for each server - Profit!
  13. That is a lot of work. So many things can

    go wrong ... ... devops heroes
  14. How do I do the same thing a hundred times

    without making mistakes? Chef, or Puppet, or CFEngine, or ... so many options. ... devops heroes
  15. redis cookbook cookbooks/redis/recipes/default.rb package "redis-server" do action :upgrade end service

    "redis-server" do action :nothing supports status: true, restart: true end template "/etc/redis/redis.conf" do source "redis.conf.erb" owner "root" mode "0644" variables({ bind: node[:redis][:bind] }) notifies :restart, "service[redis-server]" end 1. cookbook/redis/attributes/default.rb 2. solo.json ... chef
  16. cookbooks/redis/attributes/default.rb default[:redis][:bind] = "127.0.0.1" cookbooks/redis/templates/default/redis.conf.erb # If you want you

    can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. bind <%= @bind %> ... template "/etc/redis/redis.conf" do ... variables({ bind: node[:redis][:bind] }) end redis cookbook ... chef
  17. running chef-solo $ chef-solo -c solo.rb -j solo.json ... solo.rb

    cookbook_path "cookbooks" solo.json { "run_list": "recipe[redis]" } ... chef
  18. $ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client,

    version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade - upgrade package redis-server from uninstalled to 2:2.2.12-1build1 * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create (up to date) Chef Client finished, 1 resources updated First run installs redis, creates configuration file. ... chef
  19. Second time, everything is already up to date. Idempotency! ƒ[ƒ(x)]

    ≡ ƒ(x) $ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client, version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade (up to date) * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create (up to date) Chef Client finished, 0 resources updated ... chef
  20. making a small change to JSON parameters passed to Chef

    run. running chef-solo solo.json { "redis": { "bind": "0.0.0.0" }, "run_list": "recipe[redis]" } ... chef
  21. $ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client,

    version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade (up to date) * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create - update template[/etc/redis/redis.conf] from 81b4f1 to 8a6cec --- /etc/redis/redis.conf 2011-07-27 17:26:50.000000000 +0000 +++ /tmp/chef-rendered-template20130406-2537-f8vlv6 2013-04-06 ... @@ -27,7 +27,7 @@ # If you want you can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. # -bind 127.0.0.1 +bind 0.0.0.0 # Specify the path for the unix socket that will be used to listen for # incoming connections. There is no default, so Redis will not listen * service[redis-server] action restart - restart service service[redis-server] Chef Client finished, 2 resources updated ... chef
  22. A single server is just not enough … how do

    I scale? I have some pretty graphs for you ... ... devops heroes
  23. ◦ Interactions over processes and tools. ◦ Continuous delivery of

    value. ◦ Welcome changing requirements. ◦ Provide an environment for motivated individuals to succeed. Culture wtf is ... devops parts from agilemanifesto.org
  24. “Between 12:00 AM and 11:59 PM on April 25, 2013,

    Quora released new versions of the site 46 times. This was a normal day for us.” - Quora engineering.quora.com/Continuous-Deployment-at-Quora “Deployment every 11.6s, 1,079 max in one hour. 10,000 mean number of hosts per deployment, with 30,000 maximum” - Amazon. com youtube.com/watch?v=PW1lhU8n5So “On the Google Consumer Surveys team, 8 minutes after you commit code it's live in production.” - Google developers.google.com/live/shows/772717729 “10+ deploys per day.” - John Allspaw, 2009 youtube.com/watch?v=LdOe18KhtT4 wtf is ... devops
  25. • Minimize required manual work. • Simplicity is essential. •

    Working software over comprehensive documentation. • Easiest thing to solve, often neglected. Automation wtf is ... devops
  26. ◦ Measure everything as often as possible. ◦ Metrics of

    performance, process and people. ◦ Unprecedented real-time visibility. ◦ Enable continuous improvement. (Kaizen) Measurement wtf is ... devops
  27. “... we also track really important stuff, like how much

    coffee is left in the kitchen” - Etsy codeascraft.com/2011/02/15/measure-anything-measure-everything end of 2009 end of 2012 Etsy.com : Deploys per day Measure Everything wtf is ... devops
  28. Why do it? fast iterations ⇒ fast feedback loops Customer

    Business Release Feedback wtf is ... devops
  29. ◦ Expand creativity and knowledge. ◦ Feedback and learning for

    everyone. ◦ Collaboration of diverse people on shared ideas. ◦ Empowerment of teams and individuals. Sharing wtf is ... devops