0

please would you advise :

given a singularity container, how can I copy the files from the local drive to the singularity container ?

I am using a singularity container that is described at :

 https://hub.docker.com/r/tobneu/slamdunk 

(and from the docker image i have made a singularity image for a SLURM cluster)

I have searched the stackoverflow for answers, however, i have found the answer only to the reverse question i.e. copying the files from the singularity container to the local drive.

https://stackoverflow.com/questions/59736299/transferring-files-from-the-singularity-container-into-the-local-directory

thanks a lot,

bogdan

Bogdan
  • 345
  • 1
  • 16
  • I'm not familiar with singularity but I checked out their site, and don't the `copy` related recipes do what you're asking? https://sylabs.io/guides/2.5/user-guide/container_recipes.html – Howard_Roark Jun 08 '21 at 21:45

2 Answers2

3

As mentioned on your previous question, singularity has the -H/--home command line parameter.

singularity exec -H /labs/zzz/data my_image.sif bash -c 'echo "HOME=$HOME";echo "PWD=$PWD"'
# HOME=/labs/zzz/data
# PWD=...
tsnowlan
  • 3,472
  • 10
  • 15
  • 1
    yes, thank you very very much. i have just seen your answer on the page : https://stackoverflow.com/questions/67855188/how-make-a-current-directory-as-home-directory-in-linux/67855620#67855620 ; i am very very grateful ! it helped me a lot ! – Bogdan Jun 09 '21 at 12:47
0

Finally, i have got it to work. Shall anyone need to know the answer to the question in the title, it is outlined below by using --bind and --home:

singularity exec \
--bind /local/scratch/btanasa:/output8 \
--home /labs/jlgoldbe/MASSY_data_SLAMseq/the_SAMPLES_MAY2021:/home \
/labs/jlgoldbe/MASSY_data_SLAMseq/the_SAMPLES_MAY2021/SLAMDUNK_SINGULARITY/slamdunk_latest.sif slamdunk all \
-r GRCm38.primary_assembly.genome.fa \
-b 3UTRs_vM14_github_repository.27aug2020.sortdesc.LONG.with.SYMBOLS.to.use.bed \ -o /output8 \
-t 4 \
./8_R1_001.fastq.gz
Bogdan
  • 345
  • 1
  • 16