Slackbot
12/21/2022, 8:37 AMJiang
12/21/2022, 9:02 AMbentoml serve
definitely should not require yatai login.Jiang
12/21/2022, 9:02 AMJiang
12/21/2022, 9:02 AMbentoml serve
with --debug
flag for more error details?ABC
12/21/2022, 9:06 AMhost:<http://hc-prd-mlflow-bucket.s3.amazonaws.com|hc-prd-mlflow-bucket.s3.amazonaws.com>
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20221221T083515Z
host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2022-12-21T14:05:15+0530 [DEBUG] [cli] StringToSign:
AWS4-HMAC-SHA256
20221221T083515Z
20221221/us-east-1/s3/aws4_request
90709d00874a430dc0236bc9f533b93aa0ed3abc1a5cc43443a2da8300dc6e4a
2022-12-21T14:05:15+0530 [DEBUG] [cli] Signature:
0c67eec693a47dd2eb6257cfb93dc48f5d35de5fb71c4e65b4ffdf48d8620c59
2022-12-21T14:05:15+0530 [DEBUG] [cli] Event request-created.s3.GetObject: calling handler <function signal_transferring at 0x1253590d0>
2022-12-21T14:05:15+0530 [DEBUG] [cli] Event request-created.s3.GetObject: calling handler <function add_retry_headers at 0x12499fca0>
2022-12-21T14:05:15+0530 [DEBUG] [cli] Sending http request: <AWSPreparedRequest stream_output=True, method=GET, url=<https://hc-prd-mlflow-bucket.s3.amazonaws.com/bentoml/model/example.bentomodel>, headers={'User-Agent': b'Boto3/1.26.33 Python/3.9.15 Darwin/22.1.0 Botocore/1.29.33', 'X-Amz-Date': b'20221221T083515Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIA5KENQZGPEG3BIWE3/20221221/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=0c67eec693a47dd2eb6257cfb93dc48f5d35de5fb71c4e65b4ffdf48d8620c59', 'amz-sdk-invocation-id': b'5d30d53f-6d95-42e9-953f-cc8354b6d3d2', 'amz-sdk-request': b'attempt=1'}>
2022-12-21T14:05:15+0530 [DEBUG] [cli] <https://hc-prd-mlflow-bucket.s3.amazonaws.com:443> "GET /bentoml/model/example.bentomodel HTTP/1.1" 200 694872
2022-12-21T14:05:15+0530 [DEBUG] [cli] Response headers: {'x-amz-id-2': 'mbwLytHN8rUEUO9cK9hs0Z8LPhE+o8s59pWAb3/8jQjQmTvW2i81a8X7/UAb7sDuPV3BUTsBXMo+GouRwYZsPw==', 'x-amz-request-id': '1R4NZBCPS1S75328', 'Date': 'Wed, 21 Dec 2022 08:35:16 GMT', 'Last-Modified': 'Wed, 21 Dec 2022 08:11:30 GMT', 'ETag': '"2be59b6a569838497412c1f868d18693"', 'Accept-Ranges': 'bytes', 'Content-Type': 'binary/octet-stream', 'Server': 'AmazonS3', 'Content-Length': '694872'}
2022-12-21T14:05:15+0530 [DEBUG] [cli] Response body:
<botocore.response.StreamingBody object at 0x1254d8a30>
2022-12-21T14:05:15+0530 [DEBUG] [cli] Event needs-retry.s3.GetObject: calling handler <botocore.retryhandler.RetryHandler object at 0x1254a4f10>
2022-12-21T14:05:15+0530 [DEBUG] [cli] No retry needed.
2022-12-21T14:05:15+0530 [DEBUG] [cli] Event needs-retry.s3.GetObject: calling handler <bound method S3RegionRedirectorv2.redirect_from_error of <botocore.utils.S3RegionRedirectorv2 object at 0x1254a4fd0>>
2022-12-21T14:05:19+0530 [DEBUG] [cli] IOWriteTask(transfer_id=0, {'offset': 0}) about to wait for the following futures []
2022-12-21T14:05:19+0530 [DEBUG] [cli] IOWriteTask(transfer_id=0, {'offset': 0}) done waiting for dependent futures
2022-12-21T14:05:19+0530 [DEBUG] [cli] Executing task IOWriteTask(transfer_id=0, {'offset': 0}) with kwargs {'fileobj': <_io.BufferedWriter name=b'/var/folders/q2/zp1ts4yj36n_wlqb711d2y5r0000gq/T/tmpi75gwt4nbentoml-example.bentomodel-import/example.bentomodel'>, 'offset': 0}
2022-12-21T14:05:20+0530 [DEBUG] [cli] IOWriteTask(transfer_id=0, {'offset': 262144}) about to wait for the following futures []
2022-12-21T14:05:20+0530 [DEBUG] [cli] IOWriteTask(transfer_id=0, {'offset': 262144}) done waiting for dependent futures
2022-12-21T14:05:20+0530 [DEBUG] [cli] Executing task IOWriteTask(transfer_id=0, {'offset': 262144}) with kwargs {'fileobj': <_io.BufferedWriter name=b'/var/folders/q2/zp1ts4yj36n_wlqb711d2y5r0000gq/T/tmpi75gwt4nbentoml-example.bentomodel-import/example.bentomodel'>, 'offset': 262144}
2022-12-21T14:05:20+0530 [DEBUG] [cli] IOWriteTask(transfer_id=0, {'offset': 524288}) about to wait for the following futures []
2022-12-21T14:05:20+0530 [DEBUG] [cli] IOWriteTask(transfer_id=0, {'offset': 524288}) done waiting for dependent futures
2022-12-21T14:05:20+0530 [DEBUG] [cli] Executing task IOWriteTask(transfer_id=0, {'offset': 524288}) with kwargs {'fileobj': <_io.BufferedWriter name=b'/var/folders/q2/zp1ts4yj36n_wlqb711d2y5r0000gq/T/tmpi75gwt4nbentoml-example.bentomodel-import/example.bentomodel'>, 'offset': 524288}
2022-12-21T14:05:20+0530 [DEBUG] [cli] CompleteDownloadNOOPTask(transfer_id=0, {}) about to wait for the following futures []
2022-12-21T14:05:20+0530 [DEBUG] [cli] CompleteDownloadNOOPTask(transfer_id=0, {}) done waiting for dependent futures
2022-12-21T14:05:20+0530 [DEBUG] [cli] Executing task CompleteDownloadNOOPTask(transfer_id=0, {}) with kwargs {}
2022-12-21T14:05:20+0530 [DEBUG] [cli] Releasing acquire 0/None
2022-12-21T14:05:21+0530 [DEBUG] [cli] Tracking Error: Not found default yatai context, please login!
Error: [bentoml-cli] `serve` failed: Item 'example:bg5scseba6lmjlg6' already exists in the store <osfs '/Users/abhishekchoudhary/bentoml/bentos/example/e4dbxeua7ogwblg6/models'>
Traceback (most recent call last):
File "/Users/abhishekchoudhary/.pyenv/versions/test_env/bin/bentoml", line 8, in <module>
sys.exit(cli())
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml_cli/utils.py", line 273, in wrapper
raise err from None
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml_cli/utils.py", line 268, in wrapper
return func(*args, **kwargs)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml_cli/utils.py", line 239, in wrapper
return_value = func(*args, **kwargs)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml_cli/utils.py", line 196, in wrapper
return func(*args, **kwargs)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml_cli/serve.py", line 211, in serve
serve_http_development(
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/simple_di/__init__.py", line 139, in _
return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml/serve.py", line 191, in serve_http_development
svc = load(bento_identifier, working_dir=working_dir)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml/_internal/service/loader.py", line 368, in load
svc = load_bento(bento_identifier, standalone_load=standalone_load)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/simple_di/__init__.py", line 139, in _
return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml/_internal/service/loader.py", line 221, in load_bento
return _load_bento(bento, standalone_load)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml/_internal/service/loader.py", line 247, in _load_bento
svc = import_service(
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/simple_di/__init__.py", line 139, in _
return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml/_internal/service/loader.py", line 137, in import_service
module = importlib.import_module(module_name, package=working_dir)
File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/abhishekchoudhary/bentoml/bentos/example/e4dbxeua7ogwblg6/src/bento_service.py", line 18, in <module>
bento_model = bentoml.models.import_model(
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/simple_di/__init__.py", line 139, in _
return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml/models.py", line 117, in import_model
return Model.import_from(
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml/_internal/models/model.py", line 216, in _save
with model_store.register(self.tag) as model_path:
File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/Users/abhishekchoudhary/.pyenv/versions/3.9.1/envs/test_env/lib/python3.9/site-packages/bentoml/_internal/store.py", line 166, in register
raise BentoMLException(
bentoml.exceptions.BentoMLException: Item 'example:bg5scseba6lmjlg6' already exists in the store <osfs '/Users/abhishekchoudhary/bentoml/bentos/example/e4dbxeua7ogwblg6/models'>
Jiang
12/21/2022, 9:20 AMABC
12/21/2022, 9:21 AMJiang
12/21/2022, 9:29 AMimport model
API basically means importing a model into the user model store.Jiang
12/21/2022, 9:31 AMbentoml build
, bentoml
will pack the models into the generated bento.Jiang
12/21/2022, 9:33 AMJiang
12/21/2022, 9:37 AMbentoml.models.get
here to get the model from the models storeABC
12/21/2022, 9:37 AMABC
12/21/2022, 9:38 AMABC
12/21/2022, 9:38 AMJiang
12/21/2022, 9:39 AMJiang
12/21/2022, 9:40 AMbentoml models import <s3>
Jiang
12/21/2022, 9:40 AMbentoml build
Jiang
12/21/2022, 9:40 AMJiang
12/21/2022, 9:43 AM$ cd /patj/to/our_bentoml_project
$ bentoml models import <s3>
$ bentoml build
$ bentoml export <the bento> ./
$ cp ./<the bento> /to/the/dest
Jiang
12/21/2022, 9:43 AMABC
12/21/2022, 9:43 AMJiang
12/21/2022, 9:45 AMbentoml.models.get
instead of bentoml.models.import_model
in the bento_service.py
, of course. They are way diffrent.Alexander Keijser
03/14/2023, 12:10 PMbentoml.models.import_model
to import a model from MLFlow directly, so it can be used in the bentoml service definition.Alexander Keijser
03/20/2023, 8:57 AMJiang
04/13/2023, 1:39 AMAlexander Keijser
04/17/2023, 10:48 AM