Unikernels + Elixir in 2020

Hello,

I wanted to post and ask if anyone has played with unikernels and elixir in 2020? I saw there was this post early last year and also saw that nanovm / ops has an elixir example.

Hi @rickp, wanted to tag you here as I saw you posted in the previous post about unikernels. Not sure if the above technology would be helpful to you.

I am also curious if anyone sees the need to use unikernels with elixir.

Thank for taking the time :call_me_hand:

3 Likes

Once upon a time there was LING (also known as Erlang on Xen), however this project seems pretty dead nowadays. There are other unikernels like Rump that have examples for Erlang. My problem with NanoVM is that it is closed source while there are other, open-source, projects that supports such approach.

In general from what I see the idea of unikernels pretty much died out (that is a shame) and waits for better times.

From the ā€œhigh levelā€ viewpoint the Nerves is the most unikernelish thing in the Erlang world right now.

And IMHO Erlang is perfect environment for unikernels runtime language, as it is mostly a operating system on itā€™s own, so removing one layer (ā€œrealā€ OS) wouldnā€™t harm 90% of Erlang applications while it would provide obvious benefits.

Hi,

Just saw this comment and wanted to correct it.

Nanos and OPS are most definitely completely open source under the apache 2 license.

https://nanos.org && https://ops.city are their community based websites.

https://github.com/nanovms/nanos && https://github.com/nanovms/ops are their open source repos.

Curious - why did you think it was closed source?

I couldnā€™t find information about it on NanoVMs page and I remember that when they started (and that was a little bit time ago) it wasnā€™t opensourced.

Ah I see what you were referring too, yeh itā€™s been open source for something like 1.5 yr now. We actually had to do some special tasks (including a few patches to erlang https://github.com/nanovms/erlang ) to get Elixir working https://github.com/nanovms/ops-examples/tree/master/elixir and Iā€™d imagine we have more work to do here as well to get a better/tighter integration.

2 Likes

Is it relatlively easy to set up new Erlang/Elixir versions with Nanos? I only see two Elixir versions available:

Iā€™m specifically curious about OTP 25 / Elixir 1.14 and OTP 26 / Elixir 1.15.

The existing docs suggest you can only run single .exs scripts, but is it possible to run an entire application consisting of multiple files/artifacts in a Nanos unikernel, or perhaps a mix release? mix release ā€” Mix v1.15.2

Note: Iā€™m not an active elixir dev so there most definitely are probably better methods to do this butā€¦

In this example you can see we actually use ā€˜mix releaseā€™: https://github.com/nanovms/ops-examples/tree/master/elixir/02-phoenix . Elixir makes use of quite a few wrapping scripts to setup paths/env vars and thatā€™s the most challenging aspect imo of running it under nanos as you need to declare all of that up front. I think there is definitely room here for extra/better tooling.

Other than that I wouldnā€™t say there are huge issues but yeh I think it would be good to try and get some newer releases cut. Let me know if you want to take a quick stab at it or if you run into any issues happy to take a look.

1 Like