I advanced a bit further. I have issues with packa...
# ask-for-help
m
I advanced a bit further. I have issues with packages with compiled extensions now. The packages are mainly git repos. The UV seems to make source tarballs out of the git repos and just installs the python sources without building. The wheel directory seems no longer supported. How to proceed with the packages with compiled extensions?
I'm now reinstalling / compiling affected packages with pip which takes ages and feels sketchy:
Copy code
Image(...) \
    .run("pip uninstall -y xtcocotools") \
    .run("pip install git+<https://github.com/.../xtcocotools.git@master>") \
    .run("pip uninstall -y mmcv") \
    .run("mim install mmcv")
j
Hello, what is your full pipeline? how can we reproduce your issue
m
I need to install
mmcv
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.
I could have also solved the problem by fixing the docker file in bento store (
env/docker/Dockerfile
), but the file is not used in containerization and a new one is generated 🤯
To reproduce: pyproject.toml
Copy code
...
dependencies = [
    "torch", 
    "mmcv",
]
...
Copy code
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
torch
j
@Frost Ming do you have suggestions here?
f
you can enable
no build isolation
and go with the two steps installation
every uv option has a corresponding env var to enable it
👍 1
m
Nice, so I'll set env variable in
Image(...).run(...)
and proceed with the second stage of installation, right? What about the build times and use of prebuild wheels?
f
as the code implies it is not supported now