Closed kverstae closed 2 years ago
Nice work!
Would you mind posting your component(s) so we can see how 1) this could be included in Viash as a platform and 2) how NextFlow could be configured to use the podman version?
The viash poc seems to support switching between docker, podman and singularity, by toggling the one of the following in nextflow.config
on or off.
// docker.enabled = true
// singularity.enabled = true
// podman.enabled = true
// podman.mountFlags = 'z'
// or nothing to run natively
I think it's best to follow the nf-core practices of listing all possible profiles in your nextflow.config:
// detect tempdir
tempDir = java.nio.file.Paths.get(
System.getenv('NXF_TEMP') ?:
System.getenv('VIASH_TEMP') ?:
System.getenv('TEMPDIR') ?:
System.getenv('TMPDIR') ?:
'/tmp'
).toAbsolutePath()
profiles {
docker {
docker.enabled = true
docker.userEmulation = true
docker.temp = tempDir
singularity.enabled = false
podman.enabled = false
shifter.enabled = false
charliecloud.enabled = false
}
singularity {
singularity.enabled = true
singularity.autoMounts = true
docker.enabled = false
podman.enabled = false
shifter.enabled = false
charliecloud.enabled = false
}
podman {
podman.enabled = true
podman.temp = tempDir
docker.enabled = false
singularity.enabled = false
shifter.enabled = false
charliecloud.enabled = false
}
shifter {
shifter.enabled = true
docker.enabled = false
singularity.enabled = false
podman.enabled = false
charliecloud.enabled = false
}
charliecloud {
charliecloud.enabled = true
charliecloud.temp = tempDir
docker.enabled = false
singularity.enabled = false
podman.enabled = false
shifter.enabled = false
}
}
And then specifying -profile podman
when starting a run.
Together with our work on VDSL3 modules, this should solve your issue. Let me know if this is not the case :)
I did some testing to see if I could make the generated bash scripts for docker work with podman. It should be as simple as replacing all calls to
docker
withpodman
, but this was not the case. Most issues are related to mounting of host volumes into the container.Things I changed to make things work:
docker
withpodman
VIASH_EXTRA_MOUNTS
. Podman doesn't seem to like mounting the same volume multiple times.VIASH_TEMP
. Since podman runs rootless (in most cases), mounting a directory with ownership ofroot:root
(such as/tmp
) will result in permission issues. Using a subfolder of/tmp
owned by the user exectuting the container + adding:Z
to the mount argument (e.g-v "/tmp/viash_tmp:/viash_automount/tmp/viash_tmp:Z"
) made everything behave as expected. I don't know if this is a proper solution, but it works :man_shrugging:I didn't test all functionality of the script, so there might be some other things that need some tweaking...
It would also be nice if the nextflow code could also work with podman (using config profiles?). I did not do any tests yet to see what changes are needed in the nextflow code to make everything work, but I think it should be as easy as replacing all references to 'docker' with 'podman'