Live data from Hacker News

Bakeware: Compile any Elixir application into a single binary

github.com

21–30 of 32 posts

Re: Bakeware: Compile any Elixir application into a single binary

#21
post #13

Earlier quoted context omitted.

I remember being a reviewer for an Elixir book where the first chapter was listing the pros and cons of Elixir, and one of the cons was: it's kind of hard to manage deployment of Elixir applications. My feedback was "hum, that's kind of a turn off for someone trying to learn the language/tech no?" I think the community has been looking for something for a while now and is iterating (too?) quickly. There was erlang re…

It took me 1 hour to convert a production app from Distillery to native releases when Elixir 1.9 released 2 years ago. And deployment in 2021, whatever the language, is best served with containers. Elixir is not harder to deploy than a Django or Node app. In fact, releases and post-deploy ops are pretty well documented: https://hexdocs.pm/mix/Mix.Tasks.Release.html Phoenix also has an example multi-stage Dockerfile w…

> And deployment in 2021, whatever the language, is best served with containers.

...in 2020 I deployed to bare metal servers. Mix released a gzip to S3 and pulled the artifact down, systemctl restart dnautics_service.

You're making me feel like some sort of dinosaur.

Re: Bakeware: Compile any Elixir application into a single binary

#23
post #13

Earlier quoted context omitted.

I remember being a reviewer for an Elixir book where the first chapter was listing the pros and cons of Elixir, and one of the cons was: it's kind of hard to manage deployment of Elixir applications. My feedback was "hum, that's kind of a turn off for someone trying to learn the language/tech no?" I think the community has been looking for something for a while now and is iterating (too?) quickly. There was erlang re…

It took me 1 hour to convert a production app from Distillery to native releases when Elixir 1.9 released 2 years ago. And deployment in 2021, whatever the language, is best served with containers. Elixir is not harder to deploy than a Django or Node app. In fact, releases and post-deploy ops are pretty well documented: https://hexdocs.pm/mix/Mix.Tasks.Release.html Phoenix also has an example multi-stage Dockerfile w…

I agree! As a learning project, I wrote a small service[0] that reports data from our solar panels to InfluxDB every second.

I thought deploying would be a pain. It was really painless: a matter of cloning on the home server, running ‘mix release’ and pointing a systemd unit to the start script it generated.

It was a pleasant surprise, especially coming from the Django world where anything deployment related would be a day’s work.

[0] https://github.com/matteing/mate3s-influx-reporter

Re: Bakeware: Compile any Elixir application into a single binary

#24
post #9
post #3

My holy grail would be to (somehow) create a release on Windows (my dev system) and deploy on Linux (our prod servers). However, I have little hope because of the Erlang binaries requirement. Still, you can always hope :)

If all goes to plan, I am planning on sponsoring a bounty to get zig cc to cross-compile erlang this summer. In theory, that should enable what you're looking for.

That’s brilliant!

Re: Bakeware: Compile any Elixir application into a single binary

#25

Earlier quoted context omitted.

It took me 1 hour to convert a production app from Distillery to native releases when Elixir 1.9 released 2 years ago. And deployment in 2021, whatever the language, is best served with containers. Elixir is not harder to deploy than a Django or Node app. In fact, releases and post-deploy ops are pretty well documented: https://hexdocs.pm/mix/Mix.Tasks.Release.html Phoenix also has an example multi-stage Dockerfile w…

> And deployment in 2021, whatever the language, is best served with containers. ...in 2020 I deployed to bare metal servers. Mix released a gzip to S3 and pulled the artifact down, systemctl restart dnautics_service. You're making me feel like some sort of dinosaur.

Bare Metal / Containers / VM It's all about managing your dependency chain, and how much variation of environment you're willing to accept. You don't need to feel like a dinosaur if what you're doing is principled and reasonable.

There's no one size fits all.

Re: Bakeware: Compile any Elixir application into a single binary

#26

Earlier quoted context omitted.

It took me 1 hour to convert a production app from Distillery to native releases when Elixir 1.9 released 2 years ago. And deployment in 2021, whatever the language, is best served with containers. Elixir is not harder to deploy than a Django or Node app. In fact, releases and post-deploy ops are pretty well documented: https://hexdocs.pm/mix/Mix.Tasks.Release.html Phoenix also has an example multi-stage Dockerfile w…

> And deployment in 2021, whatever the language, is best served with containers. ...in 2020 I deployed to bare metal servers. Mix released a gzip to S3 and pulled the artifact down, systemctl restart dnautics_service. You're making me feel like some sort of dinosaur.

Don't let the kids get you down. My deployment scripts look something like this:

rsync --rsync-path=/usr/bin/openrsync -r --delete config lib mix.exs mix.lock priv server:my_project

ssh server "tmux respawn-window -t my_project:1 -k"

It's only weird if it doesn't work, right?

Re: Bakeware: Compile any Elixir application into a single binary

#27

Earlier quoted context omitted.

> And deployment in 2021, whatever the language, is best served with containers. ...in 2020 I deployed to bare metal servers. Mix released a gzip to S3 and pulled the artifact down, systemctl restart dnautics_service. You're making me feel like some sort of dinosaur.

Bare Metal / Containers / VM It's all about managing your dependency chain, and how much variation of environment you're willing to accept. You don't need to feel like a dinosaur if what you're doing is principled and reasonable. There's no one size fits all.

Haha we bought these servers for 5k, very op, but since we had a rack full of HW (that this one blade was managing) anyways, the server price/power consumption for a 1U was a drop in the bucket. Very strange world. I think the server was at 10% CPU consumption, and we didn't bother doing the erlang "turn off IO polling for modern cloud operating systems" option.

Re: Bakeware: Compile any Elixir application into a single binary

#28

Earlier quoted context omitted.

> And deployment in 2021, whatever the language, is best served with containers. ...in 2020 I deployed to bare metal servers. Mix released a gzip to S3 and pulled the artifact down, systemctl restart dnautics_service. You're making me feel like some sort of dinosaur.

Don't let the kids get you down. My deployment scripts look something like this: rsync --rsync-path=/usr/bin/openrsync -r --delete config lib mix.exs mix.lock priv server:my_project ssh server "tmux respawn-window -t my_project:1 -k" It's only weird if it doesn't work, right?

I also use tmux as part of my deploy process. ;)

Re: Bakeware: Compile any Elixir application into a single binary

#29

Earlier quoted context omitted.

> And deployment in 2021, whatever the language, is best served with containers. ...in 2020 I deployed to bare metal servers. Mix released a gzip to S3 and pulled the artifact down, systemctl restart dnautics_service. You're making me feel like some sort of dinosaur.

Bare Metal / Containers / VM It's all about managing your dependency chain, and how much variation of environment you're willing to accept. You don't need to feel like a dinosaur if what you're doing is principled and reasonable. There's no one size fits all.

[deleted]

Re: Bakeware: Compile any Elixir application into a single binary

#30

Earlier quoted context omitted.

It took me 1 hour to convert a production app from Distillery to native releases when Elixir 1.9 released 2 years ago. And deployment in 2021, whatever the language, is best served with containers. Elixir is not harder to deploy than a Django or Node app. In fact, releases and post-deploy ops are pretty well documented: https://hexdocs.pm/mix/Mix.Tasks.Release.html Phoenix also has an example multi-stage Dockerfile w…

> And deployment in 2021, whatever the language, is best served with containers. ...in 2020 I deployed to bare metal servers. Mix released a gzip to S3 and pulled the artifact down, systemctl restart dnautics_service. You're making me feel like some sort of dinosaur.

If you're already using systemd, you can use systemd-nspawn to launch your service in a container and nothing would change in your workflow.
Post reply on HN