|
1 | | -FROM python:3.12-slim-bookworm |
| 1 | +FROM images.canfar.net/skaha/astroml:latest |
2 | 2 |
|
3 | | -LABEL Description="Conda-Free ShapePipe Docker Image" |
4 | | -ENV SHELL=/bin/bash |
5 | | -ENV QT_QPA_PLATFORM=offscreen |
| 3 | +# Metadata |
| 4 | +LABEL maintainer="martin.kilbinger@cea.fr" |
| 5 | +LABEL description="ShapePipe base image with common dependencies" |
6 | 6 |
|
7 | | -# Install system dependencies |
8 | | -RUN apt-get update -y --quiet --fix-missing && \ |
9 | | - apt-get dist-upgrade -y --quiet --fix-missing && \ |
10 | | - apt-cache policy autconf && \ |
11 | | - apt-get install -y --quiet \ |
12 | | - apt-utils \ |
13 | | - autoconf \ |
14 | | - automake \ |
15 | | - build-essential \ |
16 | | - cmake \ |
17 | | - curl \ |
18 | | - wget \ |
19 | | - ffmpeg \ |
20 | | - g++ \ |
21 | | - gcc \ |
22 | | - gfortran \ |
23 | | - git-lfs \ |
24 | | - libatlas-base-dev \ |
25 | | - libblas-dev \ |
26 | | - liblapack-dev \ |
27 | | - libcfitsio-dev \ |
28 | | - libfftw3-bin \ |
29 | | - libfftw3-dev \ |
30 | | - libgl1-mesa-glx \ |
31 | | - libgsl-dev \ |
32 | | - libtool \ |
33 | | - libtool-bin \ |
34 | | - libtool-doc \ |
35 | | - locales \ |
36 | | - locate \ |
37 | | - make \ |
38 | | - openmpi-bin \ |
39 | | - libopenmpi-dev \ |
40 | | - libproj-dev \ |
41 | | - proj-bin \ |
42 | | - pkg-config \ |
43 | | - protobuf-compiler \ |
44 | | - psfex=3.21.1-1 \ |
45 | | - source-extractor=2.25.0+ds-3 \ |
46 | | - weightwatcher=1.12+dfsg-3 \ |
47 | | - vim \ |
48 | | - xterm && \ |
49 | | - apt-get clean -y && \ |
50 | | - apt-get autoremove --purge --quiet -y && \ |
51 | | - rm -rf /var/lib/apt/lists/* /var/tmp/* |
| 7 | +# Install system dependencies needed for ShapePipe and WeightWatcher |
| 8 | +RUN apt-get update -o Acquire::ForceIPv4=true -y --quiet && \ |
| 9 | + apt-get install -y --no-install-recommends \ |
| 10 | + psfex source-extractor \ |
| 11 | + libproj-dev proj-bin && \ |
| 12 | + apt-get clean && rm -rf /var/lib/apt/lists/* |
52 | 13 |
|
53 | | -# Install CDS client by hand |
| 14 | +# Build and install WeightWatcher from source |
| 15 | +ARG WW_VERSION=1.12 |
54 | 16 | RUN cd /tmp && \ |
55 | | - curl -O http://cdsarc.u-strasbg.fr/ftp/pub/sw/cdsclient.tar.gz && \ |
56 | | - tar xvfz cdsclient.tar.gz \ |
57 | | - && cd cdsclient-* \ |
58 | | - && ./configure && make && make install \ |
59 | | - && rm -rf /tmp/* |
| 17 | + wget --no-check-certificate https://github.com/astromatic/weightwatcher/archive/refs/tags/${WW_VERSION}.tar.gz && \ |
| 18 | + tar -xzf ${WW_VERSION}.tar.gz && \ |
| 19 | + rm ${WW_VERSION}.tar.gz |
| 20 | +RUN cd /tmp/weightwatcher-${WW_VERSION} && \ |
| 21 | + sed -i 's/^ prefstruct\tprefs;/extern prefstruct\tprefs;/' src/prefs.h && \ |
| 22 | + sed -i 's/^char\t\tgstr\[MAXCHAR\];/extern char\t\tgstr[MAXCHAR];/' src/globals.h && \ |
| 23 | + sed -i 's/^int\t\tbswapflag;/extern int\t\tbswapflag;/' src/fits/fitscat.h && \ |
| 24 | + sed -i '/preflist\.h/a prefstruct\tprefs;' src/prefs.c && \ |
| 25 | + sed -i '/xml\.h/a char\t\tgstr[MAXCHAR];' src/main.c && \ |
| 26 | + sed -i '/fitscat\.h/a int\t\tbswapflag;' src/fits/fitscat.c && \ |
| 27 | + ./configure --quiet && \ |
| 28 | + make --quiet && \ |
| 29 | + make install |
60 | 30 |
|
61 | | -# Install python dependencies |
| 31 | +# Ensure astroml:latest conda Python 3.12 is used (Docker RUN does not source conda init) |
| 32 | +ENV PATH /opt/conda/bin:$PATH |
| 33 | + |
| 34 | +# Upgrade pip and install tools not part of the ShapePipe package |
62 | 35 | RUN pip install --no-cache-dir --upgrade pip && \ |
63 | 36 | pip install --no-cache-dir \ |
64 | | - astropy==6.1.0 \ |
65 | | - cs_util==0.1.9 \ |
66 | | - galsim==2.5.3 \ |
67 | | - ipython==8.18.1 \ |
68 | | - joblib==1.4.2 \ |
69 | | - jupyterlab==4.3.1 \ |
70 | | - matplotlib==3.8.4 \ |
71 | | - mccd==1.2.4 \ |
72 | | - modopt==1.6.1 \ |
73 | | - mpi4py==4.0.3 \ |
74 | | - numpy==1.26.4 \ |
75 | | - numpydoc==1.2 \ |
76 | | - pandas==2.2 \ |
77 | | - pytest==8.3.3 \ |
78 | | - pytest-cov==5.0.0 \ |
79 | | - pytest-pycodestyle==2.4.1 \ |
80 | | - pytest-pydocstyle==2.4.0 \ |
81 | | - reproject==0.14.1 \ |
82 | | - sf_tools==2.0.4 \ |
83 | | - skaha==1.7.0 \ |
84 | | - sqlitedict==2.0.0 \ |
85 | | - termcolor==1.1.0 \ |
86 | | - tqdm==4.63.0 \ |
87 | | - vos==3.6.1.1 \ |
88 | | - git+https://github.com/aguinot/ngmix@stable_version |
| 37 | + ipython==8.18.1 \ |
| 38 | + jupyterlab==4.3.1 \ |
| 39 | + snakemake==8.27.1 |
89 | 40 |
|
| 41 | +# Set working directory and copy source code |
90 | 42 | WORKDIR /app |
91 | 43 | COPY . /app/. |
| 44 | +RUN chown -R root:root /app && chmod -R u+rwX /app |
92 | 45 |
|
93 | | -# Install shapepipe and symlink scripts |
94 | | -RUN pip install --no-cache-dir -e . && \ |
| 46 | +# Install ShapePipe and its dependencies (including fitsio optional extra) |
| 47 | +RUN pip install --no-cache-dir -e ".[fitsio]" && \ |
95 | 48 | for ext in .py .sh .bash; do \ |
96 | | - for script in /app/scripts/*/*$ext; do \ |
97 | | - link_name=`basename $script $ext`; \ |
98 | | - ln -s $script /usr/local/bin/$link_name; \ |
99 | | - done; \ |
| 49 | + for script in /app/scripts/*/*$ext; do \ |
| 50 | + link_name=$(basename $script $ext); \ |
| 51 | + ln -s $script /usr/local/bin/$link_name; \ |
| 52 | + done; \ |
100 | 53 | done |
0 commit comments