SupaSaya

SupaSaya

I am still doing something similar to this:

https://medium.com/@zek/deploy-early-and-often-deploying-phoenix-with-edeliver-and-distillery-part-one-5e91cac8d4bd
https://medium.com/@zek/deploy-early-and-often-deploying-phoenix-with-edeliver-and-distillery-part-two-f361ef36aa10

I deployed 10+ apps to production and it still always takes me at least 1-2h. Most of the time goes to installing different dependencies for different distros(and versions of these) + solving cryptic erlang errors(once I spent 4h on single db migration error).

Building/deploying further releases/upgrades on small VPS’s is also very very slow(think DO’s $5 droplet).

This is the biggest reason I started using node and go for simple/medium complex projects.

A while ago I also had ansible scripts to set-up everything but these got outdated and created enough additional complexity that made me stop using them. Using hosting services like heroku just for this is also no-go for me or my clients.

Showing Posts 1 to 10

tty

tty

I usually make sure my build machine and target server are the same: same OS, same versions of libs.

Then make a Release Package. From there its a straight scp+untar and its up and running.

ryanswapp

ryanswapp

Same boat. It takes a bit to deploy an elixir app. That said, once everything is setup it only takes a minute or so after running the edeliver command. It would be nice if there were more options for deploying. I’m aware of Gigalixir and Heroku as the only two quick/easier options (although Gigalixir didn’t feel quick - was a bit of a headache trying to get it to work whereas Heroku was just an add your buildpacks and go experience. Perhaps Gigalixir is easier now). Supposedly there is an easy deployment tool in the works that will be a part of the core framework. Not sure where things are at with that though.

pedromvieira

pedromvieira

I used this Guide to start our current deployment Docker / Kubernetes on GCP.
It is really easy and fast to deploy a new build.

zkessin

zkessin

Yes, once you build a release it is pretty easy. I have an email course you can get (its free) on how to do it

https://elixirtraining.org/release_email_course.html

sfusato

sfusato

This is my current strategy as well: same build and target machine + Distillery releases and hot-upgrades.

Tried Edeliver at some point, but had some issues along the way. I also felt it added extra complexity to my setup.

Look over the Distillery documentation: Home - Distillery Documentation. It’s just as good as you would expect in the Elixir ecosystem :love_you_gesture:. Has multiple guides for different scenarios.

thenrio

thenrio

Similar path:

  • build a distillery release using base docker image having same system as target host : elixir:1.8.1-slim for a stretch host.
  • make debian package.
  • install package on host (ssh).

Hot upgrade is not implemented (I do not need it).

egze

egze

Woah. Never heard about the debian package approach before.

Are you using GitHub - johnhamelink/exrm_deb: Create a deb for your elixir release with ease · GitHub? What happens after you install the .deb package? What do you start, how?

thenrio

thenrio

I used dh_make as suggested in 15.2. Building your First Package.

I did not know about exrm_deb…

I found dh_make upsetting at first approach and I did ran away a couple of times from it in the past but it now fits my bill and I can use it for other contexts.
Going into files details, I have

debian/.gitignore
debian/changelog
debian/compat
debian/control
debian/copyright
debian/lift.env
debian/lift.ex.dirs
debian/lift.ex.install
debian/lift.ex.logrotate
debian/lift.ex.postrm
debian/lift.ex.preinst
debian/lift.ex.prerm
debian/lift.ex.service
debian/rules
debian/source/format

The approach I choose is a long running process owned by a dedicated user, environment in a dedicated env file /etc/lift/lift.env

service: systemd, excerpt:

[Service]
EnvironmentFile=/etc/lift/lift.env
ExecStart=/bin/sh -c '/usr/lib/lift.ex/bin/lift foreground >> /var/log/lift/lift.log 2>&1'
Restart=on-failure
User=lift

That is, I start the release much like it would in a docker container, and this what systemd is expecting for a simple type.

package is built with a makefile (33 lines, 982 bytes).

egze

egze

This is nice. How does updating work? Simply reinstall the package and tell systemd to restart?

thenrio

thenrio

Just install new package.

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New

Other Trending Topics Top

mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews