Unverified Commit 961948b6 authored by Akke Viitanen's avatar Akke Viitanen
Browse files

add dockerfile

parent a9fa5d44
Loading
Loading
Loading
Loading
Loading

etc/docker/Dockerfile

0 → 100644
+79 −0
Original line number Diff line number Diff line
# Start from the latest release LSST stack image.
FROM lsstsqre/centos:7-stack-lsst_distrib-w_latest

# Information about image.
ARG BUILD_DATE
LABEL lsst-desc.imsim.maintainer="https://github.com/LSSTDESC/imSim"
LABEL lsst-desc.imsim.description="A Docker image combining the LSST Science Pipelines software stack and imSim (and its dependencies)."
LABEL lsst-desc.imsim.version="latest"
LABEL lsst-desc.imsim.build_date=$BUILD_DATE

WORKDIR /home/lsst

# Clone imSim and rubin_sim repos.
RUN git clone https://github.com/LSSTDESC/imSim.git &&\
    git clone https://github.com/lsst/rubin_sim.git

# Pull out conda requirements for imSim (excluding stackvana)
RUN sed '/stackvana/d' imSim/etc/standalone_conda_requirements.txt > imSim/etc/docker_conda_requirements.txt

# 1) Install imSim Conda requirements
# 2) Install imSim pip requirements
# 3) Install rubin_sim
# 4) Install imSim
RUN source /opt/lsst/software/stack/loadLSST.bash &&\
    setup lsst_distrib &&\
    mamba install -y --file imSim/etc/docker_conda_requirements.txt &&\
    python3 -m pip install batoid skyCatalogs==1.6.0-rc2 gitpython &&\
    python3 -m pip install rubin_sim/ &&\
    python3 -m pip install imSim/

WORKDIR /opt/lsst/software/stack

# Download Rubin Sim data.
RUN mkdir -p rubin_sim_data/sims_sed_library
RUN curl --retry 5 --retry-delay 5 --retry-all-errors -C - https://s3df.slac.stanford.edu/groups/rubin/static/sim-data/rubin_sim_data/skybrightness_may_2021.tgz | tar -C rubin_sim_data -xz
RUN curl --retry 5 --retry-delay 5 --retry-all-errors -C - https://s3df.slac.stanford.edu/groups/rubin/static/sim-data/rubin_sim_data/throughputs_aug_2021.tgz | tar -C rubin_sim_data -xz
RUN curl --retry 5 --retry-delay 5 --retry-all-errors -C - https://s3df.slac.stanford.edu/groups/rubin/static/sim-data/sed_library/seds_170124.tar.gz  | tar -C rubin_sim_data/sims_sed_library -xz

# Set location of Rubin sim data (downloaded in step above).
ENV RUBIN_SIM_DATA_DIR=/opt/lsst/software/stack/rubin_sim_data

# Set location of SED library (downloaded in step above).
ENV SIMS_SED_LIBRARY_DIR=/opt/lsst/software/stack/rubin_sim_data/sims_sed_library

WORKDIR /home/lsst

# Make a script to activate the LSST stack
RUN echo "source /opt/lsst/software/stack/loadLSST.bash" >> .bashrc && \
    echo "setup lsst_distrib" >> .bashrc

###############################################################################
# AV install AGILE

# install EGG
USER root
RUN yum install --allowerasing -y bzip2 cmake curl gcc g++ wget zlib-devel
RUN yum autoremove
RUN git clone https://github.com/cschreib/egg.git /opt/egg
WORKDIR /opt/egg
RUN sed 's?INSTALL_ROOT_DIR=.*?INSTALL_ROOT_DIR=/opt/egg?g' doc/scripts/install.sh | \
    sed 's?EGG_DIR=.*?EGG_DIR=/opt/egg?g' | \
    sed 's?cd cfitsio?cd cfitsio*?g' | \
    sed 's?http:?https:?g' > doc/scripts/custom_install.sh; \
    LDFLAGS="-lz -lm" bash doc/scripts/custom_install.sh
USER lsst
WORKDIR /home/lsst
RUN echo 'export PATH=$PATH:/opt/egg/bin' >> .bashrc

# install AGILE
RUN git clone -b angela_install https://www.ict.inaf.it/gitlab/akke.viitanen/lsst_inaf_agile.git /home/lsst/lsst_inaf_agile
WORKDIR /home/lsst/lsst_inaf_agile
RUN python3 -m pip install . && \
    git clone 'https://github.com/lsst/throughputs.git' data/egg/share/filter-db/inaf/throughputs && \
    python3 src/scripts/create_lsst_filters.py

# Download baselines
RUN wget --directory-prefix=data/baseline 'https://usdf-maf.slac.stanford.edu/sims_featureScheduler_runs4.0/baseline/baseline_v4.0_10yrs.db'

WORKDIR /home/lsst