Skip to content

Commit be0a93e

Browse files
authored
Merge pull request #4955 from ESMCI/another_container_fix
Fix container paths
2 parents 88847e3 + d85529e commit be0a93e

7 files changed

Lines changed: 20 additions & 19 deletions

File tree

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ jobs:
213213
- name: Cache inputdata
214214
uses: actions/cache@v3
215215
with:
216-
path: /home/cime/inputdata
216+
path: /root/storage/inputdata
217217
key: inputdata-2
218218
- name: Install uv
219219
uses: astral-sh/setup-uv@v7

doc/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
sphinx
1+
sphinx<8.0
22
sphinxcontrib-programoutput
33
sphinx-rtd-theme
44
sphinx-copybutton
55
evv4esm
66
xmlschema
77
sphinx-toolbox
8-
sphinx-autobuild
8+
sphinx-autobuild

doc/source/contributing-guide.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,15 @@ 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 ./storage:/root/storage -v ./inputdata:/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 -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 ./inputdata:/root/inputdata`` persistent input data.
173-
- ``-v ./storage:/root/storage`` persistent cases, baselines, timings, etc.
172+
- ``-v ./storage:/root/storage`` persist all data; cases, baselines, archive, inputdata. the bind mounts can be broken out if you only want to persist certain input/outputs.
174173
- ``-w /root/E3SM/cime`` set the current working directory to CIME's root.
175174
- ``ghcr.io/esmci/cime:latest`` container image.
176175
- ``bash`` the command to run in the container.

docker/.cime/config_machines.v2.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<SAVE_TIMING_DIR>/root/storage/timings</SAVE_TIMING_DIR>
1313
<SAVE_TIMING_DIR_PROJECTS>CIME</SAVE_TIMING_DIR_PROJECTS>
1414
<CIME_OUTPUT_ROOT>/root/storage/cases</CIME_OUTPUT_ROOT>
15-
<DIN_LOC_ROOT>/root/inputdata</DIN_LOC_ROOT>
16-
<DIN_LOC_ROOT_CLMFORC>/root/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
15+
<DIN_LOC_ROOT>/root/storage/inputdata</DIN_LOC_ROOT>
16+
<DIN_LOC_ROOT_CLMFORC>/root/storage/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
1717
<DOUT_S_ROOT>/root/storage/archive/$CASE</DOUT_S_ROOT>
1818
<BASELINE_ROOT>/root/storage/baselines/$COMPILER</BASELINE_ROOT>
1919
<CCSM_CPRNC>/root/storage/tools/cprnc</CCSM_CPRNC>

docker/.cime/docker/config_machines.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<SAVE_TIMING_DIR>/root/storage/timings</SAVE_TIMING_DIR>
1212
<SAVE_TIMING_DIR_PROJECTS>CIME</SAVE_TIMING_DIR_PROJECTS>
1313
<CIME_OUTPUT_ROOT>/root/storage/cases</CIME_OUTPUT_ROOT>
14-
<DIN_LOC_ROOT>/root/inputdata</DIN_LOC_ROOT>
15-
<DIN_LOC_ROOT_CLMFORC>/root/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
14+
<DIN_LOC_ROOT>/root/storage/inputdata</DIN_LOC_ROOT>
15+
<DIN_LOC_ROOT_CLMFORC>/root/storage/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
1616
<DOUT_S_ROOT>/root/storage/archive/$CASE</DOUT_S_ROOT>
1717
<BASELINE_ROOT>/root/storage/baselines/$COMPILER</BASELINE_ROOT>
1818
<CCSM_CPRNC>/root/storage/tools/cprnc</CCSM_CPRNC>

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
5858
COPY docker/entrypoint.sh /entrypoint.sh
5959

6060
RUN SKIP_ENTRYPOINT=true source /entrypoint.sh \
61-
&& mkdir -p /root/{tools,inputdata,cases,timings,archive,baselines} \
61+
&& mkdir -p /root/storage/{tools,inputdata,cases,timings,archive,baselines} \
6262
&& download_input_data
6363

64-
COPY --from=cprnc /root/tools/cprnc /root/tools/cprnc
64+
COPY --from=cprnc /root/storage/tools/cprnc /root/storage/tools/cprnc
6565
COPY docker/.cime /root/.cime
6666

6767
ENTRYPOINT ["/entrypoint.sh"]

docker/entrypoint.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ export LOGNAME="${USER}"
66

77
# Set static home path where .cime exists and container entrypoint options
88
SKIP_ENTRYPOINT="${SKIP_ENTRYPOINT:-false}"
9+
STORAGE_DIR="${HOME}/storage"
910

1011
# Build the cprnc tool from CIME sources
1112
function build_cprnc() {
1213
cprnc_dir="${CPRNC_DIR:-${PWD}/CIME/non_py/cprnc}"
14+
tools_dir="${STORAGE_DIR}/tools"
1315

1416
if [[ ! -e "${cprnc_dir}" ]]; then
1517
echo "CPRNC path does not exist. Change to CIME's root directory."
@@ -22,10 +24,10 @@ function build_cprnc() {
2224

2325
make
2426

25-
mkdir "${HOME}/tools"
27+
[[ ! -e "${tools_dir}" ]] && mkdir -p "${tools_dir}"
2628

2729
# Needs to be copied into the machines configured tool path
28-
cp cprnc "${HOME}/tools/cprnc"
30+
cp cprnc "${tools_dir}/cprnc"
2931

3032
popd || exit 1
3133
}
@@ -34,16 +36,16 @@ function build_cprnc() {
3436
# Download input data needed for model setup
3537
# required for grid generation tests
3638
function download_input_data() {
37-
mkdir -p "${HOME}/inputdata/cpl/gridmaps/oQU240"
38-
mkdir -p "${HOME}/inputdata/share/domains"
39+
mkdir -p "${STORAGE_DIR}/inputdata/cpl/gridmaps/oQU240"
40+
mkdir -p "${STORAGE_DIR}/inputdata/share/domains"
3941

40-
wget -O "${HOME}/inputdata/cpl/gridmaps/oQU240/map_oQU240_to_ne4np4_aave.160614.nc" \
42+
wget -O "${STORAGE_DIR}/inputdata/cpl/gridmaps/oQU240/map_oQU240_to_ne4np4_aave.160614.nc" \
4143
https://portal.nersc.gov/project/e3sm/inputdata/cpl/gridmaps/oQU240/map_oQU240_to_ne4np4_aave.160614.nc
4244

43-
wget -O "${HOME}/inputdata/share/domains/domain.ocn.ne4np4_oQU240.160614.nc" \
45+
wget -O "${STORAGE_DIR}/inputdata/share/domains/domain.ocn.ne4np4_oQU240.160614.nc" \
4446
https://portal.nersc.gov/project/e3sm/inputdata/share/domains/domain.ocn.ne4np4_oQU240.160614.nc
4547

46-
wget -O "${HOME}/inputdata/share/domains/domain.lnd.ne4np4_oQU240.160614.nc" \
48+
wget -O "${STORAGE_DIR}/inputdata/share/domains/domain.lnd.ne4np4_oQU240.160614.nc" \
4749
https://portal.nersc.gov/project/e3sm/inputdata/share/domains/domain.lnd.ne4np4_oQU240.160614.nc
4850
}
4951

0 commit comments

Comments
 (0)