Open tomeichlersmith opened 2 months ago
The basic lima denv ...
seems to run as expected. The only failing test is checking the group id. And I'm unsure at the moment if the groupid is only mismatched between container and VM since I'm running the entire testing suite inside the lima VM.
This issue is focused on discussion and notes related to supporting MacOS. Related issues that hold some history on this topic are
102
71
80
Containers are an inherently Linux technology. The only way containers are spawned on non-Linux operating systems like MacOS and Windoze is via a Linux VM. On Windoze, docker instructes installers to use WSL which is helpful for us because that encourages the user to directly interact with a Linux shell hosting the containers. This makes Windoze "support" rather natural - just use the tightly-integrated WSL VM and you are good to go.
The MacOS ecosystem is a bit more complicated. From what I can tell, there are two main "camps". For our purposes, the Lima route seems preferable since, like WSL, the "middle layer" of the Linux VM is exposed to the user. However, the Docker on Mac route is already embraced by many of the users I'm developing this program for and may exist for a long time. With this in mind, I'd like to at least understand how to support some subset of the
denv
abilities for this route.Docker on Mac
Docker on Mac (DoM) enables docker by launching VMs under-the-hood (I presume), but understanding this technology is a bit complicated since it is proprietary (as far as I can tell).
denv
's goal of mapping the host user into the container itself impossible since that information is already lost by the time execution gets todenv
. Nevertheless, we could support most of the other abilities ofdenv
since prior work with DoM in ldmx-sw makes it seem like the files written by processes within the container are still given ownership to the user outside of the container (and outside the VM).DISPLAY
variable likedocker.for.mac.host.internal
so that the docker CLI knows to connect the GUI display between the container and the VM and the VM and the host. #120Lima
Launch tightly-integrated Linux VMs via lima and then run whatever container runner you want (they have apptainer, podman, docker, and nerdctl templates already). With daemon-based runners like docker, you can even have the "client" CLI be outside the VM and redirected to the "host" daemon inside the VM so it appears native. There is even another package colima which acts like the daemon directly. I suspect that Docker on Mac does something similar.
lima denv ...
functionally equivalent to runningdenv
on a Linux host? If so, then we could move support via this route to a question of maintaining a Lima VM config (or a set of tips) to help makedenv
more useful.denv
control which mounts are made with the VM or would I need to document the config-changes necessary to add additional (non-home) mounts?~
(read only) and/tmp/lima
. They do make it pretty simple to opt-in to allowing writing to home directory which is probably what we want for our purposes.