AWS Sagemaker deployment - Permission denied to /home/bentoml/bentos directory
adamwawrzynski opened this issue · 1 comments
adamwawrzynski commented
Describe the bug
To Reproduce
- Create model following this tutorial: https://github.com/bentoml/BentoML/tree/main/examples/quickstart
- Deploy model using this tutorial: https://github.com/bentoml/aws-sagemaker-deploy
- Watch CloudWatch of newly created endpoint
Expected behavior
Sklearn model deployed to AWS Sagemaker doesn't start due to permission denied error.
Screenshots/Logs
Service can't properly launch. Logs from Cloud Watch:
Inference server exiting
PermissionError: [Errno 13] Permission denied: '/home/bentoml/bentos'
Traceback (most recent call last):
File "/usr/local/bin/bentoml", line 5, in <module>
from bentoml_cli.cli import cli
File "/usr/local/lib/python3.10/site-packages/bentoml_cli/cli.py", line 57, in <module>
cli = create_bentoml_cli()
File "/usr/local/lib/python3.10/site-packages/bentoml_cli/cli.py", line 42, in create_bentoml_cli
add_bento_management_commands(bentoml_cli)
File "/usr/local/lib/python3.10/site-packages/bentoml_cli/bentos.py", line 74, in add_bento_management_commands
bento_store = BentoMLContainer.bento_store.get()
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 72, in get
return self._provide()
File "/usr/local/lib/python3.10/site-packages/simple_di/providers.py", line 124, in _provide
value = super()._provide()
File "/usr/local/lib/python3.10/site-packages/simple_di/providers.py", line 103, in _provide
return inject(self._func)(
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 139, in _
return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 104, in _inject_args
return tuple(a.get() if isinstance(a, Provider) else a for a in args)
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 104, in <genexpr>
return tuple(a.get() if isinstance(a, Provider) else a for a in args)
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 72, in get
return self._provide()
File "/usr/local/lib/python3.10/site-packages/simple_di/providers.py", line 124, in _provide
value = super()._provide()
File "/usr/local/lib/python3.10/site-packages/simple_di/providers.py", line 103, in _provide
return inject(self._func)(
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 139, in _
return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 104, in _inject_args
return tuple(a.get() if isinstance(a, Provider) else a for a in args)
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 104, in <genexpr>
return tuple(a.get() if isinstance(a, Provider) else a for a in args)
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 72, in get
return self._provide()
File "/usr/local/lib/python3.10/site-packages/simple_di/providers.py", line 124, in _provide
value = super()._provide()
File "/usr/local/lib/python3.10/site-packages/simple_di/providers.py", line 103, in _provide
return inject(self._func)(
File "/usr/local/lib/python3.10/site-packages/simple_di/__init__.py", line 139, in _
return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
File "/usr/local/lib/python3.10/site-packages/bentoml/_internal/configuration/containers.py", line 196, in bentoml_home
validate_or_create_dir(home, bentos, models, envs, tmp_bentos)
File "/usr/local/lib/python3.10/site-packages/bentoml/_internal/utils/__init__.py", line 152, in validate_or_create_dir
path_obj.mkdir(parents=True)
File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
Environment:
- OS: [e.g. MacOS 10.14.3]: Ubuntu 22.04.01
- Python Version [e.g. Python 3.7.1]: 3.10.12
- BentoML Version [e.g. BentoML-0.8.6]: 1.1.11
- Bentoctl Version [e.g. bentoctl-0.1]: 0.4.0
Additional context
adamwawrzynski commented
Can't reproduce right now. I changed permissions to /home/user/bentoml
directory, which is copied during Docker image building, and this might solve the problem.