robur-coop / albatross

Albatross: orchestrate and manage MirageOS unikernels with Solo5
ISC License
141 stars 17 forks source link

albatross.deb for ubuntu 22.04 #122

Closed nickbetteridge closed 1 year ago

nickbetteridge commented 1 year ago

I've been playing around with the debian packaging that @reynir has provided.

Firstly, just let me say that I'm no linux expert!

  1. I cloned albatross, did a dune build
  2. I edited 'albatross/packaging/debian/control' and updated %%VERSION%% to the current version - not too sure how to automate this
  3. sh -ex packaging/debian/create_package.sh
  4. sudo dpkg -i ./albatross.deb
  5. sudo apt install -f
  6. sudo systemctl enable albatross_daemon.service , etc

Deploying unikernels didn't work and I discovered that, for example, trying to deploy a hvt locally resulted in albatross-client-local trying to execute solo5-hvt in /var/lib/albatross, whereas the albatross binaries had been installed in /usr/bin.

I guess the packaging scripts are really meant for user customisation. Nevertheless, using albatross is a dream - thanks for making it available.

The following ubuntu netplan is for setting up a static host ip address with a service bridge for albatross - just in case it's useful for anyone

network:
  version: 2
  renderer: networkd

  ethernets:
    enpXXX:
      dhcp4: false
      dhcp6: false

  bridges:
    service:
      interfaces: [enpXXX]
      addresses: [10.0.0.XXX/24]
      # gateway4 is deprecated, use routes instead
      routes:
      - to: default
        via: 10.0.0.1
        metric: 100
        on-link: true
      mtu: 1500
      nameservers:
        addresses: [1.1.1.1,1.0.0.1]
      parameters:
        stp: true
        forward-delay: 4
      dhcp4: no
      dhcp6: no

where enpXXX is the exposed interface and 10.0.0.XXX/24 is the static IP for the host

reynir commented 1 year ago

Hi @nickbetteridge,

Thank you for your report and for using the packaging script.

Regarding 2. you can use dune subst. It modifies the source tree to replace %%VERSION%% etc. You should do a dune build after this. I believe steps 4 & 5 can be done with sudo apt install ./albatross.deb. Regarding your observation with solo5-hvt albatross looks for the solo5 tender first in $PATH and if not found there it looks in /var/lib/albatross/ on Linux (the so called "dbdir" in the man pages). This suggests you did not have solo5-hvt installed anywhere in $PATH. We also provide packaging scripts for solo5 in a fork (unfortunately lacking a bit behind upstream at the moment...). Otherwise, you can build and copy the solo5-hvt and solo5-spt binaries and copy them to /var/lib/albatross/.

The packaging scripts were mainly written in order to provide binary packages at https://builds.robur.coop/, but they should be usable outside that context. I will look into providing binary packages for ubuntu 22.04 at builds.robur.coop soon.

Thank you for the netplan example. We find that many people (including me) struggle with network setup, so another example is welcome.

nickbetteridge commented 1 year ago

Greetings @reynir - thanks for getting back to me

  1. dune subst - ah, at last - something that probably everyone knows except for me! Thanks
  2. solo5 tender in $PATH - good point - it's in my path but forgot to add it to the deb path
  3. I had a problem with sudo apt install ./albatross.deb (can't remember what), but used sudo dpkg -i ./albatross.deb and it worked fine

Thanks again for pointing out all of these things to me - very grateful