-
Notifications
You must be signed in to change notification settings - Fork 41
Update the userguide CLI docs to mention resuming #1878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
IAlibay
wants to merge
32
commits into
main
Choose a base branch
from
resume_cli_ug
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
11710a7
Modify quickrun to allow resuming
IAlibay 322bc23
fix the gather tests
IAlibay a61598e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6579c04
Merge branch 'main' of github.com:OpenFreeEnergy/openfe into quickrun…
atravitz 0f43f6f
add check for protocol_dag.json
atravitz 5e1a21c
add basic test
atravitz 182562f
clearer language, hopefully
atravitz 3180b8c
store protocol dag using transformation key
atravitz 1c0fdf7
another tmpdir -> tmp_path fix
atravitz 156320b
add error handling check
atravitz 360882a
fix naming in test
atravitz 04d47bb
add news item
atravitz 1055c1b
use assert_click_success
atravitz 2b1000e
Merge branch 'main' into quickrun_resume
atravitz c8a03d8
add test for interrupted job
atravitz d735c7f
remove checkpoint when a job has completed successfully
atravitz 6518499
add handling for checkpoint error handling without --resume
atravitz 5cd437e
clean up logic
atravitz 61a97b6
check for warning
atravitz 48ab9c8
add docs
atravitz 31a6589
make a cache dir
atravitz f8ecc73
Update the CLI quickrun help info
IAlibay 10b42df
Add userguide documentation on how to use quickrun
IAlibay 17aad5c
this reference instead?
IAlibay 7d870dc
fix things a little bit
IAlibay 99ae399
update the title
IAlibay cbbbd7c
Merge branch 'main' into resume_cli_ug
IAlibay 0501033
Update environment.yml
IAlibay 9cf25a5
Update docs/guide/cli/quickrun.rst
IAlibay 3cd7121
Update docs/guide/cli/quickrun.rst
IAlibay 7690ac3
update for new name for now
IAlibay af51f23
Merge branch 'resume_cli_ug' of github.com:OpenFreeEnergy/openfe into…
IAlibay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,4 @@ into non-Python workflows. | |
| .. toctree:: | ||
| cli_basics | ||
| cli_yaml | ||
| quickrun | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,85 @@ | ||||||||||||||||
| .. _userguide_cli_quickrun: | ||||||||||||||||
|
|
||||||||||||||||
| Using Quickrun to execute Transformations | ||||||||||||||||
| ========================================= | ||||||||||||||||
|
|
||||||||||||||||
| The ``openfe quickrun`` command executes a single alchemical Transformation. | ||||||||||||||||
| This is currrently the primary way to execute Transformations after they | ||||||||||||||||
| have been created during network planning. | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| Basic Usage | ||||||||||||||||
| ----------- | ||||||||||||||||
|
|
||||||||||||||||
| To run a Transformation (``transformation.json``) and save results to ``results.json``: | ||||||||||||||||
|
|
||||||||||||||||
| .. code:: none | ||||||||||||||||
|
|
||||||||||||||||
| openfe quickrun transformation.json -d workdir/ -o workdir/results.json | ||||||||||||||||
|
|
||||||||||||||||
| The ``-d`` / ``--work-dir`` flag controls where working files (checkpoints, | ||||||||||||||||
| trajectory data, etc...) are written. If it is ommited, the current directory | ||||||||||||||||
| will be used. | ||||||||||||||||
|
|
||||||||||||||||
| The ``-o`` flag controls where the results file will be written. If it is omitted, | ||||||||||||||||
| results are written to a file named ``<transformation_key>_results.json`` in the working directory, where `<transformation_key>` is a unique identifier. | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| Resuming a halted Job | ||||||||||||||||
| --------------------- | ||||||||||||||||
|
|
||||||||||||||||
| When ``openfe quickrun`` starts, it saves a plan of the simulation to a | ||||||||||||||||
| cache file before execution begins: | ||||||||||||||||
|
|
||||||||||||||||
| .. code:: none | ||||||||||||||||
|
|
||||||||||||||||
| <work-dir>/quickrun_cache/<transformation_key>-ProtocolDAG.json | ||||||||||||||||
|
|
||||||||||||||||
| This cache is automatically removed once the job completes successfully. | ||||||||||||||||
|
|
||||||||||||||||
| If a job is interrupted (e.g. due to a wall-time limit, node failure, or | ||||||||||||||||
| manual cancellation), you can resume the interrupted job by passing the ``--resume`` flag: | ||||||||||||||||
|
|
||||||||||||||||
| .. code:: none | ||||||||||||||||
|
|
||||||||||||||||
| openfe quickrun transformation.json -d workdir/ -o workdir/results.json --resume | ||||||||||||||||
|
|
||||||||||||||||
| The planned simulation cache will be used to identify where in the simulation | ||||||||||||||||
| process it is and, if supported by the Transformation Protocol, how to resume. | ||||||||||||||||
|
|
||||||||||||||||
| .. note:: | ||||||||||||||||
|
|
||||||||||||||||
| The same ``-d`` / ``--work-dir`` used in the original run | ||||||||||||||||
| must be specified so that ``quickrun`` can locate the cache file. | ||||||||||||||||
|
|
||||||||||||||||
| If you pass ``--resume`` but no cache file is found (e.g. the job never | ||||||||||||||||
| started), the following warning is printed and a fresh execution begins: | ||||||||||||||||
|
|
||||||||||||||||
| .. code:: none | ||||||||||||||||
|
|
||||||||||||||||
| No checkpoint found at <work-dir>/quickrun_cache/<transformation_key>-protocolDAG.json! | ||||||||||||||||
| Starting new execution. | ||||||||||||||||
|
|
||||||||||||||||
| If the cache file is corrupted (e.g. due to an incomplete write at | ||||||||||||||||
| the moment of interruption), ``quickrun --resume`` will raise an error with instructions to rerun the simulation: | ||||||||||||||||
|
|
||||||||||||||||
| .. code:: none | ||||||||||||||||
|
|
||||||||||||||||
| Recovery failed, please remove <work-dir>/quickrun_cache/<transformation_key>-protocolDAG.json | ||||||||||||||||
| and any results from your working directory before continuing to create a new protocol, or run without `--resume`. | ||||||||||||||||
|
|
||||||||||||||||
|
Comment on lines
+67
to
+70
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
updating to reflect the changed behavior. |
||||||||||||||||
| If you do not pass the ``--resume`` flag, the code will detect the partially | ||||||||||||||||
| complete transformation and prevent you from accidentally starting a duplicate | ||||||||||||||||
| run. The following error will be raised: | ||||||||||||||||
|
|
||||||||||||||||
| .. code:: none | ||||||||||||||||
|
|
||||||||||||||||
| RuntimeError: Transformation has been started but is incomplete. Please | ||||||||||||||||
| remove <path>/quickrun_cache/<key>-protocolDAG.json and rerun, or resume | ||||||||||||||||
| execution using the ``--resume`` flag. | ||||||||||||||||
|
|
||||||||||||||||
| See Also | ||||||||||||||||
| -------- | ||||||||||||||||
|
|
||||||||||||||||
| - :ref:`cli-reference` - full CLI reference for ``openfe quickrun`` | ||||||||||||||||
| - :ref:`rbfe_cli_tutorial` - a tutorial on how to use the CLI to run hybrid topology relative binding free energy calculations. | ||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| **Added:** | ||
|
|
||
| * Added ``--resume`` flag to ``openfe quickrun``. | ||
| Quickrun now temporarily caches ``protocolDAG`` information and when used with the ``--resume`` flag, quickrun will attempt resume execution of an incomplete transformation. | ||
|
|
||
| **Changed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Deprecated:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Removed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.