Attempting to deploy to SageMaker or Lambda fails with this error:
Error: sagemaker deploy failed: INTERNAL:<dependency_injector.wiring.Provide object at 0x11f748be0> has type Provide, but expected one of: bytes, unicode
To Reproduce
This is based on the latest version of the code as of this writing
Start remote Yatai server
Configure BentoML to use the remote Yatai server (e.g. by modifying default_bentoml.yml
Start a deployment to SageMaker or Lambda (without specifying a namespace through the --namespace option
The error message above is shown
Expected behavior
Deployment should proceed normally, and the error message should not be displayed.
self.default_namespace is not wired / injected properly, and will instead be a Provide object. This causes issues downstream as a string is expected. A workaround is to specify the environment when deploying via the CLI (--namespace).
Describe the bug
Attempting to deploy to SageMaker or Lambda fails with this error:
To Reproduce
This is based on the latest version of the code as of this writing
default_bentoml.yml
--namespace
optionExpected behavior Deployment should proceed normally, and the error message should not be displayed.
Environment:
Additional context
After some initial debugging, the error appears to originate from this line: https://github.com/bentoml/BentoML/blob/4019bac4af320bad73bf960f6bd2d617f3fd4a52/bentoml/yatai/yatai_service_impl.py#L106
self.default_namespace
is not wired / injected properly, and will instead be aProvide
object. This causes issues downstream as a string is expected. A workaround is to specify the environment when deploying via the CLI (--namespace
).My hunch is that
YataiServiceImpl
does not get properly wired/injected due to it being wrapped in theget_yatai_service_impl
method here:https://github.com/bentoml/BentoML/blob/4019bac4af320bad73bf960f6bd2d617f3fd4a52/bentoml/yatai/yatai_service_impl.py#L74I have little experience with dependency injection so couldn't figure out why it wouldn't get wired properly.