Date post: | 11-Apr-2017 |
Category: |
Technology |
Upload: | elixir-meetup |
View: | 19 times |
Download: | 1 times |
Elixir release and deploy utilitiesby Maksym Pugach, LITSLink
Release management
Release delivery (deploy)
http://learnyousomeerlang.com/release-is-the-word
*.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"}]}.
*.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,...
*.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
...
*.appup file{"4.0.4", [{<<".*">>,[{restart_application, asn1}]}], [{<<".*">>,[{restart_application, asn1}]}]}.
relup file
{"0.1.2", [{"0.1.1",[],[point_of_no_return]}], [{"0.1.1",[],[point_of_no_return]}]}.
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
Build tools
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
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
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
Release delivery
Heroku● As simple as git-push● Local development with Docker● Release history and rollback● No :observer but there are workarounds
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
Gatling by Hashrocket
● Phoenix oriented● Uses Distillery● As simple as git-push● Hot upgrades support
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
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”
dicon (Digital Conveyor) by Aleksei Mogusev
● Built on Elixir● Support configurations per target host● No build host● No hot upgrades● Lack of documentation
Bottler by Rubén Caro
● GCE support● Mix task to launch :observer● Mix task to exec● Rollback● Still beta● No hot upgrades
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
Write your own with hot-upgrades and clusters
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
Results of 2016 survey by Josh Adams at DailyDrip
Full survey: https://www.dailydrip.com/blog/elixir-users-survey-2016-results
Corrections?
Thank you