genericworkflownodes / GenericKnimeNodes

Base package for GenericKnimeNodes
https://github.com/genericworkflownodes/GenericKnimeNodes
Other
15 stars 16 forks source link

DockerCommandGenerator might be broken on Linux #223

Open chahuistle opened 5 years ago

chahuistle commented 5 years ago

I'm running Fedora Workstation 28 and when running ImmunoNodes I get the following message:

Traceback (most recent call last):
  File "/ImmunoNodes/src/allelefrequency.py", line 131, in <module>
    sys.exit(main())
  File "/ImmunoNodes/src/allelefrequency.py", line 108, in main
    with open(args.output, "w") as f:
IOError: [Errno 13] Permission denied: '/var/shared/2/null.tsv'

Running the command on a terminal produces the same error.

The issue seems to be related to Security-Enhanced Linux (SELinux) not being able to distinguish the security policies of the container's security policies, so it errs on the side of error (see: https://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/).

This means that, for the affected platforms (at least Fedora Workstation!), when declaring volumes, an something like this should be done in DockerCommandGenerator (tested the hotfix and works for me):

dockerCommands.add(new CommandLineFixedString(
                    hostPath + ":" + dockerMount + ":Z"));

I.e., the :Z applies, at least, for Fedora Workstation.

jpfeuffer commented 5 years ago

Do we need an if-case for non-SELinuxes or is it compatible? PR will be happily accepted.