Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
- name: Cache inputdata
uses: actions/cache@v3
with:
path: /home/cime/inputdata
path: /root/storage/inputdata
key: inputdata-2
- name: Install uv
uses: astral-sh/setup-uv@v7
Expand Down
4 changes: 2 additions & 2 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sphinx
sphinx<8.0
sphinxcontrib-programoutput
sphinx-rtd-theme
sphinx-copybutton
evv4esm
xmlschema
sphinx-toolbox
sphinx-autobuild
sphinx-autobuild
5 changes: 2 additions & 3 deletions doc/source/contributing-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,15 @@ following example assumes the model is checked out in ``$SRC_PATH``.

.. code-block:: bash

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
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

This example will drop into a shell where CIME commands or tests can be run.
The options are broken down below.

- ``--hostname docker`` is required to tell CIME which machine definition to use.
- ``-e CIME_MODEL=e3sm`` defines the model.
- ``-v ${SRC_PATH}:/root/E3SM`` passes through the model source.
- ``-v ./inputdata:/root/inputdata`` persistent input data.
- ``-v ./storage:/root/storage`` persistent cases, baselines, timings, etc.
- ``-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.
- ``-w /root/E3SM/cime`` set the current working directory to CIME's root.
- ``ghcr.io/esmci/cime:latest`` container image.
- ``bash`` the command to run in the container.
Expand Down
4 changes: 2 additions & 2 deletions docker/.cime/config_machines.v2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<SAVE_TIMING_DIR>/root/storage/timings</SAVE_TIMING_DIR>
<SAVE_TIMING_DIR_PROJECTS>CIME</SAVE_TIMING_DIR_PROJECTS>
<CIME_OUTPUT_ROOT>/root/storage/cases</CIME_OUTPUT_ROOT>
<DIN_LOC_ROOT>/root/inputdata</DIN_LOC_ROOT>
<DIN_LOC_ROOT_CLMFORC>/root/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
<DIN_LOC_ROOT>/root/storage/inputdata</DIN_LOC_ROOT>
<DIN_LOC_ROOT_CLMFORC>/root/storage/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
<DOUT_S_ROOT>/root/storage/archive/$CASE</DOUT_S_ROOT>
<BASELINE_ROOT>/root/storage/baselines/$COMPILER</BASELINE_ROOT>
<CCSM_CPRNC>/root/storage/tools/cprnc</CCSM_CPRNC>
Expand Down
4 changes: 2 additions & 2 deletions docker/.cime/docker/config_machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<SAVE_TIMING_DIR>/root/storage/timings</SAVE_TIMING_DIR>
<SAVE_TIMING_DIR_PROJECTS>CIME</SAVE_TIMING_DIR_PROJECTS>
<CIME_OUTPUT_ROOT>/root/storage/cases</CIME_OUTPUT_ROOT>
<DIN_LOC_ROOT>/root/inputdata</DIN_LOC_ROOT>
<DIN_LOC_ROOT_CLMFORC>/root/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
<DIN_LOC_ROOT>/root/storage/inputdata</DIN_LOC_ROOT>
<DIN_LOC_ROOT_CLMFORC>/root/storage/inputdata-clmforc</DIN_LOC_ROOT_CLMFORC>
<DOUT_S_ROOT>/root/storage/archive/$CASE</DOUT_S_ROOT>
<BASELINE_ROOT>/root/storage/baselines/$COMPILER</BASELINE_ROOT>
<CCSM_CPRNC>/root/storage/tools/cprnc</CCSM_CPRNC>
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
COPY docker/entrypoint.sh /entrypoint.sh

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

COPY --from=cprnc /root/tools/cprnc /root/tools/cprnc
COPY --from=cprnc /root/storage/tools/cprnc /root/storage/tools/cprnc
COPY docker/.cime /root/.cime

ENTRYPOINT ["/entrypoint.sh"]
16 changes: 9 additions & 7 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export LOGNAME="${USER}"

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

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

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

make

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

# Needs to be copied into the machines configured tool path
cp cprnc "${HOME}/tools/cprnc"
cp cprnc "${tools_dir}/cprnc"

popd || exit 1
}
Expand All @@ -34,16 +36,16 @@ function build_cprnc() {
# Download input data needed for model setup
# required for grid generation tests
function download_input_data() {
mkdir -p "${HOME}/inputdata/cpl/gridmaps/oQU240"
mkdir -p "${HOME}/inputdata/share/domains"
mkdir -p "${STORAGE_DIR}/inputdata/cpl/gridmaps/oQU240"
mkdir -p "${STORAGE_DIR}/inputdata/share/domains"

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

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

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

Expand Down
Loading