|
1 |
| -# Build as jupyterhub/singleuser |
2 |
| -# Run with the DockerSpawner in JupyterHub |
| 1 | +FROM castrona/hydroshare-jupyterhub:latest |
| 2 | +MAINTAINER Tony Castronova <acastronova@cuahsi.org> |
3 | 3 |
|
4 |
| -# Minimal Jupyter Notebook Stack comes with: |
5 |
| -# Jupyter Notebook 4.2.x |
6 |
| -# Conda Python 3.x |
7 |
| -# No preinstalled scientific computing packages |
8 |
| -# Unprivileged user jovyan (uid=1000, configurable, see options) in group users (gid=100) with ownership over /home/jovyan and /opt/conda |
9 |
| -# tini as the container entrypoint and start-notebook.sh as the default command |
10 |
| -# A start-singleuser.sh script for use as an alternate command that runs a single-user instance of the Notebook server, as required by JupyterHub |
11 |
| -# Options for HTTPS, password auth, and passwordless sudo |
| 4 | +###################################################### |
| 5 | +### Begin - JupyterHub Development Image Additions ### |
| 6 | +###################################################### |
12 | 7 |
|
13 | 8 |
|
14 |
| -FROM jupyter/scipy-notebook |
15 |
| - |
16 |
| -MAINTAINER Tony Castronova <tony.castronova@usu.edu> |
17 |
| - |
18 |
| -EXPOSE 8888 |
19 |
| - |
20 |
| -USER root |
21 |
| - |
22 |
| -############################ |
23 |
| -# INSTALL SYSTEM LIBRARIES # |
24 |
| -############################ |
25 |
| - |
26 |
| -# libgeos-dev RHESYSS dependency |
27 |
| -# mpic++ TAUDEM dependency |
28 |
| -# libgdal-dev TAUDEM dependency |
29 |
| -# libproj-dev TAUDEM dependency |
30 |
| -RUN apt-get clean && apt-get update --fix-missing |
31 |
| - |
32 |
| -RUN apt-get install -y libgeos-dev mpic++ libproj-dev |
33 |
| - |
34 |
| -# install irods fuse |
35 |
| -RUN apt-get install -y fuse libfuse2 libfuse-dev |
36 |
| -RUN wget -q ftp://ftp.renci.org/pub/irods/releases/4.1.8/ubuntu12/irods-icommands-4.1.8-ubuntu12-x86_64.deb -O /tmp/irods-icommands-4.1.8-ubuntu12-x86_64.deb |
37 |
| -RUN dpkg -i /tmp/irods-icommands-4.1.8-ubuntu12-x86_64.deb |
38 |
| -RUN groupadd fuse && usermod -aG fuse jovyan |
39 |
| -RUN chmod g+rw /dev/fuse && chgrp fuse /dev/fuse |
40 |
| - |
41 |
| -# install rhessys workflows |
42 |
| -RUN apt-get install -y build-essential git subversion p7zip-full python python-dev python-pip python-scipy libxml2-dev libxslt-dev libgdal-dev libgdal-doc gdal-bin python-gdal grass grass-dev libbsd-dev vlc |
43 |
| - |
44 |
| -# create directories |
45 |
| -RUN mkdir /home/jovyan/libs && chown -R jovyan:users /home/jovyan/libs |
46 |
| -RUN mkdir /home/jovyan/work/notebooks && chown -R jovyan:users /home/jovyan/work/notebooks |
47 |
| -#RUN mkdir /home/jovyan/grassdata && chown -R jovyan:users /home/jovyan/grassdata |
48 |
| - |
49 |
| -############################### |
50 |
| -# SETUP JUPYTERHUB ENTRYPOINT # |
51 |
| -############################### |
52 |
| - |
53 |
| -# fetch juptyerhub-singleuser entrypoint |
54 |
| -RUN wget -q https://raw.githubusercontent.com/jupyterhub/jupyterhub/master/scripts/jupyterhub-singleuser -O /usr/local/bin/jupyterhub-singleuser && \ |
55 |
| - chmod 755 /usr/local/bin/jupyterhub-singleuser |
56 |
| -ADD singleuser.sh /srv/singleuser/singleuser.sh |
57 |
| - |
58 |
| -# add grass create location script |
59 |
| -#RUN chmod 755 /home/jovyan/libs/create_grass_loc.sh && chown jovyan:users /home/jovyan/libs/create_grass_loc.sh |
60 |
| - |
61 |
| -# fetch the ecohydro config file |
62 |
| -ADD https://raw.githubusercontent.com/selimnairb/RHESSysWorkflows/master/docs/config/ecohydro-Linux.cfg /home/jovyan/.ecohydro.cfg |
63 |
| -RUN chown jovyan:users /home/jovyan/.ecohydro.cfg |
64 |
| - |
65 |
| -################## |
66 |
| -# PREPARE TAUDEM # |
67 |
| -################## |
68 |
| - |
69 |
| -# install taudem (must happend before rhesyss b/c of gdal conflicts) |
70 |
| -RUN git clone https://github.com/dtarb/TauDEM.git ../libs/TauDEM && \ |
71 |
| -cd ../libs/TauDEM/src && make |
72 |
| - |
73 |
| -# link conda python2 (used by jupyterhub) to python22 |
74 |
| -RUN ln -s /opt/conda/envs/python2/bin/python2 /usr/bin/python22 |
75 |
| - |
76 |
| -# prepare grass |
77 |
| -#ADD create_grass_loc.sh /home/jovyan/libs/create_grass_loc.sh |
78 |
| -#RUN chown jovyan:users /home/jovyan/libs/create_grass_loc.sh && \ |
79 |
| -#chmod +x /home/jovyan/libs/create_grass_loc.sh |
80 |
| - |
81 |
| -######################### |
82 |
| -# SWITCH TO JOVYAN USER # |
83 |
| -######################### |
84 |
| -USER jovyan |
85 |
| - |
86 |
| -# load the rhessys configuration file |
87 |
| -RUN sed -i -e 's|^ETC.*|ETC = /home/jovyan/libs/RHESSysWorkflows/etc|g' /home/jovyan/.ecohydro.cfg &&\ |
88 |
| -sed -i -e 's|^MODULE_PATH.*|MODULE_PATH = /home/jovyan/work/notebooks/.grass6/addons|g' /home/jovyan/.ecohydro.cfg &&\ |
89 |
| -sed -i -e 's|^MODULE_ETC.*|MODULE_ETC = /home/jovyan/libs/RHESSysWorkflows/etc/r.soils.texture|g' /home/jovyan/.ecohydro.cfg |
90 |
| - |
91 |
| -# prepare python environments |
92 |
| -RUN pip install --upgrade pip |
93 |
| - |
94 |
| -# install ecohydrolib |
95 |
| -RUN git clone https://github.com/leonard-psu/EcohydroLib.git ../libs/EcohydroLib |
96 |
| -RUN /bin/bash -c "source /opt/conda/bin/activate python2 \ |
97 |
| -&& cd ../libs/EcohydroLib \ |
98 |
| -&& python setup.py install " |
99 |
| - |
100 |
| -# install RHESSysWorkflows |
101 |
| -RUN git clone https://github.com/leonard-psu/RHESSysWorkflows.git ../libs/RHESSysWorkflows |
102 |
| -RUN /bin/bash -c "source /opt/conda/bin/activate python2 \ |
103 |
| -&& cd ../libs/RHESSysWorkflows \ |
104 |
| -&& python setup.py install" |
105 |
| - |
106 |
| -RUN /bin/bash -c "source /opt/conda/bin/activate python2 \ |
107 |
| -&& pip install --upgrade pip \ |
108 |
| -&& pip install wget " |
109 |
| - |
110 |
| -############################### |
111 |
| -# PREPARE PYTHON ENVIRONMENTS # |
112 |
| -############################### |
113 |
| - |
114 |
| -# Python 3 |
115 |
| -RUN conda install -y -n root \ |
116 |
| -gdal \ |
117 |
| -basemap \ |
118 |
| -landlab -c landlab |
119 |
| - |
120 |
| -RUN git clone -b 2_and_3 https://github.com/hydroshare/hs_restclient.git ../libs/hs_restclient |
121 |
| -RUN /bin/bash -c "source /opt/conda/bin/activate root \ |
122 |
| -&& cd ../libs/hs_restclient \ |
123 |
| -&& python setup.py install " |
124 |
| - |
125 |
| -# Python 2 |
126 |
| -# install gdal into python2 conda env |
127 |
| -RUN conda install -y -n python2 \ |
128 |
| -gdal \ |
129 |
| -basemap \ |
130 |
| -landlab -c landlab |
131 |
| - |
132 |
| -###################### |
133 |
| -# SET PATH VARIABLES # |
134 |
| -###################### |
135 |
| - |
136 |
| -ENV PATH=/opt/conda/envs/python2/bin:/home/jovyan/libs/TauDEM:$PATH PYTHONPATH=/home/jovyan/work/notebooks/utilities:$PYTHONPATH DOCUMENTS=/home/jovyan/work/notebooks/documents DATA=/home/jovyan/work/notebooks/data HOME=/home/jovyan/work/notebooks ECOHYDROLIB_CFG=/home/jovyan/.ecohydro.cfg LD_LIBRARY_PATH=/usr/lib/grass64/lib |
137 |
| - |
138 |
| -#RUN /bin/bash -c "source /opt/conda/bin/activate python2" && \ |
139 |
| -#pip install --upgrade hs_restclient |
140 |
| - |
141 |
| -# install odm2api, then upgrade it to renamevalueobjects branch |
142 |
| -RUN conda install -y -n python2 -c odm2 odm2api |
143 |
| -RUN /bin/bash -c "source /opt/conda/bin/activate python2 \ |
144 |
| -&& pip install --upgrade --process-dependency-links git+https://github.com/ODM2/ODM2PythonAPI.git@renamevalueobjects" |
145 |
| - |
146 |
| -# prepare grass environment |
147 |
| -#RUN mkdir notebooks |
148 |
| -#ADD create_grass_loc.sh /home/jovyan/libs/create_grass_loc.sh |
149 |
| -ADD rhessys_wf.py /home/jovyan/libs/rhessys_wf.py |
150 |
| -ADD run.py /home/jovyan/libs/run.py |
| 9 | +################################################### |
| 10 | +## End - JupyterHub Development Image Additions ### |
| 11 | +################################################### |
151 | 12 |
|
152 | 13 | CMD ["sh", "/srv/singleuser/singleuser.sh"]
|
153 | 14 |
|
|
0 commit comments