Skip to content

Commit a4ad136

Browse files
authored
Merge pull request #237 from HPC-SimTools/2026-02_ld0-documentation-updates
Draft: update IPS portal documentation
2 parents 5f38448 + 05b387c commit a4ad136

3 files changed

Lines changed: 66 additions & 4 deletions

File tree

doc/user_guides/ensembles.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Ensemble simulations are useful when you need to:
1515

1616
The ensemble functionality automatically generates configuration files for each simulation instance, distributes the workload across available compute nodes, and manages the execution of all ensemble members.
1717

18+
If interaction with the `IPS Portal <portal_guides.html>`_ is enabled, the ensemble system will also handle interaction with the IPS Portal automatically.
19+
1820
Method Signature
1921
----------------
2022

doc/user_guides/jupyter.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ The IPS Portal will generate a cell prior to your own notebook which initializes
120120
- ``ips_analysis_api.get_child_data_not_ensembles()`` - get the child runid mapping as described above, but only use child runids NOT associated with ensembles.
121121
- ``ips_analysis_api.get_child_data_by_ensemble_names()`` - gets the child runid mapping as described above, but will only retrieve child runids associated with ensembles. You can further filter this by ensemble name by providing an optional list of component names and an optional list of ensemble names; for example, ``ips_analysis_api.get_child_data_by_ensemble_names(ensemble_names=['ensemble_name_1', 'ensemble_name_2'])`` will ONLY fetch the child runids associated with 'ensemble_name_1' and 'ensemble_name_2', but will search all components for this.
122122

123+
An example of the "generic IPS mapping" generated by these functions can look like this:
124+
125+
.. code-block:: python
126+
127+
{
128+
0.0: ['/path/to/data/file1.json'],
129+
1.0: ['/path/to/data/file2.json'],
130+
2.0: ['/path/to/data/file3.json', '/path/to/data/file4.json'], # note that there can be multiple files per timestamp
131+
# ...
132+
}
133+
123134
**IPS Notebook Analysis API Reference**
124135

125136
.. autoclass:: doc.reference.portal_jupyter_api.ips_analysis_api_v1.IPSAnalysisApi

doc/user_guides/portal_guides.rst

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,22 @@ time, and a descriptive comment. From there you can click on a Run ID
1717
to see the details of that run, including calls on components, data
1818
movement events, task launches and finishes, and checkpoints.
1919

20-
To use the portal include
20+
To use the portal on your local cluster, include the following variables in your configuration file or as environment variables:
2121

2222
.. code-block:: text
2323
24-
USE_PORTAL = True
24+
# stable version
2525
PORTAL_URL = http://lb.ipsportal.production.svc.spin.nersc.org
26+
# or, for the latest version
27+
# PORTAL_URL = http://lb.ipsportal.development.svc.spin.nersc.org
28+
# The API key is required for certain interactions with the portal, and will eventually become mandatory. This key should generally be set as an environment variable, and not saved to version control.
29+
PORTAL_API_KEY = "YOUR_PORTAL_API_KEY" # change this
30+
# To disable the portal even if PORTAL_URL is set, uncomment the next line.
31+
# USE_PORTAL = false
2632
33+
NOTE: On shared clusters, i.e. Perlmutter, there will generally be specific files that you can source in Slurm scripts which will automatically configure the Portal credentials for you, so you can skip settings these variables yourself. Please see the appropriate project documentation for information on how to configure this.
2734

28-
The source code for the portal can be found one `GitHub
35+
The source code for the portal can be found on `GitHub
2936
<https://github.com/HPC-SimTools/IPS-portal>`_ and issues can be
3037
reported using `GitHub issues
3138
<https://github.com/HPC-SimTools/IPS-portal/issues>`_.
@@ -91,7 +98,7 @@ like:
9198
child_conf['PARENT_PORTAL_RUNID'] = self.services.get_config_param("PORTAL_RUNID")
9299
93100
This is automatically configured when running
94-
``ips_dakota_dynamic.py``.
101+
``ips_dakota_dynamic.py`` or when using the ``run_ensemble`` API.
95102

96103
The child runs will not appear on the main runs list but will appear
97104
on a tab next to the events.
@@ -102,3 +109,45 @@ The trace of the primary simulation will contain the traces from all
102109
the simulations:
103110

104111
.. image:: child_runs_trace.png
112+
113+
IPS-Framework APIs
114+
------------------
115+
116+
Provided that the Portal has been enabled, the following APIs allow for interaction with the web portal:
117+
118+
Events API
119+
==========
120+
121+
.. automethod:: ipsframework.services.ServicesProxy.send_portal_event
122+
:noindex:
123+
124+
This function can be used to send custom events to the Portal if the Portal is enabled; if the Portal is not enabled, the event will still be logged locally.
125+
126+
The events API does not currently require an API key to utilize, but this is expected to change in the future.
127+
128+
Jupyter API
129+
===========
130+
131+
.. automethod:: ipsframework.services.ServicesProxy.initialize_jupyter_notebook
132+
:noindex:
133+
134+
.. automethod:: ipsframework.services.ServicesProxy.add_analysis_data_files
135+
:noindex:
136+
137+
All Jupyter APIs require that the Portal API key is set in order to utilize them.
138+
139+
If calling either of these APIs when the Portal is disabled, a warning will be logged and the call will be skipped.
140+
141+
Please see the `Jupyter <jupyter.html>`_ page for specifics on using the Jupyter APIs.
142+
143+
Ensembles API
144+
=============
145+
146+
.. automethod:: ipsframework.services.ServicesProxy.run_ensemble
147+
:noindex:
148+
149+
If the Portal is enabled and the API key has been set, ``run_ensemble`` will automatically interact with the Portal to send appropriate files.
150+
151+
If the Portal is disabled, ``run_ensemble`` will skip the Portal interaction, but will otherwise behave normally.
152+
153+
Please see the `Ensembles <ensembles.html>`_ page for specifics on using the Ensembles API.

0 commit comments

Comments
 (0)