Steps for running model archive from docker
Add the steps for how to do the model archive when using torchserve docker containers
Please add me to the review when these steps are created.
@chauhang Assuming this is only for the local containers as remote containers should pull mar files from S3/other public URL. For local container, user can use either
a. docker cp <marFile> <container_name>:<target_dir>
OR
b. Share mar files by mapping local dir. with model-store dir. in container e.g.
docker run --rm -p 8080:8080 -p 8081:8081 -v /Users/user1/model-store:/home/model-server/model-store -t torchserve_image:1.0 torchserve --start --model-store /home/model-server/model-store
Once confirmed, will go ahead and update docker doc with additional steps for this.
@dhaniram-kshirsagar This is for creation of the .mar file. If someone is using docker for running everything they need steps for how to invoke this for a docker setup.
There can be two options:
Option A
Easy option is to run the docker in interactive mode with a volume mount of folder that has the model source files and the model store (destination) and then inside the docker manually run the torch-model-archiver command to generate the mar file eg
docker run --rm -p 8080:8080 -p 8081:8081 -v $(pwd)/model-store:/model-store -v $(pwd)/examples:/examples torchserve:latest bash
model-server@98b1c682955c:~$ torch-model-archiver ...
Option B
Provide steps to launch torch-model-archiver from the docker run eg
docker run --rm -p 8080:8080 -p 8081:8081 -v $(pwd)/model-store:/model-store -v $(pwd)/examples:/examples torchserve:latest torch-model-archiver --model-name densenet161 --version 1.0 --model-file /examples/image_classifier/densenet_161/model.py --serialized-file /examples/image_classifier/densenet161-8d451a50.pth --export-path /model-store --extra-files /examples/image_classifier/index_to_name.json --handler image_classifier
Added steps in #308 under docker/README.md#docker_torch_model_archiver