Skip to content

Commit d34c45d

Browse files
author
martinkilbinger
committed
Merge branch 'martinkilbinger-v2.0' into develop
2 parents 6ab2a24 + 0b0923e commit d34c45d

59 files changed

Lines changed: 26333 additions & 336 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-image.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
name: Create and publish a Docker image
2-
32
on: [push, workflow_dispatch]
4-
53
env:
64
REGISTRY: ghcr.io
75
IMAGE_NAME: ${{ github.repository }}
86
BRANCH: ${{ github.ref }}
9-
107
jobs:
118
build-and-push-image:
12-
runs-on:
13-
- ubuntu-latest
14-
# - macos-latest
9+
runs-on: ubuntu-latest
1510
permissions:
1611
contents: read
1712
packages: write
18-
1913
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
2017
- name: Log in to the Container registry
2118
uses: docker/login-action@v3
2219
with:
@@ -26,6 +23,8 @@ jobs:
2623

2724
- name: Set up Docker Buildx
2825
uses: docker/setup-buildx-action@v3
26+
with:
27+
driver-opts: network=host
2928

3029
- name: Extract metadata (tags, labels) for Docker
3130
id: meta
@@ -42,10 +41,10 @@ jobs:
4241

4342
- name: Test
4443
run: docker run --rm ${{ steps.meta.outputs.tags }} shapepipe_run -c /app/example/config.ini
45-
44+
4645
- name: Push
4746
uses: docker/build-push-action@v6
4847
with:
4948
push: true
5049
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
50+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 40 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,53 @@
1-
FROM python:3.12-slim-bookworm
1+
FROM images.canfar.net/skaha/astroml:latest
22

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"
66

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/*
5213

53-
# Install CDS client by hand
14+
# Build and install WeightWatcher from source
15+
ARG WW_VERSION=1.12
5416
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
6030

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
6235
RUN pip install --no-cache-dir --upgrade pip && \
6336
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
8940

41+
# Set working directory and copy source code
9042
WORKDIR /app
9143
COPY . /app/.
44+
RUN chown -R root:root /app && chmod -R u+rwX /app
9245

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]" && \
9548
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; \
10053
done

Dockerfile.jupyter

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Dockerfile for ShapePipe Jupyter Lab
2+
# Uses the shared base image
3+
4+
FROM ghcr.io/cosmostat/shapepipe:v2.0
5+
6+
# Default command starts Jupyter Lab
7+
ENTRYPOINT ["jupyter","lab","--ip=0.0.0.0","--port=8888","--no-browser","--allow-root"]

0 commit comments

Comments
 (0)