I would really like some sort of officially-supported, up-to-date DevOps guide + tooling for deploying Elixir projects, something to fill in the spectrum between “fully custom process” and “do everything for me.” Something that would allow me to grow my DevOps skills with my application development skills. It should be built off the native Mix release features shipped in the past year, because I’d like to support the official tooling. I think improving the story around deployment this way would really help grow the community.
If this already exists somewhere, please tell me I’m wrong and let me know.
DevOps is hard. I’m no expert. I’ve only been poking around at available options for the last couple months while building my projects. “Poking around” includes reading various blog and forum posts, plus trying out some of the examples.
This pseudo-rant may be inaccurate, since I’m new to all this stuff, so I may be missing things. Please forgive my ignorance and correct me if that’s the case.
The Elixir DevOps Coin
I see DevOps on Elixir as a coin. On one side, you have the fully-customized pipelines that people build. These provide total freedom of choice. It’s Easy to Change. Don’t like AWS’s pricing? Fine, try DigitalOcean, Linode, etc. The price for this freedom is learning how to do DevOps on Elixir. I see this as a worthwhile pursuit, if only I could find the time to study it while building my application’s features against deadlines (I’m the sole developer on my projects).
I feel like many are in the same boat that I am, and that’s why solutions like Render and Gigalixir are so popular. I personally use Render, and I think it’s a great service. These represent the other side of the spectrum: basically, “do everything for me.” You provide the Git remote repository, maybe some environment variables, and that’s (mostly) it. It Just Works. And that’s all many will need. The tradeoff here, of course, is that it’s not very Easy to Change.
Elixir DevOps as a Spectrum
What if I want to expand my knowledge of DevOps through the process of building my application? That is, start with something that’s totally “batteries included”, and gradually move towards a custom system, depending on my application’s needs? And rather than have it happen all at once, have it happen incrementally? What if DevOps was a spectrum rather than a coin?
Maybe it is, and I’m just wrong, but if that’s the case I haven’t found what I’m looking for yet.
I’ve looked into various projects along various stages of the spectrum, most notably Distillery. In fact, the Distillery “Deploy to AWS” guide is one of the reasons I’m writing this. This is a great example of what I’m looking for! It lays everything out in code so if you want to change something, it’s not difficult to experiment with. It’s very Easy to Change.
I could just use Distillery – and, indeed, from browsing the forum it seems that many people are still using it – but I think that for my projects, I’d like to support the solutions provided by the language / defacto build tool. That just seems like a good idea to me. I tried to convert the Distillery AWS guide to use mix releases, even asking for Distillery features as part of Mix releases, but stalled out after a few attempts of getting it to work. I had some deadlines and couldn’t afford to keep experimenting. I just decided to use Render and revisit the issue at a later date.
I’ve poked around at other deployment projects, such as the ones found on awesome-elixir, but most of them appear unmaintained or out of date.
The Ideal World
So what am I looking for? An up-to-date, active list of best practices / guides / tools for deployment and DevOps on Elixir. Something that allows me to explore the spectrum of DevOps rather than just the two sides of the coin that I see so often in forum posts. Basically, Pow for DevOps.
An Aside: Why Pow?
Disclaimer: I’m not affiliated with Pow, I’m just a big fan. Thank you, Dan!
I really like Pow for authentication. It comes with batteries included but allows me to swap out parts as application needs grow. It’s Easy to Change.
I understand that deployment is a completely different beast than authentication when it comes to the sheer number of options available, but it does a good job of indicating and encouraging best practices. My comparison to Pow was mainly to provide an example of a solution that was easy to get started with and is Easy to Change.
Since Elixir started supporting releases officially, I think they want to have better support for the whole deployment pipeline, right? Maybe there isn’t bandwidth on the team for official support, so we’d need to find a way to keep it up to date as a community.
Features I would want
The Distillery AWS guide I linked above covers almost everything, but I’d like something more specific to the native releases that have been supported for almost a year:
- Infrastructure as Code for various application parts: database, web server, etc.
- Creating a project build container + storage bucket for build artifacts (mainly so I don’t need to have build tools installed on the production machines)
- hooks into GitLab, GitHub, etc. for push-to-deploy
- how to handle secrets, e.g. API keys
- integration with industry-standard infrastructure provisioning/configuration tools, like Terraform and Ansible
I’ve been having a hard time moving my deployments from “do everything for me” towards “custom solution.” I’d like to expand my knowledge of deploying Elixir applications to the VPS provider of my choice. I’d like to learn about things like load balancing, auto-scaling groups, and more, but I’d rather do it gradually. I don’t necessarily have the time to learn all about DevOps while working on my applications.
I really do like Gigalixir and Render, and I think they’ll continue to have a place in elixir application development since they Just Work, but I’d like to gradually grow my DevOps skill set beyond those options while also developing my app.
I think a constantly up-to-date guide/toolset built off the native release features and maintained/funded the core Elixir org would be ideal, but this may be difficult or impossible.
This concludes my rant. If this solution already exists, please let me know. Maybe I’m just being ignorant. If it’s impossible to do, I’ll probably just stick with Render until I can hire someone to build the system I want for me. But I believe this community can build something like this if it doesn’t exist already, and that it would really help us solidify the application development story, from prototype to production.
If you’ve read this far, thanks for hearing me out!