Project-MONAI/monai-deploy-app-sdk

[BUG] - Unable to acces docker container created by monai-deploy package

AnilMistry opened this issue · 3 comments

Describe the bug

I'm unable to enter Docker container which is a map, packaged by monai-deploy. I need access to the file structure in the docker for using the packaged map in an Argo workflow.

When running the command:
docker run -it ghcr.io/org/repo/app/map:0.1.0 /bin/bash
gives the error:

fatal: Error converting value "7168Mi" to type 'System.Nullable`1[Monai.Deploy.Common.MemorySize]'. Path resources.memory', line 13, position 26.

Steps/Code to reproduce bug

A Map was created and packages using command:
monai-deploy package --tag ./application ghcr.io/org/repo/app/map:0.1.0 -m application/model/model.ts -l DEBUG

run the command:
docker run -it ghcr.io/org/repo/app/map:0.1.0 /bin/bash

Expected behavior

Expected to be able to enter the the docker image with a bash terminal using the above command

Environment details (please complete the following information)

  • OS/Platform: GNU/Linux 5.4.0-125-generic x86_64
  • Python Version: 3.9
  • Method of MONAI Deploy App SDK install: pip
  • SDK Version: 0.5.0

Additional context

Thanks @AnilMistry for reporting the issue.

Please see this discussion topic on how to run MAP container standalone, without using App SDK CLI or other MONAI Deploy tools and services. It does list out the command and command line options, which can be mapped to Argo workflow templated.

The MAP container itself has a default entrypoint, which loads a MONAI Deploy program (more an assembly implemented in C#) to inspect the MAP specification metadata files in a well-known folder in the container and find out the exact path of the application program/script along with system resource requirements, e.g. GPU, Syst RAM etc. Please bear in mind, this assembly does not integrate with Argo or any host services, and it only tries to inspect the spec requirements and print them out. It is better to go with the approach I mentioned in the discussion and collect the system resources to config Argo template.

I myself is surprised by the fact that the "7168Mi" cannot be correctly converted by the said assembly. In any case, the development of this assembly for default entrypoint had been stopped a long while ago, and we have plans for its replacement/alternative. In any case, "7Gi" should work since "1Gi" is the default.

Also, please use a command similar to what's also in the aforementioned discussion
docker run -ti --rm --gpus=all --entrypoint /bin/bash ghcr.io/mmelqin/monai_ai_lung_seg_app:1.0

Many thanks @MMelQin for the explanation on the entry points. The command has also worked for my current purpose.

Per earlier comments

  • the MAP container has a entry point, so the command provided on starting the docker will only be provided to the entry point as additional parameters, not achieving the desired results.
  • explicitly defining the entrypoint to run /bin/bash with docker CLI along with the interactive terminal flags is the way to start the container and run bash.