Skip to content

Commit 6a49378

Browse files
committed
Updating to run with WRF-Hydro v5.4.0 release and new Docker images
List of changes - Training updated and working, supplemental still broken from packages they use - Github CI added to run run_training_notebooks.sh, which builds all non-supplemental trainings - Github CI has cron job to run every Monday morning - Pull Request Template Added
1 parent 19ce5ff commit 6a49378

16 files changed

+22449
-740
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
TYPE: choose one of [bugfix, fix, enhancement, feature, text only]
2+
3+
KEYWORDS: approximately 3 to 6 words related to your commit
4+
5+
SOURCE: Developer's name and affiliation
6+
7+
DESCRIPTION OF CHANGES: One or more paragraphs describing problem, solution, and required changes.
8+
9+
ISSUE: The GitHub Issue that this PR addresses. For example `Fixes ISSUE #123`
10+
11+
TESTS CONDUCTED: Explicitly state if regression, integration, or unit tests were run before submitting.
12+
13+
NOTES: Optional, as appropriate. Delete if not used.
14+
15+
<!--
16+
ITEMS THAT MIGHT BE USEFUL TO CONSIDER
17+
- Closes issue #xxxx
18+
- Tests added (unit tests and/or regression/integration tests)
19+
- Backwards compatible
20+
- Documentation included
21+
--->

.github/workflows/training-ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: training
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '0 2 * * 1' # Every Monday at 2 AM UTC
10+
11+
jobs:
12+
docker-build:
13+
name: Test training notebooks
14+
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
21+
- name: Pull wrfhydro/training image
22+
run: docker pull wrfhydro/training
23+
24+
- name: Run notebook tests inside container
25+
run: |
26+
docker run --rm \
27+
-v ${{ github.workspace }}:/workspace \
28+
-w /workspace \
29+
-e CI_TESTING=true \
30+
wrfhydro/training

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
.Rhistory
44
*.Rproj
55
*.DS_Store
6+
.ipynb_checkpoints/
67
dockerImages/
78
data/

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# WRF-Hydro <img src="https://ral.ucar.edu/sites/default/files/public/wrf_hydro_symbol_logo_2017_09_150pxby63px.png" width=100 align="left" />
1+
# WRF-Hydro® <img src="https://ral.ucar.edu/sites/default/files/public/wrf_hydro_symbol_logo_2017_09_150pxby63px.png" width=100 align="left" />
2+
3+
[![Training Status](https://github.com/NCAR/wrf_hydro_training/actions/workflows/training-ci.yml/badge.svg?branch=main)](https://github.com/NCAR/wrf_hydro_training/actions/workflows/training-ci.yml)
24

35
## Overview
46
This repository contains lessons in the form of Jupyter notebooks focused on understanding the basic functionality of WRF-Hydro.
@@ -12,7 +14,7 @@ The easiest and recommended way to run these lessons is via the [wrfhydro/traini
1214
### Where to get help and/or post issues
1315
If you have general questions about Docker, there are ample online resourves including the excellent Docker documentation at https://docs.docker.com.
1416

15-
If you have questions about WRF-Hydro or these lessons please use the contact form on our website: https://ral.ucar.edu/projects/wrf_hydro/contact.
17+
If you have questions about WRF-Hydro or these lessons please use the contact form on our website: https://ral.ucar.edu/projects/wrf_hydro/contact.
1618

1719
If you have found a bug in these lessons please log an issue on the Issues page of the GitHub repository at https://github.com/NCAR/wrf_hydro_training/issues.
1820

@@ -27,17 +29,24 @@ Each training container is specific to a release version of the WRF-Hydro source
2729

2830
Issue the following command in your terminal to pull a specific version of the training corresponding to your code release version.
2931

30-
`docker pull wrfhydro/training:v5.2.0-rc1`
32+
`$ docker pull wrfhydro/training:v5.2.0-rc1`
3133

3234
**Step 3: Start the training container**
3335
Issue the following commnand in your terminal session to start the training Docker container.
3436

35-
`docker run --name wrf-hydro-training -p 8888:8888 -it wrfhydro/training:v5.2.0-rc1`
37+
`$ docker run --name wrf-hydro-training -p 8888:8888 wrfhydro/training`
38+
39+
Start in interative mode with persistent data
40+
`$ docker run --name wrf-hydro-training -it -v ./path/to/wrf_hydro_training:/home/docker/saved wrfhydro/training`
41+
42+
Run training notebooks CI
43+
44+
`$ docker run --name wrf-hydro-ci --rm -e CI_TESTING=true wrfhydro/training`
3645

3746
**Note: If you have already started the training once you will need to remove the previous container using the command
38-
`docker rm wrf-hydro-training`**
47+
`$ docker rm wrf-hydro-training`**
3948

40-
The container will start and perform a number of actions before starting the training.
49+
The container will start and perform a number of actions before starting the training.
4150

4251
1. The container will pull the model code
4352
2. The container will pull an example test case

lessons/training/Lesson-0-start.ipynb

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,20 @@
5757
"\n",
5858
"Issue the following command in your terminal to pull a specific version of the training corresponding to your code release version. \n",
5959
"\n",
60-
"`docker pull wrfhydro/training:v5.2.0-rc1`\n",
60+
"`docker pull wrfhydro/training:v5.4.0`\n",
6161
"\n",
6262
"**Step 3: Start the training container**\n",
6363
"Issue the following command in your terminal session to start the training Docker container.\n",
6464
"\n",
65-
"`docker run --name wrf-hydro-training -p 8888:8888 -it wrfhydro/training:v5.2.0-rc1`\n",
65+
"`docker run --name wrf-hydro-training -p 8888:8888 -it wrfhydro/training:v5.4.0`\n",
6666
"\n",
6767
"The container will start and perform a number of actions before starting the training. \n",
6868
"\n",
6969
"**Note: If you have already started the training once you will need to remove the previous container using the command\n",
7070
"\n",
7171
"`docker rm wrf-hydro-training`\n",
7272
"\n",
73-
"**Step 4: Connect to JupyterLab server using your browser**\n",
74-
"\n",
75-
"At the end of the container startup process an address and password will be printed to the terminal. The address and password are used to connect to JupyterLab. All training lesson notebooks in this container are in the `/home/docker/wrf-hydro-training/lessons` directory and can be opened in the JupyterLab environment.\n",
76-
"\n",
77-
"**Step 5: Running the lessons**\n",
73+
"**Step 4: Running the lessons**\n",
7874
"\n",
7975
"To run the lessons you may either execute commands by running each cell of the notebooks (recommended). Alternatively, you may open a terminal in JupyterLab by selecting `File -> New -> Terminal` within JupyterLab and input the commands manually if you prefer. You can also use your own terminal by logging into the container with the command `docker exec -it wrf-hydro-training bash`.\n",
8076
"\n",
@@ -95,20 +91,13 @@
9591
"\n",
9692
"**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**\n",
9793
"\n",
98-
"© UCAR 2020"
94+
"© UCAR 2025"
9995
]
100-
},
101-
{
102-
"cell_type": "code",
103-
"execution_count": null,
104-
"metadata": {},
105-
"outputs": [],
106-
"source": []
10796
}
10897
],
10998
"metadata": {
11099
"kernelspec": {
111-
"display_name": "Python 3",
100+
"display_name": "Python 3 (ipykernel)",
112101
"language": "python",
113102
"name": "python3"
114103
},
@@ -122,7 +111,7 @@
122111
"name": "python",
123112
"nbconvert_exporter": "python",
124113
"pygments_lexer": "ipython3",
125-
"version": "3.8.3"
114+
"version": "3.12.2"
126115
},
127116
"toc": {
128117
"base_numbering": 1,

0 commit comments

Comments
 (0)