Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Maksym Pugach - Elixir Release and Deploy Utilities

169 views

Published on

Elixir Club 6 - March 18, 2017
Nivki Hall

Published in: Technology
  • Be the first to comment

Maksym Pugach - Elixir Release and Deploy Utilities

  1. 1. Elixir release and deploy utilities by Maksym Pugach, LITSLink
  2. 2. Release management Release delivery (deploy)
  3. 3. http://learnyousomeerlang.com/release-is-the-word
  4. 4. *.rel file {release,{"my_mega_app","0.1.0"}, {erts,"8.2"}, [{kernel,"5.1.1"}, {stdlib,"3.2"}, {distillery,"1.2.2"}, {jiffy,"0.14.11"}, {cowboy,"2.0.0-pre.4"}, ... {elixir,"1.4.1"}, {perf_example,"0.1.0"}, {iex,"1.4.1"}, {sasl,"3.0.2"}]}.
  5. 5. *.script file %% script generated at {2017,3,12} {10,24,44} {script, {"perf_example","0.1.0"}, [{preLoaded, [erl_prim_loader,erl_tracer,erlang,erts_code_purger, erts_dirty_process_code_checker,erts_internal, erts_literal_area_collector,init,otp_ring0,prim_eval,prim_file, prim_inet,prim_zip,zlib]}, {progress,preloaded}, {path,["$ROOT/lib/kernel-5.1.1/ebin","$ROOT/lib/stdlib-3.2/ebin"]}, {primLoad, [error_handler,application,application_controller,application_master, ...
  6. 6. *.boot file 8368 0364 0006 7363 7269 7074 6802 6b00 0c70 6572 665f 6578 616d 706c 656b 0005 302e 312e 306c 0000 0062 6802 6400 0970 7265 4c6f 6164 6564 6c00 0000 0e64 000f 6572 6c5f 7072 696d 5f6c 6f61 6465 7264 000a 6572 6c5f 7472 6163 6572 6400 0665 726c 616e 6764 0010 6572 7473 5f63 6f64 655f 7075 7267 6572 6400 1f65 7274 735f ...
  7. 7. *.appup file {"4.0.4", [{<<".*">>,[{restart_application, asn1}]}], [{<<".*">>,[{restart_application, asn1}]}] }.
  8. 8. relup file {"0.1.2", [{"0.1.1",[],[point_of_no_return]}], [{"0.1.1",[],[point_of_no_return]}]}.
  9. 9. release tarball ● *.rel ● boot script ● relup ● all compiled *.beam files required by the app ● target ERTS ● sys.config for app configuration ● vm.config for VM configuration ● shell script to set up environment and run the release
  10. 10. Build tools
  11. 11. Relx by Erlware ● The primary tool for building releases of Erlang applications ● Can work with Elixir applications as well with some additional effort ● Does not auto-generate appups for hot upgrades/downgrades
  12. 12. exrm (Elixir Release Manager) by Paul Schoenfelder (bitwalker) ● Has been the predominant tool for building releases of Elixir applications ● Mix-only, auto-generates hot upgrades/downgrades ● Ultimately is an automation wrapper around Relx ● Does not support umbrella applications ● Now deprecated in favor of Distillery
  13. 13. Distillery by Paul Schoenfelder (bitwalker) ● Written in Elixir, with no dependencies ● Automatically determines what applications are required in the release, even if you have dependencies which are missing an application in their mix.exs ● Builds releases containing any combination of apps in the umbrella ● Has environments to configure releases differently ● Support to define more than one release ● Event hooks ● Custom commands ● Template overlays ● Faster than exrm
  14. 14. Release delivery
  15. 15. Heroku ● As simple as git-push ● Local development with Docker ● Release history and rollback ● No :observer but there are workarounds
  16. 16. Nanobox ● Free for open-source and personal projects ● Docker based ● Local development with docker container ● Digital Ocean, AWS and own servers integrations ● Logging ● SSL Encryption ● Mac/Windows/Linux clients ● Alerts ● Load Balancing ● Horizontal and Vertical Auto Scaling ● Health Monitoring
  17. 17. Gatling by Hashrocket ● Phoenix oriented ● Uses Distillery ● As simple as git-push ● Hot upgrades support
  18. 18. exdm by Joe Yates ● Special for exrm ● Mix tasks to deploy applications, check their status and start and stop them ● Defines multiple stages like production, staging, ci etc. ● Latest commit on 2016.01.20
  19. 19. edeliver by Bold Poker ● Based on deliver ● Hot upgrades ● Release is built on remote host similar to production ● Can utilize Distillery, exrm and relx to build releases ● Auto versioning ● OvermindDL1: “'edeliver' has major issues for us here (since we use both windows and linux and its windows support was... well, crap....) so we've ignored it”
  20. 20. dicon (Digital Conveyor) by Aleksei Mogusev ● Built on Elixir ● Support configurations per target host ● No build host ● No hot upgrades ● Lack of documentation
  21. 21. Bottler by Rubén Caro ● GCE support ● Mix task to launch :observer ● Mix task to exec ● Rollback ● Still beta ● No hot upgrades
  22. 22. Ansible by RedHat ● Configuration management ● App deployment ● Manage machines in parallel ● Agentless ● Manage new remote machines instantly, without bootstrapping any software ● Trivializing things like zero downtime rolling updates with load balancers
  23. 23. Write your own with hot-upgrades and clusters
  24. 24. Heroku Nanobox Gatling exdm Edeliver dicon Bottler Ansible Environments tricky to implement Multiple hosts at a time Launch trigger push CLI push Mix Mix tasks Mix Mix CLI Hot upgrades Special integrations for cloud providers is a provider AWS, DO, custom S3 for releases GCE Rollback Environment for local development Build host Built on Elixir Bash Bash Callbacks
  25. 25. Results of 2016 survey by Josh Adams at DailyDrip Full survey: https://www.dailydrip.com/blog/elixir-users-survey-2016-results
  26. 26. Corrections?
  27. 27. Thank you

×