Re:Phoenix 1.0
by jake_morrison on Friday August 28, 2015 @09:55PM
(#10138706)
We deploy using Erlang "releases", which bundle the Erlang vm along with your application and it's dependencies into a tarball with a script to run the application. You don't need to install Erlang on the target system, just unpack and run.
We use "mix release" to build the tarball, scp to the server and unpack, then run using an upstart unit which runs "exec su -s /bin/sh -c 'exec "$0" "$@"' myuser -- /path/to/deploy/directory/bin/myapp foreground"
It's pretty painless. We are automating with Fabric now, but will likely be switching to Ansible soon.
There's releases where you can build a tarball[0] or RPM[1] that includes your application byte code plus the BEAM. Here's how you can go about building, testing and deploying a release in the context of Phoenix specifically: http://www.phoenixframework.org/v0.13.1/docs/advanced-deploy...
Optionally, you could cross compile locally or compile on a build server and have the other nodes pull from there, same as you would do in Go.
AFAIK, bytecode compiled on one Erlang system runs on any other. Bytecode is stored in .beam files, and -AIUI- .beam files are always forward compatible.
However, I'm not sure if bytecode compiled with an Erlang version >=17.0 will run on earlier versions of Erlang if it makes use of maps. (Maps are a new type that was introduced in Erlang 17.0.) I should really test this.
Forgive me if I've missed something. I'm just getting excited about elixir at this stage.