-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
234 lines (221 loc) · 6.78 KB
/
Dockerfile
File metadata and controls
234 lines (221 loc) · 6.78 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
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
# syntax=docker/dockerfile:1.7
# Single-stage image: merges ShapePipe's Dockerfile with SP Validation additions
# and a rich CLI toolset for agents. No conda.
FROM python:3.12-bookworm
LABEL description="Cosmological data analysis environment: cosmic shear, CMB lensing, cross-correlations"
ENV SHELL=/bin/bash \
DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
LANG=C.UTF-8
RUN set -eux; \
# --- System upgrade --- \
apt-get update -y --quiet --fix-missing && \
apt-get dist-upgrade -y --quiet --fix-missing && \
# --- Base build and runtime deps (ShapePipe core) --- \
pkgs="\
apt-utils \
autoconf \
automake \
build-essential \
chafa \
cmake \
curl \
wget \
ffmpeg \
g++ \
gcc \
gfortran \
git \
git-lfs \
libatlas-base-dev \
libblas-dev \
liblapack-dev \
libcfitsio-dev \
libhealpix-dev \
libhealpix-cxx-dev \
libfftw3-bin \
libfftw3-dev \
libgl1-mesa-glx \
libtool \
libtool-bin \
libtool-doc \
libsharp-dev \
locales \
locate \
make \
openmpi-bin \
libopenmpi-dev \
pkg-config \
protobuf-compiler \
psfex \
source-extractor \
weightwatcher \
vim \
xterm \
libgsl-dev \
npm \
tmux \
ca-certificates \
pandoc \
# Agentic / developer tools
ripgrep \
fd-find \
fzf \
bat \
jq \
yq \
delta \
httpie \
aria2 \
sqlite3 \
hyperfine \
btop \
duf \
procps \
htop \
less \
unzip \
zip \
rsync \
openssh-client \
tldr "; \
# --- Install --- \
apt-get install -y --quiet --no-install-recommends $pkgs && \
# convenience symlinks (Debian names) \
if command -v batcat >/dev/null 2>&1; then ln -sf "$(command -v batcat)" /usr/local/bin/bat; fi && \
if command -v fdfind >/dev/null 2>&1; then ln -sf "$(command -v fdfind)" /usr/local/bin/fd; fi && \
# cleanup \
apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
# Install modern Neovim
RUN set -eux; \
curl -fsSL -o /tmp/nvim.tar.gz https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.tar.gz; \
tar -C /usr/local -xzf /tmp/nvim.tar.gz; \
ln -sf /usr/local/nvim-linux-x86_64/bin/nvim /usr/local/bin/nvim; \
rm -f /tmp/nvim.tar.gz
# Chafa (static Linux x86_64 build)
RUN set -eux; \
curl -fsSL -o /tmp/chafa.tar.gz https://hpjansson.org/chafa/releases/static/chafa-1.16.2-1-x86_64-linux-gnu.tar.gz; \
tar -C /usr/local -xzf /tmp/chafa.tar.gz; \
rm -f /tmp/chafa.tar.gz; \
ln -sf /usr/local/chafa-1.16.2-1-x86_64-linux-gnu/chafa /usr/local/bin/chafa
# PolSpice (spherical power spectrum estimator)
RUN set -eux; \
tmpdir="$(mktemp -d)"; \
cd "$tmpdir"; \
curl -fsSLO https://www2.iap.fr/users/hivon/software/PolSpice/ftp/PolSpice_v03-08-03.tar.gz; \
tar -xzf PolSpice_v03-08-03.tar.gz; \
cd PolSpice_v03-08-03; \
mkdir build; \
cd build; \
healpix_prefix="$(pkg-config --variable=prefix healpix)"; \
healpix_lib="$(pkg-config --variable=libdir healpix)"; \
healpix_mod="$(pkg-config --variable=moddir healpix)"; \
healpix_inc_flags="$(pkg-config --cflags-only-I healpix)"; \
healpix_include="$(printf '%s\n' "$healpix_inc_flags" | tr ' ' '\n' | sed -n 's/^-I//p' | paste -sd';' - | sed 's/;$//')"; \
if [ -z "$healpix_include" ]; then \
healpix_include="$(find "$healpix_lib" -maxdepth 3 -name healpix_types.mod -print -quit | xargs -r dirname)"; \
fi; \
if [ -z "$healpix_include" ]; then \
healpix_include="$(find /usr -name healpix_types.mod -print -quit | xargs -r dirname)"; \
fi; \
if [ -n "$healpix_include" ] && [ -n "$healpix_mod" ]; then \
healpix_include="$healpix_include;$healpix_mod"; \
elif [ -z "$healpix_include" ] && [ -n "$healpix_mod" ]; then \
healpix_include="$healpix_mod"; \
fi; \
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DHEALPIX="$healpix_prefix" \
-DHEALPIX_LIB="$healpix_lib" \
-DHEALPIX_INCLUDE="$healpix_include" \
-DSHARPDIR="$healpix_lib"; \
cmake --build . --parallel "$(nproc)"; \
install_dir=/opt/polspice; \
mkdir -p "$install_dir"; \
cp -r ../bin/. "$install_dir"/; \
install -m 0755 "$install_dir/spice" /usr/local/bin/spice; \
ln -sf spice /usr/local/bin/polspice; \
rm -rf "$tmpdir"
# Zellij terminal multiplexer
COPY zellij-config.kdl /etc/zellij/config.kdl
RUN set -eux; \
mkdir -p /tmp/zellij && \
cd /tmp/zellij && \
wget https://github.com/zellij-org/zellij/releases/download/v0.43.1/zellij-no-web-x86_64-unknown-linux-musl.tar.gz && \
tar -xzf zellij-no-web-x86_64-unknown-linux-musl.tar.gz && \
cp zellij /usr/local/bin/ && \
rm -rf /tmp/zellij
# Quarto (for scientific writing) — prerelease channel, AMD64
RUN set -eux; \
ARCH=amd64; \
curl -L "$(curl -fsSL https://quarto.org/docs/download/_prerelease.json | grep -oP "(?<=\\\"download_url\\\":\\s\\\")https.*${ARCH}\\.deb")" -o /tmp/quarto.deb; \
dpkg -i /tmp/quarto.deb; \
rm /tmp/quarto.deb
# Python dependencies (relaxed pins for rapid development) + Snakemake
RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir \
astropy \
adjustText \
camb \
clmm \
colorama \
cs_util \
emcee \
h5py \
healpy \
healsparse \
importlib_metadata \
ipython \
joblib \
jupyter \
jupyterlab \
jupytext \
lenspack \
lmfit \
numexpr \
numpy \
numba \
mpi4py \
numpydoc \
opencv-python-headless \
pandas \
PyQt5 \
pyqtgraph \
pyccl \
pyarrow \
pymaster \
pytest \
pytest-cov \
pytest-pydocstyle \
pytest-pycodestyle \
regions \
reproject \
scipy \
seaborn \
skyproj \
sf_tools \
sip_tpv \
skaha \
sqlitedict \
statsmodels \
termcolor \
tqdm \
treecorr \
uncertainties \
vos \
snakemake \
snakemake-executor-plugin-slurm \
lenspyx \
ducc0 \
# Git-based dependencies
git+https://github.com/Nicholaswogan/NumbaQuadpack.git \
git+https://github.com/aguinot/cosmo-numba \
git+https://github.com/benabed/getdist.git@upper_triangle_whisker \
git+https://github.com/CosmoStat/shear_psf_leakage.git@develop \
git+https://github.com/aguinot/ngmix@stable_version \
git+https://github.com/tobias-liaudat/Stile@v0.1 \
git+https://github.com/CosmoStat/sp_validation@psf_size_hack
# Working directory for user code
WORKDIR /workspace
# Default entry
ENTRYPOINT ["bash"]
CMD ["-l"]