Skip to content

Commit

Permalink
dockerfile part 4
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Sep 25, 2024
1 parent 7c405f1 commit 824f867
Showing 1 changed file with 40 additions and 65 deletions.
105 changes: 40 additions & 65 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ RUN apt-get update && \
cython3 \
fontconfig \
g++ \
git \
ipython3 \
jq \
lcov \
Expand Down Expand Up @@ -167,72 +166,48 @@ RUN git clone --depth 1 --branch=${AOFLAGGER_BRANCH} --recurse-submodules https:
# set up aoflagger python library
ENV PYTHONPATH="/usr/local/lib/:$PYTHONPATH"

ARG BIRLI_GIT=https://github.com/MWATelescope/Birli.git
ARG BIRLI_BRANCH=main
RUN cargo install birli --locked --git=${BIRLI_GIT} --branch=${BIRLI_BRANCH} && \
rm -rf ${CARGO_HOME}/registry /opt/cargo/git/checkouts/

ARG HYPERBEAM_GIT=https://github.com/MWATelescope/mwa_hyperbeam.git
ARG HYPERBEAM_BRANCH=marlu0.14
ARG HYPERBEAM_FEATURES=python
# This won't install the python library:
# RUN cargo install mwa_hyperbeam --locked --git=${HYPERBEAM_GIT} --branch=${HYPERBEAM_BRANCH} --features=${HYPERBEAM_FEATURES} && \
# ARG BIRLI_GIT=https://github.com/MWATelescope/Birli.git
# ARG BIRLI_BRANCH=main
# RUN cargo install birli --locked --git=${BIRLI_GIT} --branch=${BIRLI_BRANCH} && \
# rm -rf ${CARGO_HOME}/registry /opt/cargo/git/checkouts/
RUN git clone --depth 1 --branch=${HYPERBEAM_BRANCH} ${HYPERBEAM_GIT} /hyperbeam && \
cd /hyperbeam && \
maturin build --locked --release --features=${HYPERBEAM_FEATURES} && \
python -m pip install $(ls -1 target/wheels/*.whl | tail -n 1) && \
cd / && \
rm -rf /hyperbeam ${CARGO_HOME}/registry

ARG HYPERDRIVE_GIT=https://github.com/MWATelescope/mwa_hyperdrive.git
# # HACK: birli0.14 needs newer ndarray
# ARG HYPERDRIVE_BRANCH=main
ARG HYPERDRIVE_BRANCH=birli0.14
# TODO: ARG HYPERDRIVE_FEATURES= ... --features=${HYPERDRIVE_FEATURES}
RUN cargo install mwa_hyperdrive --locked --git=${HYPERDRIVE_GIT} --branch=${HYPERDRIVE_BRANCH} && \
rm -rf ${CARGO_HOME}/registry /opt/cargo/git/checkouts/

# # HACK: beam_fits deserves its own feature branch
# ARG HYPERDRIVE_BRANCH=marlu0.13
# RUN git clone --depth 1 --branch=${HYPERDRIVE_BRANCH} https://github.com/MWATelescope/mwa_hyperdrive.git /hyperdrive && \
# cd /hyperdrive && \
# # mkdir -p src/hacks && \
# # wget -Osrc/hacks/beam_fits.rs https://raw.githubusercontent.com/MWATelescope/mwa_hyperdrive/refs/heads/SDC3/src/hacks/beam_fits.rs && \
# # wget -Osrc/hacks/mod.rs https://raw.githubusercontent.com/MWATelescope/mwa_hyperdrive/refs/heads/SDC3/src/hacks/mod.rs && \
# # sed -i '/mod cli;/a pub mod hacks;' src/lib.rs && \
# # cat src/lib.rs && \
# # wget -Osrc/cli/mod.rs https://raw.githubusercontent.com/MWATelescope/mwa_hyperdrive/refs/heads/SDC3/src/cli/mod.rs && \
# cargo install --path . --locked && \

# ARG HYPERBEAM_GIT=https://github.com/MWATelescope/mwa_hyperbeam.git
# ARG HYPERBEAM_BRANCH=marlu0.14
# ARG HYPERBEAM_FEATURES=python
# # This won't install the python library:
# # RUN cargo install mwa_hyperbeam --locked --git=${HYPERBEAM_GIT} --branch=${HYPERBEAM_BRANCH} --features=${HYPERBEAM_FEATURES} && \
# # rm -rf ${CARGO_HOME}/registry /opt/cargo/git/checkouts/
# RUN git clone --depth 1 --branch=${HYPERBEAM_BRANCH} ${HYPERBEAM_GIT} /hyperbeam && \
# cd /hyperbeam && \
# maturin build --locked --release --features=${HYPERBEAM_FEATURES} && \
# python -m pip install $(ls -1 target/wheels/*.whl | tail -n 1) && \
# cd / && \
# rm -rf /hyperdrive ${CARGO_HOME}/registry

# # 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)"

# # finufft
# # RUN git clone https://github.com/flatironinstitute/finufft.git /finufft && \
# # cd /finufft && \
# # mkdir build && \
# # cd build && \
# # cmake $CMAKE_ARGS \
# # -DENABLE_GUI=OFF \
# # .. && \
# # make install -j`nproc`

# Copy the demo files
COPY ./demo /demo
ENV PATH="/demo:${PATH}"
WORKDIR /demo

# 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 mwax_mover stage into the final image
COPY --from=mwax_mover /app /mwax_mover

RUN cd /mwax_mover && \
python -m pip install .
# rm -rf /hyperbeam ${CARGO_HOME}/registry

# ARG HYPERDRIVE_GIT=https://github.com/MWATelescope/mwa_hyperdrive.git
# # # HACK: birli0.14 needs newer ndarray
# # ARG HYPERDRIVE_BRANCH=main
# ARG HYPERDRIVE_BRANCH=birli0.14
# # TODO: ARG HYPERDRIVE_FEATURES= ... --features=${HYPERDRIVE_FEATURES}
# RUN cargo install mwa_hyperdrive --locked --git=${HYPERDRIVE_GIT} --branch=${HYPERDRIVE_BRANCH} && \
# rm -rf ${CARGO_HOME}/registry /opt/cargo/git/checkouts/

# # # 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)"

# # Copy the demo files
# COPY ./demo /demo
# ENV PATH="/demo:${PATH}"
# WORKDIR /demo

# # 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 mwax_mover stage into the final image
# COPY --from=mwax_mover /app /mwax_mover

# RUN cd /mwax_mover && \
# python -m pip install .

# # python /mwax_mover/scripts/cal_analysis.py \
# # --name "${name}" \
Expand Down

0 comments on commit 824f867

Please sign in to comment.