Add SimBoard-compatible www inference via a new [simboard] config section - #841
Conversation
|
@forsyth2 Thanks for opening this PR so quickly. I replied to some of your comments above and tagged Jill for input. |
|
@chengzhuzhang and @forsyth2 here is my proposed design based on the SimBoard team meeting. Zppy diagnostic directory structureI think zppy should publish SimBoard-compatible diagnostics under one bounded archive root: This gives SimBoard one narrow discovery target, avoids broad scans across unrelated web content, and keeps production and development output separated under one common root. Directory layout would be used for discovery only; Zppy configFor config, I think this should be explicit and opt-in via a If Expected behavior:
[default]
www = # Diagnostic web output root. If empty and simboard.enabled=True, infer a SimBoard-compatible archive path from mache.
[simboard]
enabled = False # Opt in to SimBoard-compatible publishing behavior.
simulation_type = development # Diagnostic classification for SimBoard publishing: production | development.Let me know what you think. We can discuss more at next week's EZ Meeting too. |
|
Hi @tomvothecoder, thanks for the design. Checking that each of my design decisions above have been addressed: Design decision 1
Addressed by:
This makes sense, but adding a new In short, this can be implemented, but it's a little bit more overhead. It sounds like that's worth it for clarity to users though. Design decision 2 simboard_type = config["default"]["simboard_type"]
web_portal_base_path = machine_info.config.get("web_portal", "base_path")
config["default"]["www"] = (
f"{web_portal_base_path}/simboard/{simboard_type}/"
Addressed by:
So, it looks like we just want to change the above to That sounds good to me; do we want to include "simboard" anywhere in the path to be explicit about the structure being for SimBoard? E.g., Design decision 3
Not addressed explicitly, but it seems like only |
|
@copilot Please implement these two additions to this PR:
Expected behavior:
An example cfg:
simboard_type = config["default"]["simboard_type"]
web_portal_base_path = machine_info.config.get("web_portal", "base_path")
config["default"]["www"] = (
f"{web_portal_base_path}/simboard/{simboard_type}/"should be updated so that we get something like: That is, |
Addressed in This updates the PR to use an explicit |
|
Remaining action items:
|
|
Thanks for the updates @forsyth2.
I agree, adding the
We can keep it generic since SimBoard is a consumer of the archive rather than the owner. Similarly, we'd follow the same model where E3SM simulations output performance/timing metadata to a generic
I forgot to discuss this with the team. I think for now we can focus on |
|
Sounds good, thanks @tomvothecoder! |
www from SimBoard defaultswww inference via a new [simboard] config section
|
It looks like the Copilot review got confused by the un-updated PR description. I've had Claude write an updated description for the PR and pasted it in above. I also included Tom's expected behavior table. Claude also suggested the new title: "Add SimBoard-compatible For reference: Pasted contentSummaryAdds an opt-in Expected behavior:
ChangesNew
New module
Docs (
Tests
Behavior notes
|
|
I've cherry-picked the commit from the accidentally-opened #844. |
forsyth2
left a comment
There was a problem hiding this comment.
@tomvothecoder This PR is ready for your review. It includes the functional changes, doc updates, and test updates.
If you have enough of the SimBoard pipeline built at this point, I'd recommend testing it with a zppy dev environment built off this branch.
tomvothecoder
left a comment
There was a problem hiding this comment.
Hi @forsyth2, I appreciate you working on this. I reviewed the docs and code. My only suggestion is to make "development" the default (reasoning in PR review comment).
Afterwards, the next tasks would be:
- @chengzhuzhang (or you) test this feature by running this zppy branch to produce sample output in the
diagnostics_archive/developmentanddiagnostics_archive/productiondirectories -- this can be done on LCRC/Chrysalis first until NERSC/Perlmutter is back online - I implement and test this SimBoard issue: E3SM-Project/simboard#240
- Merge this PR and SimBoard's PR once validation is successful.
Thanks!
| enabled = boolean(default=False) | ||
| # Use "none" only when SimBoard publishing is disabled. | ||
| # Default to "production" so enabled configs can opt in without overriding it. | ||
| simulation_type = option("production", "development", "none", default="production") |
There was a problem hiding this comment.
I think the default should be "development". Accidentally placing development diagnostics under production would be more harmful than placing production diagnostics under development. Production should be an explicit designation rather than the default.
A user can later promote diagnostics to production, but this requires two separate actions: updating simulation_type in SimBoard and manually moving the diagnostic output to the corresponding location under diagnostics_archive. I recommend this information be in the zppy SimBoard docs.
|
@copilot Please add a commit addressing these 3 points:
|
- Change `default.ini` default from "production" to "development"
for `[simboard] simulation_type`. Accidentally publishing to the
production archive is more harmful than publishing to development.
- Update `test_sections.py` to match the new default.
- Update user guide `simboard.rst`:
- Config example now shows `simulation_type = development`.
- Parameter table reflects new default.
- Add a "Promoting diagnostics from development to production"
section explaining the two-step process.
- Update `parameters.rst` SimBoard table to show new default.
- Add dev guide `docs/source/dev_guide/tasks/simboard.rst`.
- Register simboard in `docs/source/dev_guide/tasks/index.rst`.
Done in the latest commit:
|
forsyth2
left a comment
There was a problem hiding this comment.
Copilot has addressed @tomvothecoder's comments and my request for dev-guide documentation in the latest commit.
I've tested it with:
# Copilot made changes
cd ~/ez/zppy
git status
# On branch copilot/update-default-www-and-simboard-type
# nothing to commit, working tree clean
git fetch upstream copilot/update-default-www-and-simboard-type
git reset --hard upstream/copilot/update-default-www-and-simboard-type
# HEAD is now at 41892d02 Change simulation_type default to "development"; update docs
lcrc_conda
conda activate zppy-pr841-simboard-20260724
# 1. Check pre-commit
pre-commit run --all-files
# 2. Check tests
python -m pip install .
# Unit tests:
pytest tests/test_*.py
# 84 passed in 1.30s
# SimBoard integration test:
pytest tests/integration/test_simboard_settings.py
# 4 passed in 0.24s
# 3. Check docs
cd docs
make html
cp -r _build/ /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_docs_pr841_20260730
chmod -R 755 /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_docs_pr841_20260730
# Visit https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/ac.forsyth2/zppy_docs_pr841_20260730There's just one clarification question for @tomvothecoder re: post-run changing from dev to prod.
| @@ -0,0 +1,81 @@ | |||
| .. _dev-task-simboard: | |||
A dry run created `<www>/<case>/` and copied the provenance cfg/settings there before any check of `dry_run`, so it published artifacts for a run that never launched a job. This matters more with the new `[simboard]` section: when `enabled = True` and `www` is empty, `www` is inferred to the shared, machine-wide diagnostics_archive, so a dry run wrote into the real publishing tree rather than a path the user chose. The `output` script directory is untouched -- a dry run still writes the generated scripts and settings there, which is the point of a dry run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Tested on Chrysalis. Two things: 1. BASE=/lcrc/group/e3sm/public_html/diagnostic_output/diagnostics_archive
mkdir -p "$BASE/development" "$BASE/production"
chgrp -R E3SM "$BASE"; chmod -R 2775 "$BASE"Worth documenting that this is a one-time maintainer step. 2. Dry runs were writing to |
|
@tomvothecoder I have one test that created a dummy production run results under:/lcrc/group/e3sm/public_html/diagnostic_output/diagnostics_archive/production, let me know if this is sufficient for the simboard side test. One enhancement I'm thinking is, we should leverage the |
|
I have confirmed that CASE_GROUP exist in env_case.xml, however never reaches provenance.*.settings, and zppy doesn't know about it either. |
Read CASE_GROUP from env_case.xml into provenance, and use it as a level
in the inferred www path:
<web_portal_base_path>/diagnostics_archive/<simulation_type>/<case_group>/
CASE_GROUP is optional in CIME. When a simulation has none, zppy warns and
publishes directly under <simulation_type>/; the new `[default] case_group`
parameter lets users supply one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@tomvothecoder — new commit 40ac3d1 adds zppy now reads Simulations without a There's a sample published on Chrysalis if you want to point SimBoard at something real: Currently one case ( |
|
Thank you @chengzhuzhang. There are multiple timestamped drwxr-sr-x 3 ac.zhang40 E3SM 4096 Aug 5 18:49 .
drwxr-sr-x 3 ac.zhang40 E3SM 4096 Aug 5 18:47 ..
drwxr-sr-x 3 ac.zhang40 E3SM 4096 Aug 5 18:49 global_time_series
-rw-r--r-- 1 ac.zhang40 E3SM 1274 Aug 5 18:47 provenance.20260805_234735_275469.cfg
-rw-rw---- 1 ac.zhang40 E3SM 229 Aug 5 18:47 provenance.20260805_234735_275469.settings
-rw-r--r-- 1 ac.zhang40 E3SM 1274 Aug 5 18:47 provenance.20260805_234749_729830.cfg
-rw-rw---- 1 ac.zhang40 E3SM 229 Aug 5 18:47 provenance.20260805_234749_729830.settings |
|
@tomvothecoder The time-stamped provenance files reflect multiple zppy runs. One common use case that cause multiple provenance file is when a simulation runner to extend the simulation end date and generate additional diagnostic figures. I was thinking about this use case as well. SimBoard should rely on the latest provenance file and, during each scan, select the most recently time-stamped file. |
|
Hey @forsyth2 and @chengzhuzhang, I've identified and documented metadata/linkage issues that should be handled upstream by the model or by the case owner. I think we should limit how involved SimBoard and zppy is with correcting metadata and paths, otherwise the scope of both tools will expand too broadly. Ryan, here is the new docs page on diagnostics that you should use to update the zppy SimBoard page in this PR. You can keep the existing technical details on zppy configuration, but might want to refer to the new troubleshooting section and information on how SimBoard handles diagnostic linkage. It aligns SimBoard guidance with zppy configuration and covers:
|
… guide Update zppy/docs/source/user_guide/tasks/simboard.rst to incorporate SimBoard's new diagnostics.md guidance, per the SimBoard developer's review comment on this PR. - Add a pre-publish checklist: confirm the case exists in SimBoard, verify provenance (case_name, machine, hpc_username) matches, and apply the grouped/ungrouped archive layout rule. - Add a publishing section covering the provenance.settings file, output verification, and the periodic (~15 min) SimBoard scanner that performs linkage. - Add a "Stable URLs" section describing link stability across content updates, and the manual steps required when output is moved or deleted. - Add a troubleshooting section for missing links, links to the wrong output, and dead links, with a pointer to SimBoard's diagnostics linkage architecture doc. - Keep existing zppy-specific configuration content (www inference, parameters table, dev-to-production promotion) unchanged, with a clarifying note that promotion is a zppy-side archive move, not a SimBoard link update. No functional/code changes; docs only.
forsyth2
left a comment
There was a problem hiding this comment.
I think once you've aligned the docs this PR should be good to merge
Hi @tomvothecoder, I had Claude update the zppy's user guide for SimBoard based on https://github.com/tomvothecoder/simboard/blob/diags/240-prov-scan/docs/user/diagnostics.md. I didn't change the developer guide.
Let me know if this new commit, 9f6415b, looks good to you. Thanks!
Looks good to me. I think we can merge now. Thanks Ryan! |
Summary
Adds an opt-in
[simboard]configuration section that letszppyinfer the[default] wwwpath automatically instead of requiring users to set it explicitly. This targets SimBoard-compatible publishing, where the diagnostics archive path can be derived from Mache'sweb_portal.base_path.Expected behavior:
simboard.enabledwwwFalseTruemache.Truewwwas the output path and do not override it.simboard.enabledstill controls SimBoard-specific metadata and validation.TrueChanges
New
[simboard]config section (zppy/defaults/default.ini)enabled(bool, defaultFalse): opts in to SimBoard-compatible publishing.simulation_type(option:production|development|none, defaultproduction): selects the archive classification used when inferringwww.[default] wwwno longer requires an explicit value (string(default="")instead of a barestring), since it can now be inferred.New module
zppy/simboard.pysimboard(...): a configuration-only task hook (no HPC job), analogous to[bundle], that validates the[simboard]section has no subsections.simboard_enabled(config): parsesenabledfrom bool or"true"/"false"strings (case-insensitive), raisingValueErroron anything else.validate_simboard_config(config): rejectssimulation_type = "none"wheneverenabled = True.normalize_web_portal_base_path(...): strips whitespace and trailing slashes.infer_simboard_www(machine_info, config): builds<web_portal base_path>/diagnostics_archive/<simulation_type>/, raising a descriptiveValueErrorif Mache has no (or an empty)web_portal.base_pathfor the current machine.zppy/__main__.py_determine_parametersnow calls a new_set_default_wwwhelper, which:validate_simboard_config(sosimulation_typeis checked even whenwwwis already explicitly set).wwwuntouched if already provided.simboard.enabled = Trueand inferswwwviainfer_simboard_www; raises a clear error ifwwwis empty and SimBoard is not enabled._launch_scriptsnow runs thesimboardconfig-hook bundle alongside other predefined bundles, beforeclimotasks.Docs (
docs/source/parameters.rst)[simboard]parameters.wwwinference rule for the top-levelwwwparameter, including the three failure/success cases (inferred when enabled, error when not enabled, error when Mache lacksweb_portal.base_path).configuraiton→configuration).Tests
tests/test_sections.py: adds expected defaults for the new[simboard]section.tests/test_zppy_main.py(new): comprehensive coverage including:wwwinference for bothproductionanddevelopmentsimulation types.simboard_enabledparsing across bool/string/invalid inputs.wwwis preserved even when SimBoard is enabled.wwwis empty and SimBoard is disabled.simulation_type = "none"while enabled.web_portal.base_pathis missing or empty.[simboard].simulation_typevalues via ConfigObj validation.Behavior notes
wwwis set explicitly, behavior is unchanged (aside from also validatingsimulation_typeisn't"none"whenenabled = True).wwwis omitted and SimBoard is not enabled,zppynow raises an error (previously this was enforced structurally by the config spec requiringwww).Select one: This pull request is...
Small Change
a single commit.