Matěj Šmíd
04/30/2025, 7:26 PMMatěj Šmíd
05/01/2025, 3:29 AMImage(...) \
.run("pip uninstall -y xtcocotools") \
.run("pip install git+<https://github.com/.../xtcocotools.git@master>") \
.run("pip uninstall -y mmcv") \
.run("mim install mmcv")Jian Shen Yap
05/02/2025, 3:42 AMMatěj Šmíd
05/05/2025, 11:46 AMmmcv package with binary extensions compiled against torch package. uv builds packages in isolation which doesn't work on packages like this (see uv issue). pip and uv solves this problem with --no-build-isolation and two staged installation: first torch , then the dependent package build without isolation.
I can workaround that with reinstall as written above. The problem is that the package build takes ~ 8 minutes.
Probably the best option would be to use prebuild wheel, but the option is no longer supported in bentoml. btw: I found out that tool.bentoml.build.python.pip_args is also no longer supported, but it is nowhere documented, it is just missing in the base_v2.j2 Dockerfile template file.Matěj Šmíd
05/05/2025, 11:52 AMenv/docker/Dockerfile), but the file is not used in containerization and a new one is generated 🤯Matěj Šmíd
05/05/2025, 12:13 PM...
dependencies = [
"torch",
"mmcv",
]
...
bentoml build ...
bentoml containerize ...
docker run -it --rm -p 3000:3000 ... bash
# in the container
python -c "from mmcv.ops.roi_align import roi_align"
importing mmcv.ops fails because mmcv was installed in isolation without torchJian Shen Yap
05/06/2025, 8:46 AMFrost Ming
05/06/2025, 8:51 AMno build isolation and go with the two steps installationFrost Ming
05/06/2025, 8:52 AMMatěj Šmíd
05/06/2025, 8:57 AMImage(...).run(...) and proceed with the second stage of installation, right?
What about the build times and use of prebuild wheels?Frost Ming
05/06/2025, 8:59 AM