ausimian

ausimian

Castle - Hot-Code Upgrade Support for Elixir

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 appup and relup handling and release generation.
  • runtime support for sys.config generation (incl. support for runtime.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.

Most Liked

ausimian

ausimian

Castle 0.2.2 has been released:

  • Support for config providers is added. Like 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.
  • The generation correctly honours the config_env/0 property during config generation.
ausimian

ausimian

Castle 0.3.0 has been released:

  • This version separates out all the build-time support (release assembly, appup/relup handling etc) into a separate dependency, Forecastle. Applications should continue to use Castle as their dependency.
    • Mix Projects that don’t define a release, but do wish to generate an appup into their ebin folder, can bring in Castle as runtime: false.
    • Projects that do define a release, should bring in Castle as a runtime dependency. Due to its separation from build-time concerns, the dependency now consists of a single small module.
  • Prior versions of Castle wrapped the existing shell script in the release’s bin folder, which was a kludge. This version replaces the shell script entirely, with the new release handling commands now integrated directly.
jackalcooper

jackalcooper

that’s so cool! I am looking for a library for this

ausimian

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 ebin folder of the compiled application. Castle does this currently via its appup compiler.

hst337

hst337

Great library, I’ve thought about writing something like this after finishing my current projects

Where Next?

Popular in Libraries Top

Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. Features Unstyled Phoenix components. Storybook that can be added to...
New
mbuhot
Leverage Open Api 3.0 (Swagger) to document, test, validate and explore your Plug and Phoenix APIs. Generate and serve a JSON Open API ...
New
arkgil
Hi all! I’m happy to announce that Telemetry v0.3.0 is out! This release marks the conversion from Elixir to Erlang so that all the libr...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
wmnnd
Hi there, for my project DBLSQD, I needed a file storage solution that is a bit more flexible than Arc. Because I thought others might f...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
wojtekmach
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
New

Other popular topics Top

jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Sub Categories:

We're in Beta

About us Mission Statement