This message was deleted.
# ask-for-help
s
This message was deleted.
b
Could u publish this onto a private pypi server?
Otherwise just including the files should work. Normally you would do
Copy code
service: "service:svc"  # Same as the argument passed to `bentoml serve`
labels:
    owner: bentoml-team
    stage: dev
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
Notice the
include
part
n
That's what i did in the first try and the build worked ok. The problem was that when i ran
bentoctl apply
, the new instance creation timeouts and does not start
So my guess was that it doesn't install the package correctly
b
how do u normally install the package?
n
The package has to be installed like this
pip install git+<https://github.com/sberbank-ai/Real-ESRGAN.git>
But i cannot add the
git+<https://github.com/sberbank-ai/Real-ESRGAN.git>
into the requirements.txt so i had to clone the repository and install it locally
My requirements.txt file now looks like this:

https://i.gyazo.com/14a6b57ec65951864c3a7d06eae1c2d4.png

and it works when i start the bento but fails when i try to push it to an EC2 instance
And this is the
bentofile.yaml
in the
fp16
directory:

https://i.gyazo.com/5b2846a1b430327fcb429551c98fbb83.png

b
Hmm why can't your add it into the requirements.txt file?
n
Because when i run
bentoctl build
i get the following error:
No such file or directory: 'git' while executing command git version
b
hmmmmm
o hwait
Copy code
docker:   
  system_packages:
    - git
would this work?
The error would make sense if there's no
git
n
Hmmmm, makes sense
Let me try like this
👍 1
b
any luck?
n
Sorry, had to do a cleanup before retrying
I am on the build phase now
🤘 1
Build worked this time ❤️
Thank you so much
Trying to apply now
The apply failed with
Max attempts reached
..
b
haha one problem solved
what does
apply
do?
Oh it's a
bentoctl
command
i guess it's a terraform thing?
n
Sorry for the late reply
Yes, bentoctl apply creates an AWS EC2 Instance and starts the stable diffusion bento service. The problem is that an error occures during the process and the service doesn't start
Unfortunately i cannot check the logs and i have to guess what the problem is apparently
b
if u run
bento containerize <your-service>
can u launch it locally?
n
When i run
BENTOML_CONFIG=configuration.yaml bentoml serve service:svc --production
the API launches locally and works perfectly
The problem occurs when i try to upload it to the EC2 instance, that's why i'm thinking the problem might be related to how i defined things in the bentofile.yaml
Just tried to run bentoml containerize and it worked. But when i run
docker run -it --rm -p 3000:3000 stable_diffusion_fp16:dhga3idpfsdrl22z serve --production
i get the following error: `[bentoml-cli]
serve
failed: Failed loading Bento from directory /home/bentoml/bento: Failed to import module "service": libGL.so.1: cannot open shared object file: No such file or directory`
b
U need cuda I assume
Same with ur amazon instance (gpu)
n
Yes, but i am running it from an instance that is identical to the one that i am trying to push to
b
Do u have cuda in the container?
n
Honestly i don't know how to check that. Trying to find an answer now
b
Shell into it and 'nvidia-smi'
Did u specify a cuda version in the bentofile?
n
Yes, here is a ss of my bentofile

https://i.gyazo.com/19df95d5013a2698d62abb06e8d1f0ee.png

b
libgl1-mesa-glx
U might need this as a system package
n
Alright, trying now
Still no luck, i am getting the same error when i run
docker run --gpus all -p 3000:3000 stable_diffusion_fp16:dhga3idpfsdrl22z
`[bentoml-cli]
serve
failed: Failed loading Bento from directory /home/bentoml/bento: Failed to import module "service": libGL.so.1: cannot open shared object file: No such file or directory`
And i cannot shell into it as it is not running
b
you should be able to do a
docker exec -it ...
or
docker run --it -rm ...
n
Hello, sorry for the delay
Trying now the docker exec
Finally made it to work, docker run executes without any error
Tested the endpoints too and everything is ok locally
b
Yay
How did u fix it
n
Found on stackoverflow that i had to add these system packages too: - ffmpeg - libsm6 - libxext6
I'm not sure which one fixed it though
Trying to run
bentoctl apply
now, hope it works 🤞
b
Good luck!!
❤️ 1
n
Aaaaand it works!!
Thank you so much for helping me out and for your patience
One day i'll give a beer for this, haha
🍻 1
b
Woo hoo!
Good job 👏
🏁 1