nextflow
nextflow copied to clipboard
Fix #3217 fixOwnership not working
Fixes the issue #3217
Not sure if --from root
is there to preserve multiple UIDs from different process.
Signed-off-by: Kibubu [email protected]
Indeed, the flag --from root
is used to only apply ownership change to root owner files.
So, should there be another solution that changes only those file created by the task an not those copied in for example?
In your example, you are creating a user in the task execution and using to change the file ownership. Don't think it should be supported such use case
You are correct, this example is rather fabricated, but since I guess he and myself stumbled upon it there might be more people involved. Most will probably just sudo rm
those files.
My example could also be buried in script within the container and totally hidden from the user.
But as always if the consequences of removing the --from root
clause are greater the benefits this PR and issue can be closed.
Ultimately this is an old trick, that would be better to not use and we may even deprecate.
To prevent this problem the user of runOptions
can provide a better solution
https://github.com/CRG-CNAG/CalliNGS-NF/blob/master/nextflow.config#L14
Well I guess I'll close the PR but would leave the Issue open for further discussions.
Providing runOptions won't solve the demonstrated problem. The script should show the same behavior regardless of being executed inside a container or not. That also means modifying the script to suit the container could be considered an anti-pattern.
One option would be to add a note to the docs that only containers should not change UIDs during their execution. Or it is the responsibility of the container to chown all created files to the initial UID.