What?
I want a reproducible dev environment.
I want to be able to type make run and have everything taken care of for me.
I want to run make clean && make build and have everything new and fresh.
Itās just how I am.
The point of this thread is for me to explore how to make that happen by trying to use docker to do it.
So why a container?
The Norns software assumes itās running on a Rasbian based system with extras. The software is coupled to both itās hardware, but also the base Linux system itās running on.
I want to:
- Get Norns running with as few changes as possible in an environment as close to the shipped product as possible
- Insulate the host OS from any accidental damage (e.g. through use of
sudo from a Lua script)
Why docker?
Itās common, and the Dockerfiles are easily understood even by users unfamiliar with docker. Itās as easy to use as one can expect given what it does. Also (and this is the main reason) itās the only container software I know how to useā¦
And maybe via docker-machine Windows and OSX users might be able to join in (albeit within a VM).
(edit: or rather Docker for Mac / Docker for Windows, thanks @jlmitch5)
Why not a VM?
jack gets sad without realtime, if we can avoid the overhead of the VM, that will be one way to make jack happier.
Also, IMO the docker tooling and file format is better than vagrant.
Finally, using docker opens up using it for CI with Travis CI
Where docker may be more of a pain is when using it for iterative development, as itās not really what itās designed for. Iāve got a few ideas for how to reduce the issues, possibly involving splitting up each service up into itās own container.
FYI there is no systemd inside a docker container.
What this thread is and isnāt!
Itās Linux first and foremost. Sorry others!
Itās not about alt-devices, mainly itās about getting a reproducible dev environment running.
Itās probably not going to be a short thread, really itās going to be a (my) work log. I will try and keep the first post up to date though.
I work very slow. Anyone that goes faster than me might be asked to slow down, or worse⦠Iāll ask you to take over!
I am aiming for an end product. Hopefully a GitHub repo with a nice detailed README.md that others can use to get set up. But there is a very real possibility that it doesnāt work (or even falls at the first hurdle).
Also, NetJack2 uses master/slave terminology, sorry about that!
Where am I at?
I have managed to run SuperCollider inside a container, and have forwarded the audio via NetJack2 from the container to the host. Iām going to try to get the code up in a gist in the next few days (I would like to get rid of the hardcoded IP addresses first).
Whatās next
Post my proof of concept for running SuperCollider in a container.
Try and get the norns software installed and running inside the container.
Sticking points
How to deal with the screen and buttons? I have ideas, but this is the one area where changes will be needed in the software.
Deal with connecting peripherals!
Data dump
Useful jack commands
Iām using jack2-dbus on my host computer ā Arch Linux FYI.
Iām also using catia to manage connections, once Iāve got some name stability with the containers Iāll try to automate connections with jack_connect.
jack_control stop # stop jack
jack_control start # start jack
jack_load netmanager # load the NetJack2 plugin
# or combined (jack can get itself in a funk and sometimes needs a kick)
jack_control stop && jack_control start && jack_load netmanager
jack_lsp # list ports (i.e. inputs, outputs and apps)
jack_lsp -c # list ports and connections
Useful links
-
This GitHub repo has SuperCollider running inside a docker container, albeit with the sound card passed directly.