tomeichlersmith / denv

uniformly interact with containerized environments across runners
https://tomeichlersmith.github.io/denv/
GNU General Public License v3.0
8 stars 2 forks source link

update `denv check` with emulation testing and workspace search #96

Closed tomeichlersmith closed 5 months ago

tomeichlersmith commented 5 months ago

This PR adds some new features to denv check

  1. Look for emulation by inspecting the output of the version command to see if a emulator is listed rather than the command itself. This occurs when singularity is being "emulated" by apptainer (via a simple symlink) and when docker is being emulated by podman (via a more full program which does CLI translation I assume).
  2. Add an optional check for a workspace. This is opt-in so that denv check can still be used before denv init in order to check its own installation. denv check --workspace does all the installation checks as well as looking for an available workspace to run from. This can be helpful for users to debug and make sure that denv is picking up the workspace they want it to.
  3. Label which runner is specified by DENV_RUNNER if it is defined.
  4. Error out if DENV_RUNNER is defined to a runner that is not supported by denv or is not available on the machine.

:boom: Breaking Change

After testing the emulation inspection on my NixOS machine, I found that (for denv's purposes) using podman's emulation of docker breaks the ownership model we require. With this in mind, I changed the order of runner deduction so that emulators are always checked before the emulated (i.e. podman before docker and apptainer before singularity). This is a breaking change for systems that have both podman and docker installed because now podman will be used by default rather than docker.[^1]

[^1]: By "both installed", I mean docker is not just being emulated by podman. You can check this by running docker version and seeing if it calls itself podman or not.