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
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly.
One of i...
New
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Other Trending Topics
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
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
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
Is there a word for the ~> symbol used in Version strings?
Do you also just call it a Squiggle Arrow™ ?!
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 10 of 11 Posts
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.