Skip to content

Commit

Permalink
removed unnescessary python modules in wps and added to training. fix…
Browse files Browse the repository at this point in the history
…ed training python netcdf libpaths
  • Loading branch information
jmills-ncar committed Jun 3, 2018
1 parent 18bf67e commit c62bd8a
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 824 deletions.
36 changes: 32 additions & 4 deletions training/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,45 @@ USER root

RUN rm -r /home/docker/runTimeScripts

#Get the entrypoint script to download the code release, jupyter, etc
#Get create_wrfinput.r
RUN mkdir /home/docker/wrf-hydro-training
RUN chmod -R 777 /home/docker/wrf-hydro-training
COPY ./create_wrfinput.R /home/docker/wrf-hydro-training/wrf_hydro_model_tools/create_wrfinput.R

#Get the entrypoint script to download the code release, start jupyter, etc
COPY ./entrypoint.sh /.
RUN chmod 777 /entrypoint.sh

############################
## Python
#Install modules
RUN conda install -y jupyterlab jupyter_contrib_nbextensions

#Get jupyter config
COPY ./jupyter_notebook_config.py /home/docker/.jupyter/
RUN chmod -R 777 /home/docker/.jupyter

# Copy in the domain
#COPY --from=domain /home/docker/domain/croton_NY /home/docker/domain/croton_NY
#RUN chmod -R 777 /home/docker/domain/
#Update nc-config with manually edited one to fix miniconda path bug
RUN rm /home/docker/miniconda3/bin/nc-config
COPY ./nc-config /home/docker/miniconda3/bin/nc-config
RUN chmod 777 /home/docker/miniconda3/bin/nc-config

############################
## R
#install R and libraries
RUN apt-get update \
&& apt-get install -yq --no-install-recommends \
r-base \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN wget http:https://cirrus.ucsd.edu/~pierce/ncdf/ncdf4_1.13.tar.gz \
&& R CMD INSTALL ncdf4_1.13.tar.gz --configure-args="--with-nc-config=/home/docker/miniconda3/bin/nc-config" \
&& rm ncdf4_1.13.tar.gz

RUN Rscript -e 'install.packages(c("optparse"), repos="https://cran.rstudio.com")'

############################

USER docker
WORKDIR /home/docker
Expand Down
20 changes: 14 additions & 6 deletions training/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash
mkdir /home/docker/wrf-hydro-training
chmod -R 777 /home/docker/wrf-hydro-training
echo -e "\e[4;49;34m WRF-Hydro Training Container\e[0m"

echo
Expand Down Expand Up @@ -35,17 +33,27 @@ rm *testcase*.tar.gz
mv /home/docker/example_case /home/docker/wrf-hydro-training/example_case
echo "Retrieved the test case for release: $version"

#echo
#echo -e "\e[0;49;32m-----------------------------------\e[0m"
#echo -e "\e[7;49;32mRetrieving WRF-Hydro model tools\e[0m"

#release=$(curl -s https://api.github.com/repos/NCAR/wrf_hydro_model_tools/releases/latest)
#version=$(echo "$release" | grep "tag_name" | cut -d : -f 2,3 | tr -d \")
#version=$(echo $version | tr "," " ")
#git clone --branch $version https://github.com/NCAR/wrf_hydro_model_tools
#mv /home/docker/wrf_hydro_model_tools /home/docker/wrf-hydro-training/wrf_hydro_model_tools

echo
echo -e "\e[0;49;32m-----------------------------------\e[0m"
echo -e "\e[7;49;32mTraining Jupyter notebook server running\e[0m"
echo -e "Training Jupyter notebook server running"
echo
echo "Open your browser to the following address to access notebooks"
echo "localhost:8888"
echo -e "\033[33;5;7mlocalhost:8888\033[0m"
echo
echo "The password to login is 'nwmtraining'"
echo -e "The password to login is:"
echo -e "\033[33;5;7mnwmtraining\033[0m"
echo
echo "Type ctrl-C then y to shut down container."
echo "NOTE ALL WORK WILL BE LOST UNLESS copied out of the container"

jupyter notebook --ip 0.0.0.0 --no-browser
jupyter notebook --ip 0.0.0.0 --no-browser &> /dev/null
172 changes: 0 additions & 172 deletions training/introDemo.sh

This file was deleted.

92 changes: 0 additions & 92 deletions training/plot_hydrograph.py

This file was deleted.

302 changes: 0 additions & 302 deletions training/walkthrough.html

This file was deleted.

Loading

0 comments on commit c62bd8a

Please sign in to comment.