Skip to content

Commit

Permalink
version edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jmills-ncar committed Jun 13, 2018
1 parent 17c72a1 commit 5f52fb8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
1 change: 1 addition & 0 deletions training/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ RUN chmod 777 gdrive_download.py
RUN mkdir /home/docker/wrf-hydro-training/regridding/data/ \
&& python gdrive_download.py --file_id 1PrDTA-hMFNqQrDag1Dm7tX1rT1gQ_25e --dest_file /home/docker/wrf-hydro-training/regridding/data/nldas_forcing.tar.gz

RUN rm gdrive_download.py
# install NCL
RUN wget https://www.earthsystemgrid.org/dataset/ncl.640.dap/file/ncl_ncarg-6.4.0-Debian8.6_64bit_gnu492.tar.gz \
&& mkdir /usr/local/ncl-6.4.0 \
Expand Down
9 changes: 5 additions & 4 deletions training/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,21 @@ Make sure you have Docker installed and that it can access your localhost ports.

**Step 2: Pull the wrfhydro/training Docker container for the desired code version**
Each training container is specific to a release version of the WRF-Hydro source code, which can be found at https://github.com/NCAR/wrf_hydro_nwm_public/releases.
Issue the following command in your terminal to pull a specific version of the training corresponding to your code release version. In this example, we will pull the training container for v5.0.0.
Issue the following command in your terminal to pull a specific version of the training
corresponding to your code release version. In this example, we will pull the training container for v5.0.x.

`docker pull wrfhydro/training:v5.0.0`
`docker pull wrfhydro/training:v5.0.x`

**Step 3: Start the training Docker container**
Issue the following command in your terminal session to start the training Docker container.
`docker run --name wrf-hydro-training -p 8888:8888 -it wrfhydro/training`
`docker run --name wrf-hydro-training -p 8888:8888 -it wrfhydro/training:v5.0.x`

**Note: Port forwarding is setup with the -p 8888:8888 argument, which maps your localhost port to
the container port. If you already have something running on port 8888 on your localhost you will
need to change this number**

The container will start and perform a number of actions before starting the training.
* First, the container will pull the model code corresponding to the specified major version, in this case v5.0.0
* First, the container will pull the model code corresponding to the specified major version, in this case v5.0.x
* Second, the container will pull an example test case compatible with the model code release.
* Third, the container will pull the training lessons corresponding to the psecified major version.
* Fourth, the container will launch a Jupyter Notebook server and echo the address to your terminal.
Expand Down
2 changes: 1 addition & 1 deletion training/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


docker build "$@" -t wrfhydro/training:v5.0.0 .
docker build "$@" -t wrfhydro/training:v5.0.x .

exit $?
26 changes: 19 additions & 7 deletions training/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/bin/bash

###Change the version here
version=v5.0.0
###########################


###########################
###No need to edit below here
echo -e "\e[4;49;34m WRF-Hydro Training Container\e[0m"

echo
echo -e "\e[0;49;32m-----------------------------------\e[0m"
echo -e "\e[7;49;32mRetrieving latest community model code release\e[0m"

release=$(curl -s https://api.github.com/repos/NCAR/wrf_hydro_nwm_public/releases/latest)
version=$(echo "$release" | grep "tag_name" | cut -d : -f 2,3 | tr -d \")
version=$(echo $version | tr "," " ")
release=$(curl -s https://api.github.com/repos/NCAR/wrf_hydro_nwm_public/releases/tags/$version)
#version=$(echo "$release" | grep "tag_name" | cut -d : -f 2,3 | tr -d \")
#version=$(echo $version | tr "," " ")

#assetURL=$(echo "$release" | grep "browser_download_url" | cut -d : -f 2,3 | tr -d \")
#echo "$assetURL" | wget -qi -
#tar -xf wrf_hydro_nwm_public-*.tar.gz
Expand All @@ -31,19 +40,22 @@ tar -xf *testcase*.tar.gz
rm *testcase*.tar.gz
#chmod -R 777 ~/example_case
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 training\e[0m"

release=$(curl -s https://api.github.com/repos/NCAR/wrf_hydro_training/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_training
#release=$(curl -s https://api.github.com/repos/NCAR/wrf_hydro_training/releases/latest)
#version=$(echo "$release" | grep "tag_name" | cut -d : -f 2,3 | tr -d \")
#version=$(echo $version | tr "," " ")

git clone --branch ${version: 0:4}.x https://github.com/NCAR/wrf_hydro_training
#git clone https://github.com/NCAR/wrf_hydro_training
mv /home/docker/wrf_hydro_training/lessons /home/docker/wrf-hydro-training/lessons
rm -rf /home/docker/wrf_hydro_training/
echo "Retrieved the following training: ${version: 0:4}.x"

echo
echo -e "\e[0;49;32m-----------------------------------\e[0m"
Expand Down
1 change: 1 addition & 0 deletions wps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ RUN python gdrive_download.py --file_id 1EICBJ8-pRpkox27Bnq3mrBAqyZQsV662 --dest
&& rm geog_conus.tar.gz

RUN chmod -R 777 /home/docker/WRF_WPS/utilities/geog_conus
RUN rm gdrive_download.py

#COPY geog_conus.tar.gz .
#RUN tar -xf geog_conus.tar.gz && \
Expand Down

0 comments on commit 5f52fb8

Please sign in to comment.