-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
163 lines (147 loc) · 5.13 KB
/
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
# syntax=docker/dockerfile:1
# cross-platform, cpu-only dockerfile for demoing MWA software stack
# on amd64, arm64
# ref: https://docs.docker.com/build/building/multi-platform/
FROM mwatelescope/hyperdrive:birli0.14 AS base
# Suppress perl locale errors
ENV LC_ALL=C
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
casacore-data \
casacore-dev \
clang \
cmake \
curl \
ffmpeg \
g++ \
jq \
lcov \
libatlas3-base \
libblas-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
liberfa-dev \
libexpat1-dev \
libfftw3-dev \
libfontconfig-dev \
libfreetype-dev \
libgsl-dev \
libhdf5-dev \
liblapack-dev \
liblua5.3-dev \
libpng-dev \
libssl-dev \
libxml2-dev \
pkg-config \
procps \
tzdata \
unzip \
vim \
wget \
wcslib-dev \
libboost-python-dev \
zip \
&& \
apt-get clean all && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
apt-get -y autoremove
# install giant-squid
RUN cargo install mwa_giant_squid --locked && \
rm -rf ${CARGO_HOME}/registry /opt/cargo/git/checkouts/
# for example, CMAKE_ARGS="-D CMAKE_CXX_FLAGS='-march=native -mtune=native -O3 -fomit-frame-pointer'"
ARG CMAKE_ARGS="-DPORTABLE=True"
ARG EVERYBEAM_BRANCH=v0.6.1
RUN git clone --depth 1 --branch=${EVERYBEAM_BRANCH} --recurse-submodules https://git.astron.nl/RD/EveryBeam.git /EveryBeam && \
cd /EveryBeam && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
cmake $CMAKE_ARGS .. && \
make install -j`nproc` && \
cd / && \
rm -rf /EveryBeam
ARG IDG_BRANCH=1.2.0
RUN git clone --depth 1 --branch=${IDG_BRANCH} https://git.astron.nl/RD/idg.git /idg && \
cd /idg && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
cmake $CMAKE_ARGS .. && \
make install -j`nproc` && \
cd / && \
rm -rf /idg
# can't get wsclean2.X to compile on arm64 :(
# ARG WSCLEAN_BRANCH=wsclean2.9
ARG WSCLEAN_BRANCH=v3.5
RUN git clone --depth 1 --branch=${WSCLEAN_BRANCH} https://gitlab.com/aroffringa/wsclean.git /wsclean && \
cd /wsclean && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
cmake $CMAKE_ARGS .. && \
make install -j`nproc` && \
cd / && \
rm -rf /wsclean
# install python prerequisites
RUN python -m pip install --no-cache-dir --force-reinstall \
'pyvo>=1.5.2' \
'psutil>=6.0.0' \
'docstring_parser>=0.15' \
'astropy>=6.0' \
'h5py>=3.4' \
'numpy>=1.23' \
'pyerfa>=2.0.1.1' \
'pyyaml>=5.4.1' \
'scipy>=1.8' \
'setuptools_scm>=8.1' \
'pyuvdata[casa]>=3.1.1' \
'pandas>=2.2.3' \
'python-casacore>=3.5.2' \
git+https://github.com/mwilensky768/SSINS.git \
git+https://github.com/d3v-null/mwa_qa.git@dev \
git+https://github.com/PaulHancock/Aegean.git \
git+https://github.com/tjgalvin/fits_warp.git
# # download latest Leap_Second.dat, IERS finals2000A.all
RUN python -c "from astropy.time import Time; t=Time.now(); from astropy.utils.data import download_file; download_file('http://data.astropy.org/coordinates/sites.json', cache=True); print(t.gps, t.ut1)"
# FROM mwatelescope/giant-squid:latest AS giant_squid
# RUN /opt/cargo/bin/giant-squid --version
# # HACK: the calibration fitting code in mwax_mover deserves its own public repo
FROM d3vnull0/mwax_mover:latest AS mwax_mover
FROM base
# # Copy files from the previous stages into the final image
COPY --from=mwax_mover /app /mwax_mover
# copy giant squid binary from its own image
# COPY --from=giant_squid /opt/cargo/bin/giant-squid /opt/cargo/bin/giant-squid
# RUN /opt/cargo/bin/giant-squid --version
RUN cd /mwax_mover && \
chmod +x /mwax_mover/scripts/*.py && \
python -m pip install .
ENV PATH="/mwax_mover/scripts/:${PATH}"
# # python /mwax_mover/scripts/cal_analysis.py \
# # --name "${name}" \
# # --metafits "${metafits}" --solns ${soln} \
# # --phase-diff-path=/mwax_mover/phase_diff.txt \
# # --plot-residual --residual-vmax=0.5
# # export metafits=${outdir}/${obsid}/raw/${obsid}.metafits
# # export raw="$(ls -1 ${outdir}/${obsid}/raw/${obsid}*.fits)"
# # export soln=${outdir}/${obsid}/cal/hyp_soln_${obsid}.fits
# # docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} --entrypoint python mwatelescope/mwa-demo:latest /mwax_mover/scripts/cal_analysis.py --name foo --metafits ${metafits} --solns ${soln} --phase-diff-path=/mwax_mover/phase_diff.txt --plot-residual --residual-vmax=0.5
# # docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} --entrypoint python d3vnull0/mwax_mover:latest /app/scripts/cal_analysis.py --name foo --metafits ${metafits} --solns ${soln} --phase-diff-path=/app/phase_diff.txt --plot-residual --residual-vmax=0.5
# Copy the demo files
COPY ./demo /demo
ENV PATH="/demo:${PATH}"
WORKDIR /demo
# RUN <<EOF
# #!/usr/bin/env python
# import sys
# from sys import implementation, stdout
# print( f"{implementation=}", file=stdout)
# EOF
ARG TEST_SHIM=""
RUN ${TEST_SHIM}
ENTRYPOINT /bin/bash