testdockerwcsim / XTriggerApplication

Other
2 stars 3 forks source link

Run docker image with singularity #20

Open ast0815 opened 4 years ago

ast0815 commented 4 years ago

When I try to run the docker image with singularity, I get this error message:

[koch@pplxint11 TriggerApplication]$ source Setup.sh 
bash: /root/HyperK/root/bin/thisroot.sh: Permission denied

I guess the problem is that singularity does not run everything as root?

To test this yourself, just run singularity run docker://hkdaq/triggerapplication:latest.

tdealtry commented 4 years ago

@brichards64 can comment on why being root is desired, but if we can get away with not being root, we need to remember to change the WCSim docker file as well as the TriggerApplication docker file

ast0815 commented 4 years ago

I assume that when you make it run with non-root users, it will also run as root user. It is probably just a matter of setting the right access rights so that everyone can run the code. I don't know how Docker works, but maybe all that is needed is a chmod at the end of the build instructions?

tdealtry commented 4 years ago

@ast0815 since you know how to use singularity, can you check the latest WCSim docker build and see if it works for you? I rearranged the code around a bit (i.e. not using / or /root/), but I'm not entirely sure what I'm aiming for... When WCSim is working, we can rearrange TriggerApplication docker in the same way

ast0815 commented 4 years ago

Which docker image should I test exactly?

tdealtry commented 4 years ago

Thanks @ast0815 It's published at https://hub.docker.com/layers/wcsim/wcsim/latest/images/sha256-589795910eebbb53623079a6dc7d09f972ea7cfcb0b6c1a3594568bf56bbd407?context=explore

ast0815 commented 4 years ago

That link did not work, but I assume this is the right place? https://hub.docker.com/r/wcsim/wcsim/tags

tdealtry commented 4 years ago

ahh that's because latest changed recently (Erin merged a PR) Yes, that one. Specifically the latest tag

ast0815 commented 4 years ago

I built a singularity image with singularity build WCSim.sif docker://wcsim/wcsim:latest, but it gave me an error message when trying to run it:

$ singularity run WCSim.sif 
/bin/sh: /home/nu/HyperK/env-WCSim.sh: Permission denied

Looks like you still don't have things set up world readable:

$ singularity shell WCSim.sif 
Singularity> cd /home
Singularity> ls -l
total 0
drwx------ 4 root     root 123 Apr  6 09:12 nu
drwxr-xr-x 3 kdf77245 t2k   60 Apr  6 14:37 ppd

The ppd folder in the home directory is mounted in from my host system, so don't worry about that one.