viash-io / viash

script + metadata = standalone component
https://viash.io
GNU General Public License v3.0
39 stars 2 forks source link

Support for podman #83

Closed kverstae closed 2 years ago

kverstae commented 3 years ago

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 with podman, 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:

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'

tverbeiren commented 3 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?

rcannood commented 3 years ago

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
rcannood commented 2 years ago

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 :)