Skip to content

Commit d3fd506

Browse files
committed
fix: coalesce cime directories for easier persistence
1 parent 82929f7 commit d3fd506

5 files changed

Lines changed: 25 additions & 25 deletions

File tree

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ jobs:
249249
- name: Create testing log archive
250250
if: ${{ failure() }}
251251
shell: bash
252-
run: tar -czvf /testing-logs-${GITHUB_RUN_NUMBER}-${{ matrix.model.name }}-${{ matrix.driver }}.tar.gz /root/cases /root/baselines /root/archive
252+
run: tar -czvf /testing-logs-${GITHUB_RUN_NUMBER}-${{ matrix.model.name }}-${{ matrix.driver }}.tar.gz /root/storage/cases /root/storage/baselines /root/storage/archive
253253
# How to download artifacts:
254254
# https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts
255255
- name: Upload testing logs

doc/source/contributing-guide.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,16 @@ following example assumes the model is checked out in ``$SRC_PATH``.
161161

162162
.. code-block:: bash
163163
164-
docker run -it --rm --hostname docker -e CIME_MODEL=e3sm -v ${SRC_PATH}:/root/model -v `pwd`/test-cases:/root/cases -v `pwd`/input-data:/root/inputdata -w /root/E3SM/cime ghcr.io/esmci/cime:latest bash
164+
docker run -it --rm --hostname docker -e CIME_MODEL=e3sm -v ${SRC_PATH}:/root/model -v ./storage:/root/storage -v ./inputdata:/root/inputdata -w /root/E3SM/cime ghcr.io/esmci/cime:latest bash
165165
166166
This example will drop into a shell where CIME commands or tests can be run.
167167
The options are broken down below.
168168

169169
- ``--hostname docker`` is required to tell CIME which machine definition to use.
170170
- ``-e CIME_MODEL=e3sm`` defines the model.
171171
- ``-v ${SRC_PATH}:/root/E3SM`` passes through the model source.
172-
- ``-v `pwd`/test-cases:/root/cases`` stores cases in the current directory under ``test-cases``.
173-
- ``-v `pwd`/inputdata:/root/inputdata`` stores inputdata in the current directory under ``inputdata``.
172+
- ``-v ./inputdata:/root/inputdata`` persistent input data.
173+
- ``-v ./storage:/root/storage`` persistent cases, baselines, timings, etc.
174174
- ``-w /root/E3SM/cime`` set the current working directory to CIME's root.
175175
- ``ghcr.io/esmci/cime:latest`` container image.
176176
- ``bash`` the command to run in the container.
@@ -179,9 +179,9 @@ You can even run CIME or testing without a shell.
179179

180180
.. code-block:: bash
181181
182-
docker run -it --rm --hostname docker -e CIME_MODEL=e3sm -v ${SRC_PATH}:/root/model -v `pwd`/test-cases:/root/cases -v `pwd`/input-data:/root/inputdata -w /root/E3SM/cime ghcr.io/esmci/cime:latest pytest CIME/tests/test_unit*
182+
docker run -it --rm --hostname docker -e CIME_MODEL=e3sm -v ${SRC_PATH}:/root/model -v ./storage:/root/storage -w /root/E3SM/cime ghcr.io/esmci/cime:latest pytest CIME/tests/test_unit*
183183
184184
.. code-block:: bash
185185
186-
docker run -it --rm --hostname docker -e CIME_MODEL=e3sm -v ${SRC_PATH}:/root/model -v `pwd`/test-cases:/root/cases -v `pwd`/input-data:/root/inputdata -w /root/E3SM/cime ghcr.io/esmci/cime:latest ./scripts/create_test SMS.f19_g16.S
186+
docker run -it --rm --hostname docker -e CIME_MODEL=e3sm -v ${SRC_PATH}:/root/model -v ./storage:/root/storage -w /root/E3SM/cime ghcr.io/esmci/cime:latest ./scripts/create_test SMS.f19_g16.S
187187

docker/.cime/config_machines.v2.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
<COMPILERS>gnu,gnuX</COMPILERS>
1010
<MPILIBS>openmpi</MPILIBS>
1111
<PROJECT>CIME</PROJECT>
12-
<SAVE_TIMING_DIR>/root/timings</SAVE_TIMING_DIR>
12+
<SAVE_TIMING_DIR>/root/storage/timings</SAVE_TIMING_DIR>
1313
<SAVE_TIMING_DIR_PROJECTS>CIME</SAVE_TIMING_DIR_PROJECTS>
14-
<CIME_OUTPUT_ROOT>/root/cases</CIME_OUTPUT_ROOT>
14+
<CIME_OUTPUT_ROOT>/root/storage/cases</CIME_OUTPUT_ROOT>
1515
<DIN_LOC_ROOT>/root/inputdata</DIN_LOC_ROOT>
1616
<DIN_LOC_ROOT_CLMFORC>/root/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
17-
<DOUT_S_ROOT>/root/archive/$CASE</DOUT_S_ROOT>
18-
<BASELINE_ROOT>/root/baselines/$COMPILER</BASELINE_ROOT>
19-
<CCSM_CPRNC>/root/tools/cprnc</CCSM_CPRNC>
17+
<DOUT_S_ROOT>/root/storage/archive/$CASE</DOUT_S_ROOT>
18+
<BASELINE_ROOT>/root/storage/baselines/$COMPILER</BASELINE_ROOT>
19+
<CCSM_CPRNC>/root/storage/tools/cprnc</CCSM_CPRNC>
2020
<GMAKE>make</GMAKE>
2121
<GMAKE_J>4</GMAKE_J>
2222
<TESTS>e3sm_developer</TESTS>

docker/.cime/docker/config_machines.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
<COMPILERS>gnu,gnuX</COMPILERS>
99
<MPILIBS>openmpi</MPILIBS>
1010
<PROJECT>CIME</PROJECT>
11-
<SAVE_TIMING_DIR>/root/timings</SAVE_TIMING_DIR>
11+
<SAVE_TIMING_DIR>/root/storage/timings</SAVE_TIMING_DIR>
1212
<SAVE_TIMING_DIR_PROJECTS>CIME</SAVE_TIMING_DIR_PROJECTS>
13-
<CIME_OUTPUT_ROOT>/root/cases</CIME_OUTPUT_ROOT>
13+
<CIME_OUTPUT_ROOT>/root/storage/cases</CIME_OUTPUT_ROOT>
1414
<DIN_LOC_ROOT>/root/inputdata</DIN_LOC_ROOT>
1515
<DIN_LOC_ROOT_CLMFORC>/root/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
16-
<DOUT_S_ROOT>/root/archive/$CASE</DOUT_S_ROOT>
17-
<BASELINE_ROOT>/root/baselines/$COMPILER</BASELINE_ROOT>
18-
<CCSM_CPRNC>/root/tools/cprnc</CCSM_CPRNC>
16+
<DOUT_S_ROOT>/root/storage/archive/$CASE</DOUT_S_ROOT>
17+
<BASELINE_ROOT>/root/storage/baselines/$COMPILER</BASELINE_ROOT>
18+
<CCSM_CPRNC>/root/storage/tools/cprnc</CCSM_CPRNC>
1919
<GMAKE>make</GMAKE>
2020
<GMAKE_J>4</GMAKE_J>
2121
<TESTS>e3sm_developer</TESTS>

docker/entrypoint.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Set up basic user, logname, and default group/user IDs
44
export USER="$(id -nu)"
55
export LOGNAME="${USER}"
6-
export USER_ID="${USER_ID:-1000}"
7-
export GROUP_ID="${GROUP_ID:-1000}"
86

97
# Set static home path where .cime exists and container entrypoint options
108
SKIP_ENTRYPOINT="${SKIP_ENTRYPOINT:-false}"
@@ -34,13 +32,15 @@ function build_cprnc() {
3432
# Download input data needed for model setup
3533
# required for grid generation tests
3634
function download_input_data() {
37-
mkdir -p "${HOME}/inputdata/cpl/gridmaps/oQU240" \
38-
"${HOME}/inputdata/share/domains" \
39-
"${HOME}/timings" \
40-
"${HOME}/cases" \
41-
"${HOME}/archive" \
42-
"${HOME}/baselines" \
43-
"${HOME}/tools"
35+
local storage="${HOME}/storage"
36+
37+
mkdir -p "${HOME}/inputdata/cpl/gridmaps/oQU240"
38+
mkdir -p "${HOME}/inputdata/share/domains"
39+
mkdir -p "${storage}/cases"
40+
mkdir -p "${storage}/timings"
41+
mkdir -p "${storage}/archive"
42+
mkdir -p "${storage}/baselines"
43+
mkdir -p "${storage}/tools"
4444

4545
wget -O "${HOME}/inputdata/cpl/gridmaps/oQU240/map_oQU240_to_ne4np4_aave.160614.nc" \
4646
https://portal.nersc.gov/project/e3sm/inputdata/cpl/gridmaps/oQU240/map_oQU240_to_ne4np4_aave.160614.nc

0 commit comments

Comments
 (0)