-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile.j2
executable file
·134 lines (107 loc) · 3.46 KB
/
Dockerfile.j2
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
FROM {{ parent }}
LABEL MAINTAINER="Gabriel Brammer <gabriel.brammer@nbi.ku.dk>"
ARG PACKAGE_TIMEOUT=60
USER root
# Setup default timeout of installing packages
RUN echo "[global]" > /etc/pip.conf \
&& echo "timeout=$PACKAGE_TIMEOUT" >> /etc/pip.conf
# For opencv2 and basemap geos
RUN apt-get update \
&& apt-get install -yq --no-install-recommends \
# HDF5 and netCDF4 requirements
libhdf5-dev \
libhdf5-doc \
libnetcdf-dev \
libnetcdff-dev \
libnetcdff-doc \
libx11-6 \
libsm6 \
libxext6 \
libgeos-dev \
libglib2.0-0 \
libxrender1 \
libgl1-mesa-glx \
graphviz \
# Required by cartopy
libproj-dev \
proj-data \
proj-bin \
libgeos-dev \
# JWST etc
less \
gfortran \
# Used in Datf exercises
fonts-humor-sans \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
USER $NB_UID
RUN mamba config --set remote_read_timeout_secs $PACKAGE_TIMEOUT
# Proj4 is required for cartopy
COPY environment.yml /tmp/
RUN mamba env update -n python3 -f environment.yml \
&& mamba clean --all -f -y \
&& fix-permissions $CONDA_DIR \
&& fix-permissions /home/$NB_USER
# Install packages for python3 envs
COPY requirements.txt /tmp/
RUN mamba run -n python3 pip install -r requirements.txt
#################
# Grizli
RUN git clone https://github.com/gbrammer/grizli.git
WORKDIR /tmp/grizli
RUN git checkout tags/1.7
RUN mamba env update -n python3 -f environment.yml \
&& mamba clean --all -f -y \
&& fix-permissions $CONDA_DIR \
&& fix-permissions /home/$NB_USER
WORKDIR /tmp/
# Eazy-py
RUN mamba run -n python3 pip install mpdaf
RUN git clone https://github.com/gbrammer/eazy-py.git
WORKDIR /tmp/eazy-py
RUN mamba run -n python3 pip install . -r requirements.txt
WORKDIR /tmp/
# Conda install hstcal
RUN mamba config --add channels http://ssb.stsci.edu/astroconda
RUN mamba config --add channels conda-forge
RUN mamba install -n python3 hstcal \
&& mamba clean --all -f -y \
&& fix-permissions $CONDA_DIR \
&& fix-permissions /home/$NB_USER
# Patch for photutils / drizzlepac
COPY photutils.patch /tmp/
RUN mamba run -n python3 pip install drizzlepac photutils --upgrade \
&& mamba clean --all -f -y \
&& fix-permissions $CONDA_DIR \
&& fix-permissions /home/$NB_USER
RUN mamba run -n python3 python /tmp/photutils.patch \
&& mamba clean --all -f -y \
&& fix-permissions $CONDA_DIR \
&& fix-permissions /home/$NB_USER
# JWST tools
RUN mamba run -n python3 pip install jwst-backgrounds
RUN mamba run -n python3 pip install jwst-gtvt
RUN mamba run -n python3 pip install jdaviz
RUN mamba run -n python3 pip install pandeia.engine
# MIRAGE
RUN mamba run -n python3 pip install mirage grismconf nircam_gsim
WORKDIR "${HOME}"
# FSPS
RUN git clone https://github.com/cconroy20/fsps.git fsps_home
RUN cd fsps_home/src && make
ENV SPS_HOME /home/${NB_USER}/fsps_home
# Compile python-fsps
# Padova + lores BASEL models much faster
RUN FFLAGS="-DMIST=0 -DPADOVA=1 -DMILES=0 -DBASEL=1" mamba run -n python3 pip install fsps --no-binary fsps
# Environment variables
ENV JWST_DATA /home/${NB_USER}/work/JWST/Simulations/MirageGabe
ENV CRDS_SERVER_URL https://jwst-crds.stsci.edu
ENV CRDS_PATH /home/${NB_USER}/crds_cache
ENV MIRAGE_DATA ${JWST_DATA}/MIRAGE_DATA
ENV WEBBPSF_PATH ${JWST_DATA}/webbpsf-data
ENV GRIZLI /home/${NB_USER}/work/DAWN/Science/JWST/Software
ENV iref ${GRIZLI}/iref/
ENV jref ${GRIZLI}/jref/
# Run container as
USER $NB_UID