ah yes, effect handlers in unikernels
  • OCaml 74.8%
  • C 24.8%
  • Dune 0.4%
Find a file
Lucas Pluvinage c108cac90c
recursive
2023-05-19 13:17:52 +02:00
.github/workflows ci 2023-05-17 09:40:52 +02:00
dream@2d8372f176 make it build 2023-05-16 14:07:08 +02:00
eio-solo5 dream http1 app solo5 eio 2023-05-04 18:53:20 +02:00
networking-experiments@ad4180fbf5 ok 2023-05-04 19:00:12 +02:00
.gitignore test eio / solo5 2023-05-02 16:08:46 +02:00
.gitmodules ok 2023-05-04 19:00:12 +02:00
.ocamlformat test eio / solo5 2023-05-02 16:08:46 +02:00
dune dream http1 app solo5 eio 2023-05-04 18:53:20 +02:00
dune-project test eio / solo5 2023-05-02 16:08:46 +02:00
dune-workspace test eio / solo5 2023-05-02 16:08:46 +02:00
eio-solo5-net.opam Update eio-solo5-net.opam 2023-05-18 11:55:48 +02:00
eio-solo5-net.opam.locked make it build 2023-05-16 14:07:08 +02:00
main.ml make it build 2023-05-16 14:07:08 +02:00
manifest.json test eio / solo5 2023-05-02 16:08:46 +02:00
README.md recursive 2023-05-19 13:17:52 +02:00
startup.c test eio / solo5 2023-05-02 16:08:46 +02:00

What is this ?

An http1 webserver using dream over mirage libraries and eio. Highly experimental ! The stack:

  • dream
  • httpaf
  • tls
  • mirage-crypto
  • mirage-tcpip
  • arp, ethernet
  • eio-solo5

eio-solo5 ?

A hacky backend for Eio using solo5 APIs. Here is the environment signature:

type stdenv = <
  clock : Eio.Time.clock;
  mono : Eio.Time.Mono.t;
  netif : string ->
    <
    send: Cstruct.t -> unit;
    recv: Cstruct.t -> int;
    mac: Macaddr.t;
    mtu: int>;
>

quite minimal

setup ?

a bit painful because of opam-monorepo quirks, but it works in CI so don't worry.

opam pin https://github.com/mirage/ocaml-solo5.git#500-cleaned -ny
opam install solo5.0.8.0 ocaml-solo5 opam-monorepo dune
git clone --recursive https://github.com/TheLortex/eio-solo5
cd eio-solo5
rm -rf networking-experiments/vendor/httpaf/
rm -rf networking-experiments/vendor/luv/test/
sed '/pin-depends:/,/^]/d' -i  dream/src/vendor/httpaf/*.opam
sed '/pin-depends:/,/^]/d' -i  dream/src/vendor/websocketaf/*.opam
opam monorepo lock
opam monorepo pull
dune build _build/solo5/main.exe

The obtained image (x86) is available as an artifact of the CI build. (https://github.com/TheLortex/eio-solo5/actions/runs/5012744312)

To use it, set up a tap device (example: https://gist.github.com/TheLortex/62f01ece1ebf1d9c9465e50084279b68) and call the solo5 tender:

solo5-hvt --net:service=tap0 ~/Downloads/main.exe

Then, one can ping and curl the service:

ping 10.0.0.2
curl http://10.0.0.2