statisticalbiotechnology / quandenser-pipeline

A nextflow/singularity pipeline for quandenser
Apache License 2.0
5 stars 1 forks source link

Hardcoded /tmp #25

Closed andrewjmc closed 4 years ago

andrewjmc commented 4 years ago

Hello,

I had trouble installing Quandenser from the script, as many attempts were made to create files in /tmp. However, the temporary directory on my CentOS cluster is different. Is there a way to change this?

Thanks,

Andrew

andrewjmc commented 4 years ago

Just to note, I have tried setting SINGULARITY_TMPDIR in my environment, also adding the -W flag to the two singularity run commands and one singularity exec command in the script, without effect:

++ singularity run SingulQuand.SIF -W /rds/general/ephemeral/user/a3/ephemeral/ /
++ grep -oP ' \K(v[0-9]+[.][0-9]+)'
mkdir: cannot create directory '/tmp/wineprefix64_a3': Permission denied
mkdir: cannot create directory '/tmp/wineprefix64_a3': Permission denied
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_YWVmY2UxZTMwZmFmYzc3MTg2ZGU3YTEz/dosdevices': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_YWVmY2UxZTMwZmFmYzc3MTg2ZGU3YTEz/drive_c': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_YWVmY2UxZTMwZmFmYzc3MTg2ZGU3YTEz/system.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_YWVmY2UxZTMwZmFmYzc3MTg2ZGU3YTEz/user.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_YWVmY2UxZTMwZmFmYzc3MTg2ZGU3YTEz/userdef.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_YWVmY2UxZTMwZmFmYzc3MTg2ZGU3YTEz/winetricks.log': No such file or directory
mkdir: cannot create directory '/tmp/runtime-a3': Permission denied
+ singularity exec -W /rds/general/ephemeral/user/a3/ephemeral/ --app quandenser_ui SingulQuand.SIF python -c 'from utils import check_corrupt; check_corrupt('\''/rds/general/user/a3/home/.quandenser_pipeline'\'')'
mkdir: cannot create directory '/tmp/wineprefix64_a3': Permission denied
mkdir: cannot create directory '/tmp/wineprefix64_a3': Permission denied
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_NzFiZDY5ZTE5ZWRkMGEyNWMxNWQ1OWQ2/dosdevices': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_NzFiZDY5ZTE5ZWRkMGEyNWMxNWQ1OWQ2/drive_c': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_NzFiZDY5ZTE5ZWRkMGEyNWMxNWQ1OWQ2/system.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_NzFiZDY5ZTE5ZWRkMGEyNWMxNWQ1OWQ2/user.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_NzFiZDY5ZTE5ZWRkMGEyNWMxNWQ1OWQ2/userdef.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_NzFiZDY5ZTE5ZWRkMGEyNWMxNWQ1OWQ2/winetricks.log': No such file or directory
mkdir: cannot create directory '/tmp/runtime-a3': Permission denied
mkdir: cannot create directory '/tmp/runtime-a3': Permission denied
+ singularity run --app quandenser_ui -W /rds/general/ephemeral/user/a3/ephemeral/ --bind /rdsgpfs/general/user/a3/home:/rdsgpfs/general/user/a3/home --nv SingulQuand.SIF
mkdir: cannot create directory '/tmp/wineprefix64_a3': Permission denied
mkdir: cannot create directory '/tmp/wineprefix64_a3': Permission denied
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_OTI2YWQxZDAzMTE1NGJmMzA5NGZiZTFh/dosdevices': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_OTI2YWQxZDAzMTE1NGJmMzA5NGZiZTFh/drive_c': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_OTI2YWQxZDAzMTE1NGJmMzA5NGZiZTFh/system.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_OTI2YWQxZDAzMTE1NGJmMzA5NGZiZTFh/user.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_OTI2YWQxZDAzMTE1NGJmMzA5NGZiZTFh/userdef.reg': No such file or directory
ln: failed to create symbolic link '/tmp/wineprefix64_a3/wineprefix64_OTI2YWQxZDAzMTE1NGJmMzA5NGZiZTFh/winetricks.log': No such file or directory
mkdir: cannot create directory '/tmp/runtime-a3': Permission denied
mkdir: cannot create directory '/tmp/runtime-a3': Permission denied

I also tried adding the -c command to singularity, with no apparent change.

I should emphasise that I have next to no experience or knowledge or docker or singularity, other than basic principles. Perhaps I am doing something very wrong.

TimothyOlsson commented 4 years ago

Mentioned in this thread https://github.com/statisticalbiotechnology/quandenser/issues/9

Fixed in latest release (v0.083), by exporting environmental variable "WINE_TMPDIR"

andrewjmc commented 4 years ago

OK, so some progress at my end! Singularity was broken on the HPC login nodes, but the team seems to have fixed now.

I have X11 server running, but I cannot get the GUI working

: https://github.com/statisticalbiotechnology/quandenser-pipeline#running-the-pipeline-without-the-gui

qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/rds/general/ephemeral/user/ajm3018/ephemeral//runtime-ajm3018', please create it with 0700 permissions.
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)
Could not initialize GLX
Aborted

This occurred with Qt 4.8.6 and 5.11.1, with and without --disable-opengl and --disable-nvidia

Interestingly, XDG_RUNTIME_DIR is not the same as on my shell, where it is /run/user/1386184

The WINE issue is still occuring despite setting $WINE_TMPDIR, and I am ignoring it. For reasons I don't understand, the mkdir -p commands are giving the error mkdir: cannot create directory '/rds/general/ephemeral': Read-only file system when WINE_TMPDIR is /rds/general/ephemeral/user/a3/ephemeral/ UPDATED: now realised this is because of my failure to give the correct directories as arguments to the script.

I have had initial success starting the headless version on a single node, but not tried the PBS mode yet. I will update with outcome.

In the meantime, if you think of an obvious problem preventing X11 working, please let me know!

Best wishes,

Andrew

TimothyOlsson commented 4 years ago

Hi Andrew,

I found one thread which might help us fix the issue, by using the command -Y when starting an ssh connection. The Qt version inside the singularity container should be the only one being used when starting the GUI, which I believe is Qt 5.11 at the moment.

First of all, connect to the server with -Y (aka trusted X11 server). Then try to run the command "xclock" or "glxgears", both of which should open up a small window. If any of them work, you can start the shell script as before with:

./Quandenser_pipeline.sh /rds

If that does not work, try agin with "--disable-nvidia". You do not need to run --disable-opengl again, if you have already run it once. If none of this works, while xclock and glxgears work, it might be something more complicated causing the issue.

andrewjmc commented 4 years ago

I switched from using Putty to using the WSL Ubuntu with ssh -Y. I confirmed that X11 forwarding works for other applications.

Interestingly, I'm no longer getting the complaint about XDG_RUNTIME_DIR (perhaps because OpenGL disabled?) but still get the:

qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources

I am investigating whether it is to do with capabilities of Xming, and might try an alternative window manager.

Based on the ssh config file, I suspect that -X and -Y are functionally equivalent on our setup (https://askubuntu.com/questions/35512/what-is-the-difference-between-ssh-y-trusted-x11-forwarding-and-ssh-x-u)

In the meantime, it looks like the command line version might be doing the job so I will set that off!

Thanks again,

Andrew

andrewjmc commented 4 years ago

So with VcXdrv that error has gone.

However, I am receiving other errors due to a hardcoded config path in main.py

WARNING: Missing config directory /home/a3/.quandenser_pipeline. Initalizing directory
Traceback (most recent call last):
  File "/var/local/quandenser_ui/main.py", line 262, in <module>
    ex = Main() # Stack smashing happens BEFORE we reach here
  File "/var/local/quandenser_ui/main.py", line 48, in __init__
    check_corrupt(config_path)
  File "/var/local/quandenser_ui/utils.py", line 31, in check_corrupt
    os.makedirs(config_path)
  File "/usr/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/usr/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/home/a3'

The Quandenser_pipeline.sh call to check the config works since it uses the script-defined path:

singularity exec --app quandenser_ui $mount_point SingulQuand.SIF python -c "from utils import check_corrupt; check_corrupt('${config_location}')"

However, where the check_corrupt function is called from main,py, it fails as it uses a hard-coded config_path:

Relevant line of main.py:
config_path = f"/home/{user}/.quandenser_pipeline"

Does this need replacing with the user-specified one?

Thanks,

Andrew

andrewjmc commented 4 years ago

I edited Quandenser_pipeline.sh to manually add an extra binding from config_location to the hard-coded path in main,py. It now works with VcXsrv and --disable-nvidia, so thanks!

However, I am connecting from home today and the UI is too slow to be usable. I will test properly when I am back in the lab, and otherwise persevere with the command line version.

Thanks again for your help,

Andrew