Skip to content

Commit

Permalink
fix: zip imports while upload to remotes (#2364)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Liu <timliu@Tims-MBP.attlocal.net>
  • Loading branch information
timliubentoml and Tim Liu committed Mar 22, 2022
1 parent 2dc2cf8 commit cc36fb0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bentoml/saved_bundle/bundler.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ def _write_bento_content_to_dir(bento_service: "BentoService", path: str):
with open(os.path.join(path, "docs.json"), "w") as f:
json.dump(get_open_api_spec_json(bento_service), f, indent=2)

copy_zip_import_archives(
os.path.join(path, bento_service.name, ZIPIMPORT_DIR),
bento_service.__class__.__module__,
list(get_zipmodules().keys()),
bento_service.env._zipimport_archives or [],
)


def save_to_dir(
bento_service: "BentoService", path: str, version: str = None, silent: bool = False
Expand Down Expand Up @@ -245,13 +252,6 @@ def save_to_dir(
else:
_write_bento_content_to_dir(bento_service, path)

copy_zip_import_archives(
os.path.join(path, bento_service.name, ZIPIMPORT_DIR),
bento_service.__class__.__module__,
list(get_zipmodules().keys()),
bento_service.env._zipimport_archives or [],
)

if not silent:
logger.info(
"BentoService bundle '%s:%s' created at: %s",
Expand Down

0 comments on commit cc36fb0

Please sign in to comment.