This message was deleted.
# ask-for-help
s
This message was deleted.
a
Hi trying not to be a pain here but can you format the code in the codeblock?
It seems like azureml is missing. Maybe you can try adding the dependencies into requirements.txt
s
Dependency is installed on environment.but when i am containerizing it and running it is giving me this error.Do i need to add this dependencyin bentofile.yaml file too?
a
Can you send your service.py? It seems like runner is setup incorrectly
s
import json import pandas as pd #from pydantic import BaseModel from typing import Dict, Any import bentoml import azureml #from bentoml.io import JsonInput, JsonOutput from bentoml.io import JSON # Pull the model as model reference (it pulls all the associate metadata of the model) model_ref = bentoml.sklearn.get('ml_model:latest') #print(model_ref) # Create the model runner (it can also scale the model separately) model_runner = model_ref.to_runner() # Create the service 'machine_learning_prediction' and pass the model svc = bentoml.Service('machine_learning_prediction', runners=[model_runner]) @svc.api(input=JSON(), output=JSON()) def classify(input_data: Dict[str, Any]) -> Dict[str, Any]: input_df = pd.DataFrame([input_data]) results = model_runner.predict.run(input_df).tolist() return {"predictions": results}
a
You will still need to provide the requirements to the bentofile, as we don’t do any automatic dependency resolution atm from the service definition
Possible missing requirements https://pypi.org/project/azureml-automl-core/?
s
service: "service.py:svc" # Same as the argument passed to bentoml labels: owner: Sarthak project: deployment stage: development include: - "*.py" # A pattern for matching which files to include in the bento python: packages: # Additional pip packages required by the service - scikit-learn - pandas - xgboost - azureml-automl-core Added this in bentofile.yaml.Is it OK?
a
yes you can try that
👍 1
s
Now this is returning me error while trying to containerize the bento... (newenv) C:\Users\UR277MH\OneDrive - EY\Work\us_test\Deploy_FS>bentoml containerize machine_learning_prediction:kot3egij52h6d6e6 Building OCI-compliant image for machine_learning_prediction:kot3egij52h6d6e6 with docker executor failed running [/bin/sh -c bash -euxo pipefail /home/bentoml/bento/env/python/install.sh]: exit code: 1 Encountered exception while trying to building image: Command '['C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.EXE', 'build', '--tag', 'machine_learning_prediction:kot3egij52h6d6e6', '--file', 'C:\\Users\\UR277MH\\AppData\\Local\\Temp\\tmpn92am14mfsTempFS\\env\\docker\\Dockerfile', 'C:\\Users\\UR277MH\\AppData\\Local\\Temp\\tmpn92am14mfsTempFS\\']' returned non-zero exit status 1. Traceback (most recent call last): File "C:\Users\UR277MH\Anaconda3\envs\newenv\lib\site-packages\bentoml\_internal\container\init__.py", line 222, in build return builder.build(**kwargs) File "C:\Users\UR277MH\Anaconda3\envs\newenv\lib\site-packages\bentoml\_internal\container\base.py", line 196, in build raise BentoMLException(str(e)) from None bentoml.exceptions.BentoMLException: Command '['C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.EXE', 'build', '--tag', 'machine_learning_prediction:kot3egij52h6d6e6', '--file', 'C:\\Users\\UR277MH\\AppData\\Local\\Temp\\tmpn92am14mfsTempFS\\env\\docker\\Dockerfile', 'C:\\Users\\UR277MH\\AppData\\Local\\Temp\\tmpn92am14mfsTempFS\\']' returned non-zero exit status 1.
Any help?
s
Seems like package installation issues. If it used it work, could you troubleshoot which package introduced this error?
s
service: "service.py:svc" # Same as the argument passed to bentoml labels: owner: Sarthak project: deployment stage: development include: - "*.py" # A pattern for matching which files to include in the bento python: packages: # Additional pip packages required by the service - scikit-learn - pandas - xgboost - azureml-automl-core When I am adding azureml-automl-core in bentofile.yaml,it is not able to containerize. But when I remove it,it is able to do the job perfectly.
Any insights on why this is happening
s
Are you able to
pip install azureml-automl-core
s
No
s
I think that’s the source of the error.