Add docker.runOptions to avoid memory swap error#351
Add docker.runOptions to avoid memory swap error#351apeltzer merged 1 commit intodockerrunOptionsfrom
Conversation
|
I feel like we've talked about adding this to the main template before, but were nervous that it would cause problems for some users (which is why it's not already a default in nextflow). Maybe @pditommaso can remember? Generally I tend to think that stuff like this should be addressed upstream in nextflow rather than being patched in pipelines downstream though, if possible.. |
|
Basically enforcing the user and group id changes some env variables such as Yes, the plan is to include as default. If you could stress test it a bit with nf-core pipelines and confirm there's no impact, I would be happy to make it the default option. |
|
Ok great, thanks! Then yes maybe we can merge this PR so it (eventually) goes out to all pipelines. Would be good to add a comment that this will hopefully be a default in the future and can be removed at a later date... |
| // Avoid this error: | ||
| // WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. | ||
| // Thanks to: https://github.com/alesssia/YAMP/wiki/How-to-use-Docker | ||
| docker.runOptions = '-u $(id -u):$(id -g)' |
There was a problem hiding this comment.
Shouldn't it be -u \$(id -u):\$(id -g)?
cf: https://github.com/nf-core/sarek/blob/10eff4e8ff71e672d73a3bf4aa43a3693342bfb2/nextflow.config#L63
There was a problem hiding this comment.
Not sure that is required - the '...' should be enough if it's in nextflow.config right?
There was a problem hiding this comment.
sorry, I didn't understood what you meant ;-)
There was a problem hiding this comment.
I mean I'm not sure whether we need to escape the $ with a \$ here as they are inside a '...' single quotes block :)
There was a problem hiding this comment.
Aaaah, now I understand.
I'm pretty sure I copied that from someone else (probably Paolo) at some point.
I'm guessing the double quotes render the escaping the $ a necessity
There was a problem hiding this comment.
Then we need to address this as well - I was looking for another place where this is used but couldn't find it. Wouldn't fixOwnership as listed here do the same? https://www.nextflow.io/docs/latest/config.html#config-docker
|
|
||
| // Avoid this error: | ||
| // WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. | ||
| // Thanks to: https://github.com/alesssia/YAMP/wiki/How-to-use-Docker |
There was a problem hiding this comment.
| // Thanks to: https://github.com/alesssia/YAMP/wiki/How-to-use-Docker | |
| // Thanks to: https://github.com/alesssia/YAMP/wiki/How-to-use-Docker | |
| // Testing this in nf-core after discussion here https://github.com/nf-core/tools/pull/351, once this is established and works well, nextflow might implement this behavior as new default. |
There was a problem hiding this comment.
Could you add this in @olgabot? That should be enough to be able to trace things back once they're in the template.
|
Merging this to dockerrunOptions to make the final changes required 👍 |
|
@apeltzer @pditommaso @ewels : Using the default Docker run parameters works like a charm in this context. |
When running dsl2 branch --profile test,docker the following error occurs: "WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap." This is fixed by adding "docker." prior to "runOptions", as per the discussion here: nf-core/tools#351
Hello! I had been running into some docker errors and tracked down some magic settings that made them go away. This PR adds those settings to the default nf-core created sample.
PR checklist
docsis updatedCHANGELOG.mdis updatedREADME.mdis updatedLearn more about contributing: https://github.com/nf-core/tools/tree/master/.github/CONTRIBUTING.md