27
Elixir release and deploy utilities by Maksym Pugach, LITSLink

Maksym Pugach - Elixir Release and Deploy Utilities

Embed Size (px)

Citation preview

Page 1: Maksym Pugach - Elixir Release and Deploy Utilities

Elixir release and deploy utilitiesby Maksym Pugach, LITSLink

Page 2: Maksym Pugach - Elixir Release and Deploy Utilities

Release management

Release delivery (deploy)

Page 4: Maksym Pugach - Elixir Release and Deploy Utilities

*.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"}]}.

Page 5: Maksym Pugach - Elixir Release and Deploy Utilities

*.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,...

Page 6: Maksym Pugach - Elixir Release and Deploy Utilities

*.boot file8368 0364 0006 7363 7269 7074 6802 6b000c70 6572 665f 6578 616d 706c 656b 0005302e 312e 306c 0000 0062 6802 6400 09707265 4c6f 6164 6564 6c00 0000 0e64 000f6572 6c5f 7072 696d 5f6c 6f61 6465 7264000a 6572 6c5f 7472 6163 6572 6400 0665726c 616e 6764 0010 6572 7473 5f63 6f64655f 7075 7267 6572 6400 1f65 7274 735f

...

Page 7: Maksym Pugach - Elixir Release and Deploy Utilities

*.appup file{"4.0.4", [{<<".*">>,[{restart_application, asn1}]}], [{<<".*">>,[{restart_application, asn1}]}]}.

Page 8: Maksym Pugach - Elixir Release and Deploy Utilities

relup file

{"0.1.2", [{"0.1.1",[],[point_of_no_return]}], [{"0.1.1",[],[point_of_no_return]}]}.

Page 9: Maksym Pugach - Elixir Release and Deploy Utilities

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

Page 10: Maksym Pugach - Elixir Release and Deploy Utilities

Build tools

Page 11: Maksym Pugach - Elixir Release and Deploy Utilities

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

Page 12: Maksym Pugach - Elixir Release and Deploy Utilities

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

Page 13: Maksym Pugach - Elixir Release and Deploy Utilities

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

Page 14: Maksym Pugach - Elixir Release and Deploy Utilities

Release delivery

Page 15: Maksym Pugach - Elixir Release and Deploy Utilities

Heroku● As simple as git-push● Local development with Docker● Release history and rollback● No :observer but there are workarounds

Page 16: Maksym Pugach - Elixir Release and Deploy Utilities

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

Page 17: Maksym Pugach - Elixir Release and Deploy Utilities

Gatling by Hashrocket

● Phoenix oriented● Uses Distillery● As simple as git-push● Hot upgrades support

Page 18: Maksym Pugach - Elixir Release and Deploy Utilities

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

Page 19: Maksym Pugach - Elixir Release and Deploy Utilities

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”

Page 20: Maksym Pugach - Elixir Release and Deploy Utilities

dicon (Digital Conveyor) by Aleksei Mogusev

● Built on Elixir● Support configurations per target host● No build host● No hot upgrades● Lack of documentation

Page 21: Maksym Pugach - Elixir Release and Deploy Utilities

Bottler by Rubén Caro

● GCE support● Mix task to launch :observer● Mix task to exec● Rollback● Still beta● No hot upgrades

Page 22: Maksym Pugach - Elixir Release and Deploy Utilities

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

Page 23: Maksym Pugach - Elixir Release and Deploy Utilities

Write your own with hot-upgrades and clusters

Page 24: Maksym Pugach - Elixir Release and Deploy Utilities

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 developmentBuild host

Built on Elixir Bash Bash

Callbacks

Page 25: Maksym Pugach - Elixir Release and Deploy Utilities

Results of 2016 survey by Josh Adams at DailyDrip

Full survey: https://www.dailydrip.com/blog/elixir-users-survey-2016-results

Page 26: Maksym Pugach - Elixir Release and Deploy Utilities

Corrections?

Page 27: Maksym Pugach - Elixir Release and Deploy Utilities

Thank you