-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UV Refactor with Docker CPU #944
base: main
Are you sure you want to change the base?
Conversation
"torch>=2.0.1,<=2.4.0", | ||
] | ||
|
||
[project.optional-dependencies] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we duplicating these here and in the requirements.*.txt
files? Is there a way to make sure we can keep them in sync or maybe we wouldnt need the requirement files anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the needs for requirements.txt. Didn't remove them yet since I'm not done with the migration of the dockerfiles.
Co-authored-by: Thomas Hansen <[email protected]>
@@ -1,3 +0,0 @@ | |||
[settings] | |||
profile = black | |||
skip = **/__init__.py, **/node_modules/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we confident this files should be removed?
FROM python:3.9 as base | ||
|
||
# Builder stage | ||
FROM python:3.13-slim AS builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inference is not yet compatible with python 3.13; lets use 3.12 instead
FROM python:3.13-slim AS builder | |
FROM python:3.12-slim AS builder |
cmake \ | ||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
libxext6 libopencv-dev git libgdal-dev cmake make ninja-build gcc g++ curl \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote for restoring previous way of listing dependencies
# Using separate commands to better utilize layer caching | ||
RUN uv pip install --upgrade pip && \ | ||
uv pip install . && \ | ||
uv pip install .[clip,container,cpu,doctr,gaze,groundingdino,http,sam,transformers,waf,yolo_world] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are making quite substantial change here, I'd also vote for creating venv
for the project and installing everything there; this will also result in all dependencies installed in isolated directory which should make it easier if we wanted to copy between stages
|
||
RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then pip3 install -r requirements/requirements.vino.txt; rm -rf ~/.cache/pip; fi | ||
# Final stage | ||
FROM python:3.13-slim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FROM python:3.13-slim | |
FROM python:3.12-slim |
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
libxext6 libopencv-dev git libgdal-dev cmake make ninja-build gcc g++ curl \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote for restoring previous way of listing dependencies
@@ -1,3 +0,0 @@ | |||
[pytest] | |||
markers = | |||
slow: marks tests as slow (deselect with '-m "not slow"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this file should be deleted
Key Changes
setup.py
topyproject.toml
for modern Python package managementDetails
Package Management
setup.py
withpyproject.toml
for package configuration and dependency management.isort.cfg
andpytest.ini
in favor of consolidated config inpyproject.toml
Docker Optimization
Dockerfile.onnx.cpu
:Dependency Updates
pyproject.toml
under optional featuresTechnical Notes
hatchling
as the build backendThis change modernizes our Python package management approach and optimizes our container builds while maintaining all existing functionality.
Implementation Details