serve icon indicating copy to clipboard operation
serve copied to clipboard

Docker: How to add your .mar files?

Open FrancescoSaverioZuppichini opened this issue 6 years ago • 3 comments

Dear all,

Could you please update the doc showing how to use your .mar files and model-store dir with docker? Assuming I have a stored .mar and model-store dir locally on my pc and I want to run torchserve on docker with them, what should I do? Is there an option to add the mar file? The docker page of torchserve doesn't contain information.

Thank you.

Be safe and best regards,

Francesco Saverio

Hi @FrancescoSaverioZuppichini is the idea to keep a persistent model store dir? If so, then you could use -v option in docker to map your host's local directory to docker's mounted filesystem and provide the path.

Be sure to provide the Docker's view of the path as model store. It points to /home/model-server/model-store inside the docker if you used the sample config. Refer: this config file

Let's consider the following instructions page

docker run --rm -it -p 8080:8080 -p 8081:8081 pytorch/torchserve:0.1-cpu

You would change the above to

docker run --rm -it -p 8080:8080 -p 8081:8081 -v <LOCAL HOST DIR>:/home/model-server/model-store pytorch/torchserve:0.1-cpu

If this makes sense, feel free to make a PR I will be happy to review :) Thanks.

mycpuorg avatar May 13 '20 22:05 mycpuorg

@mycpuorg @FrancescoSaverioZuppichini Discussion is in progress to add such a support #195 should address this.

codinnvrends avatar May 14 '20 04:05 codinnvrends

@dhaniram-kshirsagar Thank you :)