-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSingularity
executable file
·87 lines (73 loc) · 2.25 KB
/
Singularity
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
BootStrap: docker
From: ubuntu:18.04
%labels
Maintainer: Suxing Liu
Version v1.01
%setup
#----------------------------------------------------------------------
# commands to be executed on host outside container during bootstrap
#----------------------------------------------------------------------
mkdir ${SINGULARITY_ROOTFS}/opt/code/
%files
./* /opt/code/
%post
#----------------------------------------------------------
# Install common dependencies and create default entrypoint,
# commands to be executed inside container during bootstrap
#----------------------------------------------------------
# Install dependencies
apt update
apt install -y \
build-essential \
python3-setuptools \
python3-pip \
python3-numexpr \
libgl1-mesa-glx \
libsm6 \
libxext6 \
libfontconfig1 \
libxrender1 \
libzbar-dev \
libzbar0 \
python3-pandas \
libdmtx0b
pip3 install numpy \
Pillow \
scipy \
scikit-image \
matplotlib \
opencv-python \
openpyxl \
python-magic \
imutils \
tabulate \
skan \
networkx \
pandas \
numba \
psutil \
pylibdmtx
pip3 install -U scikit-learn
mkdir /lscratch /db /work /scratch
chmod -R a+rwx /opt/code/
%environment
#----------------------------------------------------------
# Setup environment variables
#----------------------------------------------------------
PYTHONPATH=$PYTHONPATH:/opt/code/
export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/code/
export LD_LIBRARY_PATH
%runscript
#----------------------------------------------------------
# Run scripts inside container
#----------------------------------------------------------
# commands to be executed when the container runs
echo "Arguments received: $*"
exec /usr/bin/python "$@"
%test
#----------------------------------------------------------
# commands to be executed within container at close of bootstrap process
#----------------------------------------------------------
python3 --version
#python3 requirement.py