-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstandard.Dockerfile
262 lines (223 loc) · 7.8 KB
/
standard.Dockerfile
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
USER root
# Create software environment.
COPY --chmod=644 environment.yml /opt/environment.yml
RUN \
/opt/conda/bin/conda config --system --set channel_priority flexible && \
/opt/conda/bin/mamba env create \
-f /opt/environment.yml \
-p /opt/software && \
/opt/conda/bin/conda config --system --set channel_priority strict && \
clean-layer.sh
# ========================================
RUN \
# The software package that's imported as a tar includes an incorrect
# condarc file, using a modified version of the jupyter default instead
echo -n > /opt/software/.condarc && \
/opt/software/bin/conda config --system --append channels pytorch && \
/opt/software/bin/conda config --system --append channels conda-forge && \
/opt/software/bin/conda config --system --set auto_update_conda false && \
/opt/software/bin/conda config --system --set show_channel_urls true && \
/opt/software/bin/conda config --system --set channel_priority flexible && \
/opt/software/bin/conda config --system --set ssl_verify /etc/ssl/certs/ca-certificates.crt && \
/opt/software/bin/conda config --system --set allow_softlinks false
# ========================================
RUN /opt/software/bin/python -m ipykernel install --prefix=/opt/conda --display-name="Python 3"
ENV CC=clang CXX=clang++
RUN echo "import os ; os.environ['PATH'] = '/opt/software/bin:'+os.environ['PATH']" >> /etc/jupyter/jupyter_notebook_config.py
RUN echo "import os ; os.environ['PATH'] = '/opt/software/bin:'+os.environ['PATH']" >> /etc/jupyter/jupyter_server_config.py
ENV PATH=/opt/software/bin:${PATH}
ENV CONDA_DIR=/opt/software
# Make sure curl uses the correct system certificates from the ca-certificates
# package
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# ========================================
# requires bdaaccounting collection in the builder
RUN \
echo [FreeTDS] >> /etc/odbcinst.ini && \
echo Description=FreeTDS Driver >> /etc/odbcinst.ini && \
echo Driver=/opt/software/lib/libtdsodbc.so >> /etc/odbcinst.ini && \
echo Setup=/opt/software/lib/libtdsS.so >> /etc/odbcinst.ini
# ========================================
# Uncomment when ca-certificates requires an update
# RUN \
# apt-get update && apt-get install -y --no-install-recommends \
# ca-certificates \
# && \
# pip install --no-cache-dir \
# 'certifi>2021.10.8' \
# && \
# clean-layer.sh
# ========================================
#
# TODO: Last-added packages, move to builder when doing a full rebuild
#
# # coursecode, RT#00000
# RUN \
# apt-get update && apt-get install -y --no-install-recommends \
# packagename \
# && \
# /opt/software/bin/mamba install -p /opt/software -y --freeze-installed \
# packagename \
# && \
# /opt/software/bin/pip install --no-cache-dir \
# packagename \
# && \
# clean-layer.sh
# This is needed by `make test-standard`, can also be useful for users
RUN \
/opt/software/bin/mamba install -p /opt/software -y --freeze-installed \
pytest \
&& \
clean-layer.sh
# koit2024, RT#24848
RUN \
/opt/software/bin/mamba install -p /opt/software -y --freeze-installed \
torchaudio \
&& \
clean-layer.sh
# Uncomment when nbgrader needs to be updated
# RUN \
# # Use the full path to pip to be more explicit about which environment
# # we're installing to
# /opt/conda/bin/pip uninstall nbgrader -y && \
# /opt/conda/bin/pip install --no-cache-dir \
# git+https://github.com/AaltoSciComp/[email protected] && \
# clean-layer.sh
# TODO: Remove this when upgrading base to jupyterlab>=4 and jupyter_server>=2
RUN \
/opt/conda/bin/pip uninstall jupyter_server_terminals -y && \
clean-layer.sh
# This is currently already installed in the base image, but is required here
# as well, so that it's accessible when running pytest in /opt/software.
RUN \
/opt/software/bin/mamba install -p /opt/software -y --freeze-installed \
nbval \
&& \
clean-layer.sh
# mlca2024, RT#25045
RUN \
/opt/software/bin/mamba install -p /opt/software -y --freeze-installed \
openeo \
imgaug \
ipyleaflet \
&& \
/opt/software/bin/pip install --no-cache-dir \
fusets \
&& \
clean-layer.sh
# mlca2024, RT#25045
RUN \
/opt/software/bin/mamba install -p /opt/software -y --freeze-installed \
sentinelhub \
eo-learn \
&& \
clean-layer.sh
# valueanalytics2024, RT#25231
RUN \
# NOTE: No --freeze-installed flag because couldn't install the package with it
/opt/software/bin/mamba install -p /opt/software -y \
'openai>=1.10' \
&& \
clean-layer.sh
# css2024, RT#25415
RUN \
/opt/software/bin/pip install --no-cache-dir \
detoxify \
&& \
clean-layer.sh
# gausproc2024, RT#25611
RUN \
/opt/software/bin/mamba install -p /opt/software -y --freeze-installed \
'tensorflow-probability>=0.22.0' \
&& \
/opt/software/bin/pip install --no-cache-dir \
'gpflow>=2.9.0' \
&& \
clean-layer.sh
# quantuminfo2024, RT#25838
RUN \
# NOTE: No --freeze-installed flag because couldn't install the package with it
/opt/software/bin/mamba uninstall -p /opt/software -y \
qiskit-terra \
&& \
/opt/software/bin/mamba install -p /opt/software -y \
'qiskit>=1' \
qiskit-aer \
&& \
clean-layer.sh
# RT#25980
# TODO: remove when base updates
RUN \
apt-get update && apt-get install -y --no-install-recommends \
# For exporting notebooks containing SVGs using nbconvert
inkscape \
&& \
clean-layer.sh
# dhhb2024, RT#27034
RUN \
/opt/software/bin/pip install --no-cache-dir \
niimpy \
liwc \
&& \
clean-layer.sh
# dhhb2024, RT#27034
RUN \
/opt/conda/bin/mamba install -p /opt/conda -y \
plotly \
&& \
clean-layer.sh
# deeplearn2025, RT#27200
# Not freezing because triggering a version update
RUN \
/opt/software/bin/mamba install -p /opt/software -y \
'transformers>=4.46.0' \
&& \
clean-layer.sh
RUN \
/opt/software/bin/mamba install -p /opt/software -y --freeze-installed \
# deeplearn2025, RT#27200
peft \
# RT#27516
pulp \
glpk \
&& \
clean-layer.sh
# ========================================
# TODO: remove when base updates
RUN \
rm /usr/local/bin/before-notebook-root.d/allow-client-build.sh
# TODO: remove when updating base
# Fixes https://github.com/jupyter/nbgrader/issues/1870
RUN \
# Use the full path to pip to be more explicit about which environment
# we're installing to
/opt/conda/bin/pip uninstall nbgrader -y && \
/opt/conda/bin/pip install --no-cache-dir \
git+https://github.com/AaltoSciComp/[email protected] && \
clean-layer.sh
# ========================================
# Duplicate of base, but hooks and patches can update frequently and are small,
# so they're applied again here.
COPY --chmod=0755 hooks/ scripts/ /usr/local/bin/
COPY patches/ /tmp/patches/
RUN \
cd / && \
for patch in /tmp/patches/*; do \
echo $patch && \
patch -p0 -u < $patch; \
done
# Save version information within the image
ARG IMAGE_VERSION
ARG BASE_IMAGE
ARG JUPYTER_SOFTWARE_IMAGE
ARG GIT_DESCRIBE
RUN \
truncate --size 0 /etc/cs-jupyter-release && \
echo IMAGE_VERSION=${IMAGE_VERSION} >> /etc/cs-jupyter-release && \
echo BASE_IMAGE=${BASE_IMAGE} >> /etc/cs-jupyter-release && \
prefix=$(grep prefix: /opt/environment.yml | cut -d' ' -f2) && \
echo JUPYTER_SOFTWARE_VERSION=${prefix} >> /etc/cs-jupyter-release && \
echo GIT_DESCRIBE=${GIT_DESCRIBE} >> /etc/cs-jupyter-release
USER $NB_UID