ausimian
Castle is a package I put together to assist with building Elixir releases capable of being live-upgraded via the ‘official’ release handling mechanisms.
It augments existing Elixir release support, providing:
- build-time support for
appupandreluphandling and release generation. - runtime support for
sys.configgeneration (incl. support forruntime.exs)
It additionally provides script support for release mgmt, adding commands to unpack, install, commit and remove releases in running systems.
This is an early release, there’s definitely a few rough edges notably:
- No support for config providers
- Untested on umbrella apps
- No Windows support
I will definitely get to the first two in the short term.
Edit - Just to add, it will not generate your appup scripts for you and is unlikely to. If you need hot-code upgrades for your app, it is assumed you understand the implications and will write your own appups.
Trending in Announcing
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
jackalcooper
that’s so cool! I am looking for a library for this
hst337
Great library, I’ve thought about writing something like this after finishing my current projects
ausimian
Castle 0.2.2 has been released:
runtime.exs, Castle takes over the invocation of these providers in a separate instance prior to boot, or in the running instance before hot-code upgrades/downgrades.jchrist
Very happy to see this effort!
Out of curiosity: would it be possible for libraries to include appup files in their packaging, which can then be used in the generated relups? I’ve seen apps in OTP itself that have them and I was wondering how that worked.
ausimian
I would like to see more maintainers provider appup files with their libraries, but i recognise this is out of scope for many of them. I think the appup generation tooling itself needs to improve as well.
From a technical perspective, it is the responsibility of the build tool to move appup files into the
ebinfolder of the compiled application.Castledoes this currently via its appup compiler.jchrist
Fully agree with you here. For most libraries like you said it is probably out of scope, but at least having stub appups that just restart the application on upgrade would be a start.
I’ve just tested this, and like you said it is very straightforward to add an appup to libraries: including Castle in the library’s dependencies with the appup compiler and writing the appup is sufficient to get the appup in the ebin of the end application
Is my understanding correct that in this case, the library can specify
runtime: falsefor Castle, as it only uses it at compile time?ausimian
Castle is also used at runtime, specifically, when you upgrade/downgrade a release e.g.
The shell script sends an RPC into Castle (e.g.
Castle.install/1) to prepare thesys.configfor that version, prior to asking the release handler to perform the upgrade.I’m considering whether to split out the build time and runtime parts into separate apps.
jchrist
I should have phrased my question a bit better: I meant having
runtime: falsein the dependency that ships an appup whilst still having it included in the runtime in the final application - in that case my understanding is that the release command will still include Castle into the main release for the app?In such case if somebody installs the library that doesn’t use hot code upgrades, the app won’t be loaded - so it’s easier to justify adding it as a library dependency.
ausimian
I see you mean. Yes, a library could take Castle only as a build time dependency.
ausimian
Castle 0.3.0 has been released:
runtime: false.binfolder, which was a kludge. This version replaces the shell script entirely, with the new release handling commands now integrated directly.