This repository has been archived by the owner on Oct 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-new-emitters
- Loading branch information
Showing
22 changed files
with
1,760 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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,11 @@ | ||
docs/ | ||
test/ | ||
.git/ | ||
.github/ | ||
.vscode/ | ||
*.md | ||
LICENSE | ||
Manifest.toml | ||
.gitignore | ||
src/Cloud/amlconf | ||
outputs/ |
This file contains 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,28 @@ | ||
name: Doc Preview Cleanup | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
doc-preview-cleanup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout gh-pages branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: gh-pages | ||
|
||
- name: Delete preview and history | ||
run: | | ||
git config user.name "Documenter.jl" | ||
git config user.email "[email protected]" | ||
git rm -rf "previews/PR$PRNUM" | ||
git commit -m "delete preview" | ||
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) | ||
env: | ||
PRNUM: ${{ github.event.number }} | ||
|
||
- name: Push changes | ||
run: | | ||
git push --force origin gh-pages-new:gh-pages |
This file contains 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 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 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 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 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 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 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,54 @@ | ||
# Cloud Execution | ||
|
||
## Azure | ||
|
||
A key benefit and design motivation of OpticSim is being able to execute many simulations/optimizations at once. | ||
This is best enabled through the use of cloud computing services such as Azure. | ||
|
||
As part of the base package, we provide support for cloud execution using an [Azure Machine Learning](https://azure.microsoft.com/en-gb/free/machine-learning) workspace. | ||
|
||
To use this functionally you'll first need to set up an AML workspace with a compute cluster. Then you'll need to provide a few bits of information to OpticSim: | ||
|
||
- Subscription ID, of the form `XXXXXXXX-XXX-XXX-XXXX-XXXXXXXXXXXX` | ||
- Resource group name | ||
- Workspace name | ||
- Compute cluster name | ||
|
||
This information can be cached either to a specific file, or globally: | ||
|
||
```@docs | ||
OpticSim.Cloud.cache_run_config | ||
OpticSim.Cloud.get_cached_run_config | ||
``` | ||
|
||
You should also include an `.amlignore` file in the root of your project. | ||
This is similar to a `.gitignore` file and should include any files which should not be uploaded to AML as part of your source snapshot, for examples `test/`. | ||
|
||
!!! note | ||
**`Manifest.toml` must be listed in your `.amlignore` file.** | ||
|
||
If an `.amlignore` doesn't already exist then one will be created on the first submission of a run to AML. | ||
|
||
Once everything is configured, you can submit a run: | ||
|
||
```@docs | ||
OpticSim.Cloud.submit_run_to_AML | ||
``` | ||
|
||
To retrieve outputs from your run simply write files to the `outputs/` directory and the files will automatically appear as part of the AML run. | ||
|
||
### Examples | ||
|
||
```julia | ||
using OpticSim.Cloud | ||
|
||
cache_run_config([subscription_id], [resource_group_name], [workspace_name], [compute_name], [path_to_config]) | ||
|
||
submit_run_to_AML("example-run", [path_to_script], ["--arg1", "1", "--arg2", "2"], nothing, [path_to_config]) | ||
|
||
submit_run_to_AML("example-hyperdrive-run", [path_to_script], ["--arg1", "1"], Dict("--arg2" => ["1", "2", "3"]), [path_to_config]) | ||
``` | ||
|
||
## Other Cloud Services | ||
|
||
Currently no other services are supported, though it should be reasonably straightforward to add similar functionality to that for AML. |
This file contains 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 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.