forked from formbio/FLAG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_singularity_flag.sh
executable file
·48 lines (37 loc) · 1.53 KB
/
build_singularity_flag.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
############################################################
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('conda' 'shell.bash' 'hook' 2> /dev/null)"
eval "$__conda_setup"
unset __conda_setup
# <<< conda initialize <<<
############################################################
conda activate flag
# Create a custom temporary directory
mkdir -p $(pwd)/singularity_tmp
# Set Singularity temporary directory and cache directory
export SINGULARITY_TMPDIR=$(pwd)/singularity_tmp
export SINGULARITY_CACHEDIR=$(pwd)/singularity_tmp/cache
# cd to the directory
echo "Entering singularity_flag container directory"
cd containers/singularity_flag/
#build the singularity image
echo "Building the singularity_flag singularity image"
singularity build --fakeroot --fix-perms singularity_flag.image singularity_flag.def
# cd to examples
echo "Entering the examples directory"
cd ../../examples
# move the image
echo "Moving the singularity_flag singularity image to the examples directory"
mv ../containers/singularity_flag/singularity_flag.image .
# Setup the run directory
echo "Creating initial files/directories needed to run flag from the singularity image"
mkdir nxf_work
mkdir nxf_home; cd nxf_home; mkdir framework; cd framework; mkdir 23.10.0; cd 23.10.0
wget https://www.nextflow.io/releases/v23.10.0/nextflow-23.10.0-one.jar
cd ../../../
touch pipeline_trace.txt
mkdir .nextflow
mkdir tempdir
echo "Singularity FLAG image built and initial files setup in the examples directory."