Closed seyong92 closed 4 months ago
I have the same problem, bentoml build
just takes too long and it is hard to debug this. My build ctx is the project root and it contains many directories with a lot of files. I did exclude these in bentofile.yml but maybe this is the problem.
Hi there, is there a virtualenv folder under this build directory?
Hi, yes there is. I looked at the code and noticed that for each file to be included, the entire directory structure from the build context is traversed to look for and parse .bentoignore
files, which is very time consuming if the build directory contains a lot of files and directories. Wouldn't it make sense here to only step through the included directories?
if you add the venv folder to the ignore file it will fix the issue.
Unfortunately, it didn't.
If I understood correctly, it iterates unfiltered through the entire build directory and compares each path first with the included and excluded paths from the bentofile.yaml and then with the excluded paths from the .bentoignore file and copies them to the target directory accordingly or not.
Here, however, the entire build directory is iterated through again at each iteration to search for .bentoignore files and parse the contents unless the path has already been excluded in bentofile.yaml.
Wouldn't it make sense here to use the filter_dirs
and exclude_dirs
parameters of the fs.walk()
function to pre-filter for the paths included and excluded in bentofile.yaml and do the same in the specs.from_path()
method?
This has been improved in the latest versions of bentoml
Describe the bug
In "bentofile.yaml", we only include "*.py" file and some text files, but it takes a too long time to build bento.
It takes more than 1 hour for building bentos, and the created bento is just around 50 MB.
When I use "--verbose" tag when using "bento build", it does not return anything, so I cannot know the reason.
To reproduce
I just share the "bentofile.yaml" file of my project.
Expected behavior
No response
Environment
bentoml: 1.0.10 python: 3.9.13