docs: add remote computing tutorial#265
Conversation
| "> **Subclassing**:\n", | ||
| "> If you run QUEENS with custom classes that inherit from QUEENS objects, you need to ensure that these classes are also available in the remote QUEENS environment.\n", | ||
| "> You can do this in one of the following ways:\n", | ||
| "> 1. Include the custom classes in the QUEENS repository. They will be automatically copied to the remote QUEENS repository at the start of the QUEENS runs.\n", | ||
| "> 1. Manually synchronize the custom classes between your local and your remote machine, e.g., via an additional repository and install this repository in the remote QUEENS environment." |
There was a problem hiding this comment.
This section was not part of the old files, and I would welcome your thoughts on it.
There was a problem hiding this comment.
I have only used the first option in my cluster runs, and I would assume it is the most reliable option
There was a problem hiding this comment.
Thanks, that's good to know! I agree that it's the more reliable option and have therefore added that it's the recommended way.
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive tutorial on remote computing with 4C that demonstrates how to run QUEENS experiments on a remote cluster using SSH port forwarding. It consolidates and updates existing documentation from GitLab.
Key changes:
- New Jupyter notebook tutorial showing remote 4C simulations with a Grid iterator
- 4C input template file for the hex8 stress extrapolation example
- Integration test framework for the remote computing tutorial
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tutorials/3_grid_iterator_fourc_remote.ipynb | Main tutorial notebook with step-by-step instructions for setting up SSH, configuring remote connections, and running 4C simulations on a cluster |
| tutorials/solid_runtime_hex8.4C.yaml | 4C input template defining a structural mechanics problem with templated Neumann boundary conditions |
| tests/tutorial_tests/test_3_grid_iterator_fourc_remote.py | Placeholder file to exclude tutorial from standard test execution |
| tests/integration_tests/cluster/test_dask_cluster.py | Integration test that executes the tutorial with injected credentials and validates results |
| src/queens/drivers/jobscript.py | Enhanced documentation clarifying local vs. remote paths for input templates and executables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
75c6f2e to
62277ba
Compare
BishrMaradni
left a comment
There was a problem hiding this comment.
Thank you for contributing in enriching the ever-growing tutorial library!
| """Placeholder for integration test of 3-grid-iterator-4C-remote tutorial. | ||
|
|
||
| The actual test is in tests/integration_tests/cluster/test_dask_cluster.py. | ||
| This file ensures that the tutorial is not run by tests/tutorial_tests/test_tutorials.py. | ||
| """ |
There was a problem hiding this comment.
Is there a reason we are putting the testbook in the cluster test instead of the tutorial_tests?
There was a problem hiding this comment.
Yes, I am testing the new notebook in the cluster tests because this notebook can only execute successfully when a remote computing resource is available. This is not the case for the normal tutorial tests, which are part of the local tests on the GitHub runner. The cluster tests are not part of this pipeline but are run once per night on GitLab and have access to thought / charon.
There was a problem hiding this comment.
The notebook in the documentation has no output due to the placeholders not being replaced. Would it make sense to provide a placeholder replacement + experiment_dir injection to the docu the same way it is done for the tests, thus ensuring stable output and no experiment_dir overwriting issues?
There was a problem hiding this comment.
The problem here, like for the tests, is that even if we replace the placeholders while building the documentation, we would still need access to a remote computing resource to execute the notebook and generate the output. Since the documentation is built here on GitHub, this is currently not possible, as far as I know.
| "# 3. Remote Computing with 4C\n", | ||
| "\n", | ||
| "In this tutorial, you will use the `Grid` iterator to probe the response surface of a 4C model.\n", | ||
| "The 4C simulations will run remotely on a cluster. \n", |
There was a problem hiding this comment.
A small describtion of the 4C model in question would be appreciated 😄
There was a problem hiding this comment.
To be honest, I have no clue what this 4C model does. I just copied it from the old tutorial 😁 Maybe somebody can help us out here and explain?
| "5. Install the same QUEENS environment that you are using on your local machine also on the remote machine. You will later have to pass the path to its python executable via `remote_python`.\n", | ||
| "\n", | ||
| "> **Subclassing**:\n", | ||
| "> If you run QUEENS with custom classes that inherit from QUEENS objects, you need to ensure that these classes are also available in the remote QUEENS environment.\n", |
There was a problem hiding this comment.
| "> If you run QUEENS with custom classes that inherit from QUEENS objects, you need to ensure that these classes are also available in the remote QUEENS environment.\n", | |
| "> If you run QUEENS locally with custom classes that inherit from QUEENS objects, you need to ensure that these classes are also available in the remote QUEENS environment.\n", |
There was a problem hiding this comment.
I am not sure if this doesn't make the sentence more confusing 🫣 Strictly speaking, if you run QUEENS locally, the classes don't need to be available remotely. Maybe this is better?
| "> If you run QUEENS with custom classes that inherit from QUEENS objects, you need to ensure that these classes are also available in the remote QUEENS environment.\n", | |
| "> If you want to run QUEENS remotely with custom classes that inherit from QUEENS objects, you need to ensure that these classes are available in the remote QUEENS environment.\n", |
| "\n", | ||
| "In the following, we will set up the QUEENS experiment for cluster usage:\n", | ||
| "\n", | ||
| "1. To evaluate 4C on a cluster, use a `Jobscript` driver instead of a `Fourc` driver and adjust the paths:\n", |
There was a problem hiding this comment.
| "1. To evaluate 4C on a cluster, use a `Jobscript` driver instead of a `Fourc` driver and adjust the paths:\n", | |
| "1. To evaluate 4C remotely on a cluster, use a `Jobscript` driver instead of a `Fourc` driver, and adjust the paths:\n", |
There was a problem hiding this comment.
I have added the remotely, but I believe the comma is grammatically incorrect here (it's not a list).
leahaeusel
left a comment
There was a problem hiding this comment.
Thank you for the feedback @BishrMaradni 🙏
| """Placeholder for integration test of 3-grid-iterator-4C-remote tutorial. | ||
|
|
||
| The actual test is in tests/integration_tests/cluster/test_dask_cluster.py. | ||
| This file ensures that the tutorial is not run by tests/tutorial_tests/test_tutorials.py. | ||
| """ |
There was a problem hiding this comment.
Yes, I am testing the new notebook in the cluster tests because this notebook can only execute successfully when a remote computing resource is available. This is not the case for the normal tutorial tests, which are part of the local tests on the GitHub runner. The cluster tests are not part of this pipeline but are run once per night on GitLab and have access to thought / charon.
| "# 3. Remote Computing with 4C\n", | ||
| "\n", | ||
| "In this tutorial, you will use the `Grid` iterator to probe the response surface of a 4C model.\n", | ||
| "The 4C simulations will run remotely on a cluster. \n", |
There was a problem hiding this comment.
To be honest, I have no clue what this 4C model does. I just copied it from the old tutorial 😁 Maybe somebody can help us out here and explain?
There was a problem hiding this comment.
The problem here, like for the tests, is that even if we replace the placeholders while building the documentation, we would still need access to a remote computing resource to execute the notebook and generate the output. Since the documentation is built here on GitHub, this is currently not possible, as far as I know.
| "5. Install the same QUEENS environment that you are using on your local machine also on the remote machine. You will later have to pass the path to its python executable via `remote_python`.\n", | ||
| "\n", | ||
| "> **Subclassing**:\n", | ||
| "> If you run QUEENS with custom classes that inherit from QUEENS objects, you need to ensure that these classes are also available in the remote QUEENS environment.\n", |
There was a problem hiding this comment.
I am not sure if this doesn't make the sentence more confusing 🫣 Strictly speaking, if you run QUEENS locally, the classes don't need to be available remotely. Maybe this is better?
| "> If you run QUEENS with custom classes that inherit from QUEENS objects, you need to ensure that these classes are also available in the remote QUEENS environment.\n", | |
| "> If you want to run QUEENS remotely with custom classes that inherit from QUEENS objects, you need to ensure that these classes are available in the remote QUEENS environment.\n", |
| "\n", | ||
| "In the following, we will set up the QUEENS experiment for cluster usage:\n", | ||
| "\n", | ||
| "1. To evaluate 4C on a cluster, use a `Jobscript` driver instead of a `Fourc` driver and adjust the paths:\n", |
There was a problem hiding this comment.
I have added the remotely, but I believe the comma is grammatically incorrect here (it's not a list).
27e0e99 to
fb74a07
Compare
…is dir for all other cluster tests
fb74a07 to
0d86770
Compare
|
I have rebased all commits onto the newest main and have changed the tutorial number from 3 to 5 in accordance with what @reginabuehler and I have agreed on. I have also checked that the cluster tests still run successfully on Gitlab. |
cf70345 to
b2043a3
Compare
Description and Context:
What and Why?
This PR adds a tutorial on remote computing with 4C. It combines our old wiki entry on GitLab with an updated version of tutorial 4 on GitLab.
Beyond that, I have cleaned up the TestCluster class to clearly separate tests, cluster configurations, fixtures, and functions while avoiding duplicate code.
I have tested the changes in the cluster tests with our pipeline on GitLab.
Any additional input on how you manage remote QUEENS runs is warmly welcome!
Related Issues and Pull Requests
Interested Parties
@BishrMaradni