khanlab / neuroglia-helpers

Helper and wrapper scripts for using Singularity locally and on compute canada
GNU General Public License v3.0
5 stars 7 forks source link

WIP: Make the default cfg file more general #9

Closed isolovey closed 5 years ago

isolovey commented 5 years ago
akhanf commented 5 years ago

made a couple minor fixes.. wonder if there is also a nicer way to select the custom config? right now users would have to edit line 34 of 00_init.sh, which is not the most intuitive.. especially since all of my lab would need to switch to graham-khanlab.cfg to avoid breaking things.. any thoughts?

isolovey commented 5 years ago

Maybe have a setup script, e.g. setup.sh, that sources the variables in 00_init.sh and loads the singularity module? I've added a "profile", =default by default, or specified on the command line, setup.sh khanlab.

isolovey commented 5 years ago

Renamed default file back to graham.cfg to avoid breaking everyone's existing setup.

It still needs work though, because the allocation in graham.cfg has changed from khanlab's allocation to a def- allocation of the user...

If we push this to master, I think everyone will have to re-run setup.sh with the right argument (either khanlab, bmi, or nothing). After removing the already inserted lines in ~/.bash_profile.

akhanf commented 5 years ago

almost there! @isolovey-robarts can you try the following after a fresh setup? (with and without khanlab) and let me know where your container ends up? singularity run docker://poldracklab/mriqc:latest

akhanf commented 5 years ago

mriqc is actually pretty big, may just do docker://bids/example for the demo instead

isolovey commented 5 years ago

The setup seems to work fine. However, running singularity run docker://bids/example produces a whole bunch of warnings, then an error in the end:

>singularity run docker://bids/example
INFO:    Converting OCI blobs to SIF format
INFO:    Starting build...

...

2019/10/01 11:15:24  warn xatt{usr/lib/node_modules/bids-validator/node_modules/readable-stream/float.patch} ignoring ENOTSUP on setxattr "user.rootlesscontainers"
2019/10/01 11:15:24  warn xatt{usr/lib/node_modules/bids-validator/node_modules/readable-stream/lib} ignoring ENOTSUP on setxattr "user.rootlesscontainers"
2019/10/01 11:15:24  warn xatt{usr/lib/node_modules/bids-validator/node_modules/readable-stream/lib/_stream_duplex.js} ignoring ENOTSUP on setxattr "user.rootlesscontainers"

...

ERROR:   build: failed to make environment files: open /scratch/isolovey/sbuild-160446513/fs/etc/resolv.conf: permission denied
FATAL:   Unable to handle docker://bids/example uri: unable to build: packer failed to pack: while inserting base environment: build: failed to make environment files: open /scratch/isolovey/sbuild-160446513/fs/etc/resolv.conf: permission denied

It also takes ~10 minutes.

akhanf commented 5 years ago

yeah I noticed this too -- due to the filesystems on /tmp and /scratch.. possible workaround is to use gra-vdi since /tmp is not in RAM there, but they don't have 3.4 installed yet.. working on it via a support ticket..

akhanf commented 5 years ago

since module load singularity resets SINGULARITY_TMPDIR to /scratch (and causes pull failures), moved module load to occur before init, and set SINGULARITY_TMPDIR to /tmp in the cfg file