Closed iakremnev closed 2 years ago
I've seen this and related issues mentioned quite a few times #1410, #608, in slack . The suggested workaround is to import all the required modules in the module with BentoService class definition. So it's rather a feature suggestion, than a bug report: trace required modules for the artifact that is packed.
@iakremnev Thank you for the reproducible repo! We are working on new user facing APIs that will make it a lot easier for users to include files
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issues has been resolved in the upcoming BentoML 1.0 release.
In BentoML 1.0, a project root must be specifically defined by placing a bentofile.yaml file in the directory. This file specifies all the Bento build configs, including what are the files to include in the final Bento built. The project root also should be seen as the CWD in your service's python environment, as well as part of the import path in sys.path. A more detailed explanation can be found here: https://github.com/bentoml/BentoML/tree/main/bentoml/_internal/bento
Describe the bug
Required modules from the local development package are not imported to the service bundle when packing a service with artifacts.
To Reproduce
As a result, the service can't import
mypackage.model
sincemodel.py
is not bundled.Expected behavior
Code for model class definition and any preprocessing is bundled with the service.
Environment:
Additional context