Compose
OPS has 'docker-compose' style functionality where you can orchestrate locally many unikernels. This allows you to bring up a set of services together and utilize service discovery.
You can either download the official installer from https://ops.city/downloads with the functionality turned on or you can enable it manually. We highly recommend using the installer if you can.
If you run into any issue please let us know via the ops github.
Special Instructions for Source
If you aren't using the official installer you'll need to do the following:
First find out which qemu you are using:
Then using that path (if for instance it is in /usr/local/bin):
This is done in order to utilize bridge networking. There are other ways of accomplishing this as well.
Next you'll need to enable the OPSD build flag:
This is to ensure a seamless experience for those using or not using this feature.
Basics
Now you create a compose.yaml file. For example we have 2 packages in our local ~/.ops/local_packages/amd64:
If you've used 'ops run' in the past you can create a new pkg using the same workflow like so:
The 'pkg' itself is what will be used for dns resolution while the name is pointing towards the package on your local system.
Here is an example where we have used two different packages from the repo (notice the user namespace) and one package from our local which is enabled via the 'local' flag.
As with other ops command by default the arch will default to whatever your underlying platform is but you can set it to what the package is by setting it different:
Finally you need to have the ops-dns package installed which is a small dns server that provides service discovery:
Now you can boot your unikernels via:
You can turn them off via:
OPS has had normal bridge support for linux for a while now but allows the end-user to define that.
On MacOS vmnet-bridged is used. On Linux a new bridge is created automatically and all instances are given taps to listen on that bridge. Upon 'compose down' the bridge group is taken down.
Examples
While you can certainly find compose examples on https://repo.ops.city we have compose examples here.
Last updated