aws / aws/sagemaker-pytorch-inference-toolkit
MultiDataModel fails at installing requirements.txt
- Dominant language
- Python
- Stars
- 143
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
The packages in `requirements.txt` are not installed, when deploying a MultiDataModel with Sagemaker.
**To reproduce**
Deploy a model to sagemaker that depends on `requirements.txt` installing specific packages, e.g. pandas.
My architecture looks like this:
```
model.tar.gz/
| - ....
| - code/
| - inference.py
| - requirements.txt
```
**Expected behavior**
It is expected that the requirements are installed.
**Additional context**
I first had the same issues as [here](https://github.com/aws/sagemaker-pytorch-inference-toolkit/issues/61), which is solved by the `inference.py` being be included in the model.tar.gz - but it also indicates that all files inside `/opt/ml/model` are removed when the image is being spun up. I suspect that `requirements.txt` is therefore also removed and first "recovered" again later, when the model.tar.gz is unpacked. This would explain why the requirements are never installed.
Contributor guide
Research direction
Reproduce the deployment with a model.tar.gz containing code/inference.py and code/requirements.txt, using a package such as pandas. First inspect how the SageMaker model archive is unpacked and how requirements.txt is discovered; done means the listed requirements are installed during MultiDataModel deployment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- cloud, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100