-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docker.runOptions to avoid memory swap error #351
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that is required - the '...'
should be enough if it's in nextflow.config
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I didn't understood what you meant ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -58,6 +58,11 @@ profiles { | |||
test { includeConfig 'conf/test.config' } | |||
} | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
docs
is updatedCHANGELOG.md
is updatedREADME.md
is updatedLearn more about contributing: https://github.com/nf-core/tools/tree/master/.github/CONTRIBUTING.md