Skip to content

Commit e45709c

Browse files
committed
Populate initial user guide docs
Signed-off-by: Gigon Bae <gbae@nvidia.com>
1 parent 85cd9fd commit e45709c

File tree

25 files changed

+1535
-717
lines changed

25 files changed

+1535
-717
lines changed

docs/_static/custom.css

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,26 +61,37 @@ h1 {
6161
/* Code Highlight */
6262
div[class^="highlight"] pre {
6363
color: rgb(248, 248, 242);
64-
background-color: rgb(35, 50, 74);
64+
background-color: rgb(41, 44, 46);
6565
border: 0px;
6666
box-shadow: none;
6767
}
68+
div.highlight{
69+
border-radius: 5px;
70+
}
71+
div.highlight pre {
72+
border-radius: 5px;
73+
}
74+
div.cell div.cell_input div.highlight {
75+
border-radius: 0px;
76+
}
77+
78+
/* Code Block Caption */
79+
div.code-block-caption {
80+
font-weight: bold;
81+
font-style: italic;
82+
}
83+
84+
/* Code Line Highlight */
85+
.highlight .hll {
86+
background-color: rgb(133, 132, 24);
87+
}
6888

6989
/* Left bar color for cells in Jupyter Notebook */
7090
div.cell div.cell_input {
71-
border-left-color: rgb(93, 193, 183)
91+
border-left-color: rgb(127, 218, 255)
7292
}
7393

74-
/* .highlight-bash pre {
75-
color: rgb(248, 248, 242);
76-
background-color: rgb(35, 50, 74);
77-
border: 0px;
78-
box-shadow: none;
94+
/* Code highlight in source code view */
95+
.viewcode-block:target {
96+
background-color: #382927;
7997
}
80-
81-
.highlight-default pre {
82-
color: rgb(248, 248, 242);
83-
background-color: rgb(35, 50, 74);
84-
border: 0px;
85-
box-shadow: none;
86-
} */

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ sphinxcontrib-htmlhelp
3030
sphinxcontrib-jsmath
3131
sphinxcontrib-qthelp
3232
sphinxcontrib-serializinghtml
33+
sphinxcontrib-mermaid

docs/source/_templates/navbar-logo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
<a class="navbar-brand" href="{{ pathto(master_doc) }}">
2525
<p class="title">{{ project }}</p>
2626
</a>
27-
{% endif %}
27+
{% endif %}

docs/source/_templates/sidebar-quicklinks.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<h5 class="card-header font-weight-bold">Version {{ release }}</h5>
33
<div class="card-body">
44
<ul class="list-group list-group-flush list-unstyled quicklinks">
5-
<li><a href="{{ pathto('getting_started/tutorials/index.html', 1) }}"><i class="text-muted fas fa-book fa-fw"></i> Tutorials</a></li>
6-
<li><a href="{{ pathto('release_notes/v' + version + '.html', 1) }}"><i class="text-muted fas fa-newspaper fa-fw"></i> Changelog</a></li>
5+
<li><a href="{{ pathto('release_notes/v' + version + '.html', 1) }}"><i class="text-muted fas fa-newspaper fa-fw"></i> What's New</a></li>
6+
<li><a href="{{ pathto('getting_started/tutorials/index.html', 1) }}"><i class="text-muted fas fa-book fa-fw"></i> Tutorials</a></li>
77
<li><a href="{{ pathto('https://github.com/Project-MONAI/monai-deploy-app-sdk/issues/new/choose', 1) }}"><i class="text-muted fas fa-question-circle fa-fw"></i> Get help</a></li>
88
<li><a href="{{ pathto('introduction/contributing.html', 1) }}"><i class="text-muted fas fa-code-branch fa-fw"></i> Contribute</a></li>
99
</ul>

docs/source/conf.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
# List of patterns, relative to source directory, that match files and
3535
# directories to ignore when looking for source files.
3636
# This pattern also affects html_static_path and html_extra_path.
37-
exclude_patterns = [] # type: ignore
38-
37+
exclude_patterns = ["_build"] # type: ignore
3938

4039
# -- General configuration ---------------------------------------------------
4140

@@ -67,12 +66,17 @@
6766
# https://myst-parser.readthedocs.io/en/latest/sphinx/use.html#automatically-create-targets-for-section-headers
6867
# "sphinx.ext.autosectionlabel", <== don't need anymore from v0.13.0
6968
"sphinx_autodoc_typehints",
69+
"sphinxcontrib.mermaid",
7070
]
7171

7272
autoclass_content = "both"
7373
add_module_names = True
7474
source_encoding = "utf-8"
75-
autosectionlabel_prefix_document = True
75+
# Prefix document path to section labels, to use:
76+
# `path/to/file:heading` instead of just `heading`
77+
# (https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html)
78+
# autosectionlabel_prefix_document = True
79+
# autosectionlabel_maxdepth = 4
7680
napoleon_use_param = True
7781
napoleon_include_init_with_doc = True
7882
set_type_checking_flag = True
@@ -182,14 +186,14 @@
182186
"dollarmath",
183187
"html_admonition",
184188
"html_image",
185-
"linkify",
189+
# "linkify", # disable linkify to not confuse with the file name such as `app.py`
186190
"replacements",
187191
# "smartquotes",
188192
"substitution",
189193
"tasklist",
190194
]
191195
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-header-anchors
192-
myst_heading_anchors = 2
196+
myst_heading_anchors = 4
193197

194198

195199
# -- Options for myst-nb -------------------------------------------------

docs/source/developing_with_sdk/connecting_operators.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# Core concepts
2+
3+
This document introduces the basic concepts of the MONAI Deploy App SDK. If you are eager to try out the SDK in practice, you can start with the tutorial. After the tutorial, you can return to this document to learn more about how MONAI Deploy App SDK works.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# Creating Application class
2+
3+
The Application class is perhaps the most important class that MONAI Deploy App developers will interact with. A developer will inherit a new Application from the monai.core.Application base class. The base application class provides support for chaining up operators, as well as a mechanism to execute the application. The compose method of this class needs to be implemented in the inherited class to instantiate Operators and connect them together to form a Directed Acyclic Graph.

docs/source/developing_with_sdk/executing_docker_image_locally.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Executing packaged app locally
2+
3+
The MONAI Application Runner (MAR) is a command-line utility that allows users to run and test their MONAI Application Package (MAP) locally. MAR is developed to make the running and testing of MAPs locally an easy process for developers and scientists by abstracting away the need to understand the internal details of the MAP. MAR allows the users to specify input and output paths on the local file system which it maps to the input and output of MAP during execution.
4+
5+
## Setting up
6+
7+
MONAI Application Runner comes as a part of the MONAI Deploy CLI and can be accessed as a `run` subcommand to the CLI. You can see the help message for MAR using the following command:
8+
9+
```bash
10+
monai-deploy run --help
11+
```
12+
13+
Output:
14+
15+
```bash
16+
usage: monai-deploy run [-h] [-l {DEBUG,INFO,WARN,ERROR,CRITICAL}] [-q] <map-image[:tag]> <input> <output>
17+
18+
positional arguments:
19+
<map-image[:tag]> MAP image name
20+
<input> Input data path
21+
<output> Output data directory path
22+
23+
optional arguments:
24+
-h, --help show this help message and exit
25+
-l {DEBUG,INFO,WARN,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARN,ERROR,CRITICAL}
26+
Set the logging level (default: INFO)
27+
-q, --quiet Suppress the STDOUT and print only STDERR from the application (default: False)
28+
```
29+
30+
## Syntax
31+
32+
```bash
33+
monai-deploy run <container-image-name>[:tag] <input> <output> [-q|--quiet]
34+
```
35+
36+
### Arguments
37+
38+
#### Positional arguments
39+
40+
| Name | Format | Description |
41+
| -------- | -------------------------------- | ------------------------------------------------------------- |
42+
| MAP | `container-image-name[:tag]` | MAP container image name with or without image tag. |
43+
| input | file or directory path | Local file or folder that contains input dataset for the MAP. |
44+
| output | path | Local path to store output from the executing MAP. |
45+
46+
#### Optional arguments
47+
48+
| Name | Shorthand | Default | Description |
49+
| ------------------- | ---------- | ---------- | -------------------------------------------------------------- |
50+
| quiet | -q | False | Suppress the STDOUT and print only STDERR from the application |
51+
52+
## Example
53+
54+
After you have written your application using MONAI Application SDK and have packaged the application, let's try running it on your workstation using the MONAI Application Runner.
55+
56+
### Example MAP and input
57+
58+
Given the following information.
59+
60+
* MAP name and tag : `monaispleen:latest`
61+
* Input folder : `./spleen_input`
62+
* Output folder : `./spleen_output`
63+
64+
### Launching the application
65+
66+
```bash
67+
monai-deploy run monaispleen:latest spleen_input spleen_output
68+
```
69+
70+
Output:
71+
72+
```bash
73+
Checking dependencies...
74+
--> Verifying if "docker" is installed...
75+
76+
--> Verifying if "monaispleen:latest" is available...
77+
78+
Checking for MAP "monaispleen:latest" locally
79+
"monaispleen:latest" found.
80+
81+
Reading MONAI App Package manifest...
82+
INFO:__main__:Operator started: 2021-09-10 21:53:25.363
83+
INFO:__main__:Input path: /input
84+
INFO:__main__:Output path: /output
85+
...
86+
...
87+
continued...
88+
```
89+
90+
### Launching the application in quiet mode
91+
92+
If you only want to run your application such that the STDOUT is suppressed and only STDERR from the application is printed, try using `--quiet` flag.
93+
94+
```bash
95+
monai-deploy run --quiet monaispleen:latest spleen_input spleen_output
96+
```
97+
98+
:::{note}
99+
* Currently MAR does not validate all resources specified in the MAP manifest.
100+
* If `gpu` is specified (>0), it executes `nvidia-docker` instead of `docker` internally to make sure that GPU is available inside the container.
101+
:::

0 commit comments

Comments
 (0)