Please consider to use the process based backend (default tracker) as it can spawn any process, i.e. also singularity
This is work in progress...ideas welcome!
Singularity tracker implements the JobTracker interface used by the Go DRMAA2 implementation in order to use Singularity containers as a backend for managing jobs as containers from the DRMAA2 interface on the same host.
Basically the Singularity tracker wraps the OS process tracker adding the required Singularity calls for creating the singularity process.
A JobTemplate requires at least:
- RemoteCommand -> which is path to the executable which is started in the container
- JobCategory -> which is the Singularity image (like vsoch-hello-world-master.simg)
If you want to see any output it makes sense to set OutputPath and ErrorPath to /dev/stdout in the JobTemplate.
JobTemplate extensions can be used to inject Singularity exec arguments like "--pid" (see command.go).
jt := drmaa2interface.JobTemplate{
RemoteCommand: "/bin/sleep",
Args: []string{"600"},
JobCategory: "shub://GodloveD/lolcow",
OutputPath: "/dev/stdout",
ErrorPath: "/dev/stderr",
}
// set Singularity specific arguments and options
jt.ExtensionList = map[string]string{
"debug": "true",
"pid": "true",
}
In the ExtensionList following arguments are evaluated as global singularity options:
- debug
- silent
- quite
- verbose
Boolean options are (which are injected after singularity exec):
- writable
- keep-privs
- net
- nv
- overlay
- pid
- ipc
- app
- contain
- containAll
- userns
- workdir
- pwd
- cleanenv
- disable-cache
- fakeroot
- no-home
- no-init
- no-nv
- no-privs
- nohttps
- nonet
- rocm
- writeable
- writable-tmpf
- vm
- vm-err
Note that boolean options which are set to "false" or "FALSE" are not evaluated.
Options with values are:
- bind
- add-caps
- drop-cap
- security
- hostname
- network
- network-args
- apply-cgroups
- scatch
- home
- vm-cpu
- vm-ip
- vm-ram
- allow-setuid
- app
- drop-caps
- app
- pem-path
If some are missing open an issue.
For an example please check out singularity.go in the examples directory.