Benefits and uses of Distillery?

Hi all
Could someone please explain me, what is the usage of https://github.com/bitwalker/distillery?
I read the documentation but could not configure it out for what distillery good for.
Thanks

3 Likes

From what I gather, it produces a single deployable package with Erlang/Elixir bundled. Think of your expectations about the environment when you’re deploying an Elixir application: you’re at least expecting to have Elixir already installed in that environment. Distillery produces packages that remove those expectations, as Erlang/Elixir installation will be embedded.
It might as well do more things, this is just what I gathered from a brief look at their README.

2 Likes

Elixir (like a lot of other languages and software development practices) considers three environments: dev, test and prod. Production releases have some differences like not having passwords or secrets freely showing. Distillery is meant to produce such production releases with minimal effort, in this case removing the dependencies which could break the execution. It seems to achieve this by embedding everything in the package:

That is exactly what this project does - it takes your Mix project and produces an Erlang/OTP release, a distilled form of your raw application’s components; a single package which can be deployed anywhere, independently of an Erlang/Elixir installation. No dependencies, no hassle.

This is a pure-Elixir, dependency-free implementation of release generation for Elixir projects. It is currently a standalone package, but may be integrated into Mix at some point in the future.

As far as I know this is a “remake” of Exrm (another project from the same developer) which was also meant to produce prod releases but from what I recall it has quite a few problems and limitations so he started this project from the ground up to also correct those issues.

5 Likes

As other have stated above, distillery (and exrm) aid in building a production OTP release. You may ask why is this important and why not just use the Elixir norm of mix/iex to manage a released app?

First, distillery builds a single releasable artifact that carries ERTS (Erlang run time system) with it. This means you do not need Erlang or Elixir installed on your PROD server(s), simplifying server setup and removing some attack vectors from your PROD server.

Additionally, you cannot do hot upgrades/downgrades unless you build an OTP release. Hot upgrades/downgrades are very nice to minimize downtime of your application.

Finally, an OTP release does not include the mix toolset (unless you configure it to), removing another attack vector from your application.

An added plus is the goal of distillery being pulled into mix as soon as it is ready. So we will have a release tool built right into Elixir!

I would highly recommend you put in the time to get comfortable with building releases with Distillery. It is well worth it as it makes deployment of your application much simpler.

3 Likes

I personally tried a couple of days ago, and failed, no windows support yet unlike exrm. Distillery is still new. ^.^

1 Like

True, though exrm’s Windows support is flaky at best from what I’ve heard, and did not support the full feature set that the *NIX side did, those two reasons are why I did not include it in Distillery. Someone I met at ElixirConf was kind enough to offer me a copy of Windows 10 to use for developing the Windows support in Distillery, so it is coming, but I don’t want to add it to Distillery until it’s ready and it can be properly supported :slight_smile:

Other than Windows support, I would absolutely encourage people to use Distillery over Exrm at this point.

6 Likes

Heh, all good. And I’ve actually not had any issues with exrm on Windows 10, we are using it in production here at my work by running the server as a windows service (on Windows Server 2008, dev’d on Win 10) with IIS proxy’ing to it. Yes that sounds as horrible as you could imagine; we are planning to switch to linux (actually illumos) over time, just has not happened yet. ^.^

1 Like

Haha yeah, that’s less than ideal, but having spent many years in the .NET/Microsoft world, the fact that you are even able to deploy Elixir apps is something to be thankful for :stuck_out_tongue: and it’s the reason why I even care about supporting Windows in the first place :slight_smile:

2 Likes

Oh I feel that. Dev’ing on Windows is down-right horrible compared to a well-set up Linux machine. This coming from someone who knows Visual Studio and the Windows kernel far far more intimately that most.

Yep, it works awesomely! Only issue I have is setting up an erlang mesh to connect off-server, but it is not a big deal and I am about 90% sure the windows firewall is messing with it but we do not ‘need’ that ability at this time so I’ve not looked in to it yet. :slight_smile:

2 Likes

What exactly is blocking distillery to work on Windows?

I have an app that has to work on multiple platforms, including Windows (client’s demand) and having distillery would have made my life easier.

1 Like

You can package your app in a Docker container that will work everywhere. Also this is a nice way to distribute your work and be sure that it’s simple to install and works as expected.

It’s not an option for me. I need to run my app on Windows. Docker is linux-only.

And my app has direct access to the hardware via NIFs, any sort of virtualization/containers is not an option. I just need to natively run it on Windows.

Both Elixir and Erlang work fine on Windows. I basically seek for tool for packaging it into a redistributable bundle.

1 Like

I didn’t try it, but: https://docs.docker.com/docker-for-windows/

Wow, I wasn’t aware of it. Anyway, my app won’t work in Docker due to the fact that I need to access something on the host machine via WIN32API.

It seems that it works only on Win10 and Server 2016. Totally not realistic, many users stay with older windows and it is not going to change soon. But thanks for the hint.

What exactly is blocking distillery to work on Windows?

Basically: time. I was recently sponsored a copy of Windows 10 which I plan to use to test/dev windows support in Distillery, but due to time constraints, I haven’t had time to set up a dev environment with it yet, so it currently is not possible for me to test, reproduce issues, etc. It is on my roadmap though, and if anyone is interested in contributing support for Windows, I’d be glad to provide guidance.

1 Like

How can I help?

1 Like

This issue is the best place to catch up and chime in with any feedback/questions.

1 Like