-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSingularity.def
More file actions
169 lines (140 loc) · 4.68 KB
/
Singularity.def
File metadata and controls
169 lines (140 loc) · 4.68 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
Bootstrap: docker
From: ubuntu:22.04
Stage: builder
%files
support/snap-install.sh /tmp/snap-install.sh
support/snap.varfile /tmp/snap.varfile
pyproject.toml /workspace/pyproject.toml
sarpyx /workspace/sarpyx
%post
#!/bin/bash
set -eu
echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/99root
export DEBIAN_FRONTEND=noninteractive
export TZ=Etc/UTC
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
export SNAP_VERSION=12.0.0
export SNAP_HOME="/snap12"
export SNAP_SKIP_UPDATES=1
export PATH="${PATH}:${SNAP_HOME}/bin"
export PIP_DISABLE_PIP_VERSION_CHECK=1
export PIP_NO_CACHE_DIR=1
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
software-properties-common \
gnupg \
gpg-agent \
lsb-release \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& add-apt-repository -y ppa:openjdk-r/ppa \
&& apt-get update && apt-get install -y --no-install-recommends \
python3.11 \
python3.11-venv \
python3.11-dev \
curl \
wget \
git \
build-essential \
openjdk-8-jdk \
libhdf5-dev \
libxml2-dev \
libxslt1-dev \
libproj-dev \
libgeos-dev \
&& rm -rf /var/lib/apt/lists/*
sed -i "s|^sys.installationDir=.*|sys.installationDir=${SNAP_HOME}|" /tmp/snap.varfile
chmod +x /tmp/snap-install.sh
/tmp/snap-install.sh -v
rm -f /tmp/snap-install.sh /tmp/snap.varfile
rm -rf /var/lib/apt/lists/*
curl -fsSL https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
python3.11 /tmp/get-pip.py
rm -f /tmp/get-pip.py
cd /workspace
python3.11 -m pip install --no-cache-dir .
python3.11 -c "import sarpyx; print('sarpyx installed successfully')"
Bootstrap: docker
From: ubuntu:22.04
Stage: runtime
%labels
Author yourname
Description SNAP + sarpyx runtime container
%environment
export DEBIAN_FRONTEND=noninteractive
export TZ=Etc/UTC
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_ALL=en_US.UTF-8
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
export SNAP_HOME="/workspace/snap12"
export SNAP_SKIP_UPDATES=1
export PATH="${PATH}:${SNAP_HOME}/bin"
export PIP_DISABLE_PIP_VERSION_CHECK=1
export PIP_NO_CACHE_DIR=1
%files from builder
/snap12 /workspace/snap12
%files
pyproject.toml /workspace/pyproject.toml
sarpyx /workspace/sarpyx
tests /workspace/tests
entrypoint.sh /usr/local/bin/entrypoint.sh
start-jupyter.sh /usr/local/bin/start-jupyter.sh
%post
#!/bin/bash
set -eu
echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/99root
export DEBIAN_FRONTEND=noninteractive
export TZ=Etc/UTC
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_ALL=en_US.UTF-8
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
export SNAP_HOME="/workspace/snap12"
export SNAP_SKIP_UPDATES=1
export PATH="${PATH}:${SNAP_HOME}/bin"
export PIP_DISABLE_PIP_VERSION_CHECK=1
export PIP_NO_CACHE_DIR=1
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
python3.11 \
curl \
locales \
openjdk-8-jdk \
gdal-bin \
libgdal30 \
&& locale-gen en_US.UTF-8 \
&& update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& rm -rf /tmp/* /var/tmp/*
ln -sf /usr/bin/python3.11 /usr/bin/python3
ln -sf /usr/bin/python3.11 /usr/bin/python
curl -fsSL https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
python3.11 /tmp/get-pip.py
rm -f /tmp/get-pip.py
ln -sf /workspace/snap12/bin/snap /usr/local/bin/snap
ln -sf /workspace/snap12/bin/gpt /usr/local/bin/gpt
cd /workspace
python3.11 -m pip install --upgrade pip setuptools wheel
python3.11 -m pip install -e .
python3.11 -c "import six; print('six installed successfully')"
python3.11 -m pip install --ignore-installed --no-cache-dir six python-dateutil
python3.11 -c "import six, dateutil; print('runtime deps ok')"
rm -rf /var/lib/apt/lists/* /var/cache/apt/* /tmp/* /var/tmp/*
chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/start-jupyter.sh
%runscript
cd /workspace
if [ "$#" -eq 0 ]; then
exec /usr/local/bin/entrypoint.sh /bin/bash
else
exec /usr/local/bin/entrypoint.sh "$@"
fi
%startscript
cd /workspace
if [ "$#" -eq 0 ]; then
exec /usr/local/bin/entrypoint.sh /bin/bash
else
exec /usr/local/bin/entrypoint.sh "$@"
fi
%test
python3.11 -c "import sarpyx; print('sarpyx OK')"