How can I run a MAP container without using App SDK CLI #340
Replies: 3 comments 10 replies
-
Great to see this! Idea to consider - move these utils to a /examples/utils folder (or similar) so they are ready to go. |
Beta Was this translation helpful? Give feedback.
-
I looked at this script and I tried to invoke the image directly to get an internal interactive shell: $ docker run -ti --rm --gpus=all ghcr.io/mmelqin/monai_ai_lung_seg_app:1.0 --entrypoint /bin/bash
fatal: Conversion from Nullable`1 to SemanticVersion is not supported. Is there something wrong with this command to get a shell in the container? My Docker version is 20.10.12. |
Beta Was this translation helpful? Give feedback.
-
hi, @MMelQin @vikashg
This is the error i got. The transform used in the SkullStripOperator are
Post-transform
Please can anyone help me with this problem. |
Beta Was this translation helpful? Give feedback.
-
**Note the main section after this note is applicable to MAP built with the v5.x and below of the App SDK. For MAP built with v0.6, the script and command still works except for the replacement of
monai
withholoscan
where the word appears in the file path, attributes, etc.For example, to run this MAP that is built with MONAI Deploy App SDK v0.6, ghcr.io/mmelqin/monai_ai_livertumor_seg_app_no_stl-x64-workstation-dgpu-linux-amd64:2.0, you would do as the following,
And if using container image internal folder (to avoid extracting test data and mapping host folders to the container, use the following command,
**
As part of the IHE Conntectathon IAIP, a couple MONAI Application Packages, MAPs, have been published on Github Container Registry, namely
Questions are
The MAP has a defined set of inputs along with a set of required environment variables, and these are defined in a couple JSON files in the MAP container image. The App SDK CLI command,
run
, inspects and sets them correctly. Anexecutor
embedded in the MAP container image does perform the similar functions but it is tied to a specific platform. Without using these couple helpers, one can still just run a MAP as Docker container with the bash script provided below. Simple, isn't it?To help with test data preparation, these couple MAPs also contains a DICOM series each as test input; the test DICOM was converted from Medical Decathlon training and validation image dataset. The script below thus also supports extracting the test data to a host folder,
map_extracted
, for users to inspect with a DICOM viewer, as well as test input to the Docker container.At runtime, the script also try its best to preserve the input and output,
map_extracted
andmap_output
, from last run tomap_extracted_previous
andmap_output_previous
. Only one last version is preserved though; good enough for running the two MAP, in case one forgets to move the data to more permeant folders.To prepare the script
run_map_container.sh
chmod +x run_map_container.sh
The script supports two (2) positional arguments
ghcr.io/mmelqin/monai_ai_lung_seg_app:1.0
If both are missing, default MAP image is used per definition in the script, and DICOM series extracted from the image to host folder
map_extracted
. In the case when the second positional argument is missing, it also means the DICOM series will be extracted.One important note is that, with Docker installed, Nvidia Container Toolkit and/or nvidia-docker 2 needs to be installed for support of GPU.
So please give it a spin, and let us know if there are any issues. Kudos are welcome, too!
Beta Was this translation helpful? Give feedback.
All reactions