-
Notifications
You must be signed in to change notification settings - Fork 48
Packaging app
In this step, the MONAI SDK application can now be built into a deployable Docker image using the MONAI Application Packager
The MONAI Application Packager (Packager) is a utility for building an application developed with the MONAI SDK into a structured MONAI application package (MAP).
The MAP produced by the Packager is a deployable and reusable docker image that can be launched locally or remotely
monai-deploy package [Path of MONAI Application Code] -t [Tag for resulting Docker image of MONAI App Package]
-
<MONAI application path>
Path of MONAI Application Code -
--tag, -t
Tag for resulting Docker image of MONAI App Package
The following list contains arguments which have default values or are provided through the SDK if these flags are not invoked. However the user can choose to override these values by invoking these optional flags
-
--base
Base Application Image (overrides default"nvcr.io/nvidia/pytorch:21.07-py3"
) -
--input-dir, -i
Directory mounted in container for Application Input (overrides default"input"
) -
--models-dir
Directory mounted in container for Models Path (overrides default"/opt/monai/models"
) -
--model, -m
Path to local directory containing all application models (will override utilizing models provided within application SDK code) -
--output-dir, -o
Directory mounted in container for Application Output (overrides default"output"
) -
--timeout
Timeout (overrides default0
) -
--version
Version of the Application (overrides default"0.0.0"
) -
--working-dir, -w
Directory mounted in container for Application (overrides default"/var/monai"
)
Given an example MONAI SDK application with its code residing in a directory ./spleen_segmentation_app
, packaging this application with the Packager to create an Docker image tagged monaispleen:latest
would look like this:
$ monai-deploy package ./spleen_segmentation_app -t monaispleen:latest
Building MONAI Application Package...
Successfully built monaispleen:latest
The MAP image monaispleen:latest
will be seen in the list of container images on the user's local machine when docker images
is run. The MAP image monaispleen:latest
will be able to run locally or remotely
- The current implementation (as of
0.0.0
) of the Packager ONLY supports CUDA and Pytorch images fromnvcr.io
as base images for the MAP. There are efforts in progress to add support for smaller images from dockerhub. - This release was developed and tested with CUDA 11 and Python 3.8. There are efforts in progress to add support for different versions of the CUDA tootlkit.
Next Step: Executing Docker Image Locally
See the next page to learn more on how to locally run a MONAI application package image built by the Packager
INTRODUCTION
GETTING STARTED
DEVELOPING WITH SDK
- Core concepts
- Creating Operator classes
- Creating Application class
- Executing app locally
- Packaging app
- Executing packaged app locally
- Deploy to the remote server - coming soon
MODULES