trampgeek / jobe

jobe is a server that runs small programming jobs in a variety of programming languages
MIT License
108 stars 78 forks source link

Permissions/ownership of /home/jobe/runs/jobe_xxxxxx test directories #28

Closed tonyjbutler closed 5 years ago

tonyjbutler commented 5 years ago

I'm testing the https://hub.docker.com/r/trampgeek/jobeinabox docker container in Ubuntu 18.04, and the /jobe/index.php/restapi/languages test returns the expected JSON output. However, when I run testsubmit.py inside the container I get a lot of test failures due to permission errors, for example:

{'run_id': '/home/jobe/runs/jobe_1ZYE4V', 'outcome': 11, 'cmpinfo': '/usr/bin/ld: cannot open output file 
test.c.exe: Permission denied\ncollect2: error: ld returned 1 exit status\n', 'stdout': '', 'stderr': ''}
C program to check parallel submissions
Jobe result: Compile error

Compiler output:
/usr/bin/ld: cannot open output file test.c.exe: Permission denied
collect2: error: ld returned 1 exit status

So I enabled debugging and tried running the command in the jobe_1ZYE4V subdirectory that was created in /home/jobe/runs, with the same outcome. But I noticed that the permissions of all the jobe_xxxxxx subdirectories are, for example:

drwxr-xr-x  2 www-data www-data  4096 Oct 24 02:50 jobe_1ZYE4V

However, these commands all seem to be run by one of the 'jobexx' users (in the 'jobe' group), so it's understandable why the output files can't be written.

Are the jobe_xxxxxx subdirectories supposed to be created with different permissions? The parent directory, /home/jobe/runs has these permissions:

drwxrwx--x 51 jobe www-data 36864 Oct 24 02:50 runs

Thanks, Tony.

trampgeek commented 5 years ago

Hi Tony

Many thanks for the detailed bug report. A couple of other people reported issues of this sort but until now I didn't have enough detail to figure out what was going on - the image works fine for me in Ubuntu 18.04 on my development machine and on Digital Ocean Ubuntu VMs.

Jobe needs ACL support, but looks from your ls output that ACLs aren't working. A bit of googling suggests that this is a consequence of the file system your Linux host is using.

Firstly, would you mind running the command

    docker info

and pasting the output, please? The line starting Storage driver: is probably the critical one (on my systems it's ether overlay or overlay2) but the rest might turn out useful.

Secondly, please try running jobeinabox with the option --storage-driver=devicemapper, i.e.

    sudo docker run -d --storage-driver=devicemapper -p 4000:80 trampgeek/jobeinabox:latest

and see if that solves the problem.

Regards

Richard

tonyjbutler commented 5 years ago

Hi Richard,

Many thanks, you were spot on with that diagnosis.

It turns out I was still using an old docker-engine package from zesty, which was using the aufs storage driver. I've now replaced it with the latest docker-ce package and switched to overlay2, and all the tests in testsubmit.py have passed with flying colours.

Thanks again.

Kind regards, Tony