From cff2e8323a7bc919f7c0c3abde5e2a4790ffda7a Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 1 Jul 2025 16:12:44 -0700 Subject: [PATCH 01/24] Initial working CPU build --- requirements-cpu.txt | 108 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 requirements-cpu.txt diff --git a/requirements-cpu.txt b/requirements-cpu.txt new file mode 100644 index 0000000000..3d167ef43c --- /dev/null +++ b/requirements-cpu.txt @@ -0,0 +1,108 @@ +opencv-python +python-dotenv +openai +anthropic>=0.19.0 +cerebras-cloud-sdk +numpy>=1.26.4,<2.0.0 +colorlog==6.9.0 +yapf==0.40.2 +typeguard +empy==3.3.4 +catkin_pkg +lark +plum-dispatch==2.5.7 + +# pycolmap +ffmpeg-python +pytest +python-dotenv +openai +tiktoken>=0.8.0 +Flask>=2.2 +python-multipart==0.0.20 +reactivex +git+https://github.com/dimensionalOS/rxpy-backpressure.git +pytest-asyncio==0.26.0 +asyncio==3.4.3 +-e git+https://github.com/legion1581/go2_webrtc_connect.git@fe64abb5987594e8c048427a98445799f6f6a9cc#egg=go2_webrtc_connect +#-e git+https://github.com/legion1581/aioice.git@ff5755a1e37127411b5fc797c105804db8437445#egg=aioice + +# Web Extensions +fastapi>=0.115.6 +sse-starlette>=2.2.1 +uvicorn>=0.34.0 + +# Agent Memory +langchain-chroma>=0.1.4 +langchain-openai>=0.2.14 + +# Class Extraction +pydantic + +# Developer Specific +ipykernel + +# Unitree webrtc streaming +aiortc==1.9.0 +pycryptodome +opencv-python +sounddevice +pyaudio +requests +wasmtime + +# Audio +openai-whisper +soundfile + +#Hugging Face +# Using CPU-only transformer version +transformers==4.49.0 + +#Vector Embedding +sentence_transformers + +# CTransforms GGUF - CPU version +ctransformers==0.2.27 + +# Perception Dependencies +ultralytics>=8.3.70 +filterpy>=1.4.5 +scipy>=1.15.1 +opencv-python==4.10.0.84 +opencv-contrib-python==4.10.0.84 +scikit-learn +Pillow +mmengine>=0.10.3 +mmcv>=2.1.0 +timm>=1.0.15 +lap>=0.5.12 +# Removed GPU dependencies: xformers, pycuda + +# Detic (CPU version) +opencv-python +mss +timm +dataclasses +ftfy +regex +fasttext +scikit-learn +lvis +nltk +# For CLIP and detectron2, install CPU versions if needed +# git+https://github.com/openai/CLIP.git +# git+https://github.com/facebookresearch/detectron2.git@v0.6 + +# Mapping +open3d + +# Inference +onnxruntime + +# PyTorch CPU-only version +torch==2.0.0 --extra-index-url https://download.pytorch.org/whl/cpu +torchvision==0.15.1 --extra-index-url https://download.pytorch.org/whl/cpu + +# Zenoh +eclipse-zenoh \ No newline at end of file From beff0f11b45efa0d02312f22e931e59ac5777dfc Mon Sep 17 00:00:00 2001 From: stash Date: Thu, 3 Jul 2025 16:11:02 -0700 Subject: [PATCH 02/24] Unneeded pytest avoid dir --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3e68e6f1cd..031a651a49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -160,7 +160,6 @@ files = [ [tool.pytest.ini_options] testpaths = ["dimos"] -norecursedirs = ["dimos/robot/unitree/external"] markers = [ "vis: marks tests that run visuals and require a visual check by dev", "benchmark: benchmark, executes something multiple times, calculates avg, prints to console", From b6558e74f79883be20dfb66c0dff9b8935b6039e Mon Sep 17 00:00:00 2001 From: stash Date: Thu, 3 Jul 2025 18:17:00 -0700 Subject: [PATCH 03/24] Fix costmap check bug --- dimos/robot/unitree_webrtc/type/lidar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dimos/robot/unitree_webrtc/type/lidar.py b/dimos/robot/unitree_webrtc/type/lidar.py index 3b6ab99c93..f45cb8dfe7 100644 --- a/dimos/robot/unitree_webrtc/type/lidar.py +++ b/dimos/robot/unitree_webrtc/type/lidar.py @@ -53,7 +53,7 @@ class LidarMessage(PointCloud2): resolution: float # we lose resolution when encoding PointCloud2 origin: Vector3 raw_msg: Optional[RawLidarMsg] - _costmap: Optional[Costmap] + _costmap: Optional[Costmap] = None def __init__(self, **kwargs): super().__init__( From 98f9c20aabcd35397edd1edaa45670f4d282afb8 Mon Sep 17 00:00:00 2001 From: stash Date: Fri, 4 Jul 2025 14:36:53 -0700 Subject: [PATCH 04/24] Fixed go2 webrtc connect wheel install via pyproject --- pyproject.toml | 10 +++++++++- requirements.txt | 5 ++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 031a651a49..dc84bb1284 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "rxpy-backpressure @ git+https://github.com/dimensionalOS/rxpy-backpressure.git", "pytest-asyncio==0.26.0", "asyncio==3.4.3", - "go2-webrtc-connect @ git+https://github.com/legion1581/go2_webrtc_connect.git@fe64abb5987594e8c048427a98445799f6f6a9cc", + "go2-webrtc-connect @ git+https://github.com/dimensionalOS/go2_webrtc_connect.git", # Web Extensions "fastapi>=0.115.6", @@ -101,6 +101,14 @@ dependencies = [ # Mapping "open3d", + + # Inference + "onnxruntime", + "onnx", + + # Multiprocess + "dask[complete]==2025.5.1", + "lcm_msgs @ git+https://github.com/dimensionalOS/python_lcm_msgs.git@main#egg=lcm_msgs" ] [project.optional-dependencies] diff --git a/requirements.txt b/requirements.txt index 6b1029483d..0d79926b2b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,9 +24,7 @@ reactivex git+https://github.com/dimensionalOS/rxpy-backpressure.git pytest-asyncio==0.26.0 asyncio==3.4.3 --e git+https://github.com/legion1581/go2_webrtc_connect.git@fe64abb5987594e8c048427a98445799f6f6a9cc#egg=go2_webrtc_connect -#-e git+https://github.com/legion1581/aioice.git@ff5755a1e37127411b5fc797c105804db8437445#egg=aioice - +-e git+https://github.com/dimensionalOS/go2_webrtc_connect.git#egg=go2_webrtc_connect # Web Extensions fastapi>=0.115.6 sse-starlette>=2.2.1 @@ -97,6 +95,7 @@ open3d # Inference (CPU) onnxruntime +onnx # Terminal colors rich==14.0.0 From 39a8b9681efb4d43faa84436c9fe965fac612594 Mon Sep 17 00:00:00 2001 From: stash Date: Fri, 4 Jul 2025 16:37:17 -0700 Subject: [PATCH 05/24] Test CPU build on lenovo tiny desktop --- pyproject.toml | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dc84bb1284..440cab09fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,8 +73,6 @@ dependencies = [ # Vector Embedding "sentence_transformers", - # CTransforms GGUF - "ctransformers[cuda]==0.2.27", # Perception Dependencies "ultralytics>=8.3.70", @@ -82,28 +80,15 @@ dependencies = [ "scipy>=1.15.1", "scikit-learn", "Pillow", - "mmengine>=0.10.3", - "mmcv>=2.1.0", + "clip @ git+https://github.com/openai/CLIP.git", "timm>=1.0.15", "lap>=0.5.12", - "xformers==0.0.20", - - # Detic - "mss", - "dataclasses", - "ftfy", - "regex", - "fasttext", - "lvis", - "nltk", - "clip @ git+https://github.com/openai/CLIP.git", - "detectron2 @ git+https://github.com/facebookresearch/detectron2.git@v0.6", - + # Mapping "open3d", # Inference - "onnxruntime", + "onnx", # Multiprocess @@ -132,9 +117,30 @@ manipulation = [ "plotly>=5.9.0", ] +cpu = [ + # CPU inference backends + "onnxruntime", + "ctransformers==0.2.27", +] + cuda = [ "pycuda", - "onnxruntime-gpu[cuda,cudnn]" + "onnxruntime-gpu[cuda,cudnn]", + "ctransformers[cuda]==0.2.27", + "mmengine>=0.10.3", + "mmcv>=2.1.0", + "xformers==0.0.20", + + # Detic GPU stack + "mss", + "dataclasses", + "ftfy", + "regex", + "fasttext", + "lvis", + "nltk", + "clip @ git+https://github.com/openai/CLIP.git", + "detectron2 @ git+https://github.com/facebookresearch/detectron2.git@v0.6", ] [tool.ruff] From 41dc52f9aa7e0b001d8a9e9f1d35bd54697a4ebe Mon Sep 17 00:00:00 2001 From: stash Date: Mon, 7 Jul 2025 14:39:57 -0700 Subject: [PATCH 06/24] Added graceful failure handling for Detic and Metric3d in CPU-only mode --- dimos/perception/object_detection_stream.py | 65 ++++++++++++++++----- tests/test_object_detection_stream.py | 7 +-- 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/dimos/perception/object_detection_stream.py b/dimos/perception/object_detection_stream.py index 0c6514ea36..552a31acfe 100644 --- a/dimos/perception/object_detection_stream.py +++ b/dimos/perception/object_detection_stream.py @@ -19,7 +19,14 @@ from reactivex import operators as ops from dimos.perception.detection2d.yolo_2d_det import Yolo2DDetector -from dimos.perception.detection2d.detic_2d_det import Detic2DDetector + +try: + from dimos.perception.detection2d.detic_2d_det import Detic2DDetector + + DETIC_AVAILABLE = True +except (ModuleNotFoundError, ImportError): + DETIC_AVAILABLE = False + Detic2DDetector = None from dimos.models.depth.metric3d import Metric3D from dimos.perception.detection2d.utils import ( calculate_depth_from_bbox, @@ -83,25 +90,47 @@ def __init__( self.disable_depth = disable_depth self.draw_masks = draw_masks # Initialize object detector - self.detector = detector or Detic2DDetector(vocabulary=None, threshold=min_confidence) + if detector is not None: + self.detector = detector + else: + if DETIC_AVAILABLE: + try: + self.detector = Detic2DDetector(vocabulary=None, threshold=min_confidence) + logger.info("Using Detic2DDetector") + except Exception as e: + logger.warning( + f"Failed to initialize Detic2DDetector: {e}. Falling back to Yolo2DDetector." + ) + self.detector = Yolo2DDetector() + else: + logger.info("Detic not available. Using Yolo2DDetector.") + self.detector = Yolo2DDetector() # Set up camera intrinsics self.camera_intrinsics = camera_intrinsics # Initialize depth estimation model self.depth_model = None if not disable_depth: - self.depth_model = Metric3D(gt_depth_scale) + try: + self.depth_model = Metric3D(gt_depth_scale) - if camera_intrinsics is not None: - self.depth_model.update_intrinsic(camera_intrinsics) + if camera_intrinsics is not None: + self.depth_model.update_intrinsic(camera_intrinsics) - # Create 3x3 camera matrix for calculations - fx, fy, cx, cy = camera_intrinsics - self.camera_matrix = np.array( - [[fx, 0, cx], [0, fy, cy], [0, 0, 1]], dtype=np.float32 - ) - else: - raise ValueError("camera_intrinsics must be provided") + # Create 3x3 camera matrix for calculations + fx, fy, cx, cy = camera_intrinsics + self.camera_matrix = np.array( + [[fx, 0, cx], [0, fy, cy], [0, 0, 1]], dtype=np.float32 + ) + else: + raise ValueError("camera_intrinsics must be provided") + + logger.info("Depth estimation enabled with Metric3D") + except Exception as e: + logger.warning(f"Failed to initialize Metric3D depth model: {e}") + logger.warning("Falling back to disable_depth=True mode") + self.disable_depth = True + self.depth_model = None else: logger.info("Depth estimation disabled") @@ -123,9 +152,15 @@ def create_stream(self, video_stream: Observable) -> Observable: """ def process_frame(frame): - # Detect objects - bboxes, track_ids, class_ids, confidences, names, masks = self.detector.process_image( - frame + # TODO: More modular detector output interface + bboxes, track_ids, class_ids, confidences, names, *mask_data = ( + self.detector.process_image(frame) + ([],) + ) + + masks = ( + mask_data[0] + if mask_data and len(mask_data[0]) == len(bboxes) + else [None] * len(bboxes) ) # Create visualization diff --git a/tests/test_object_detection_stream.py b/tests/test_object_detection_stream.py index ed0a64fa9e..1cf8aeab01 100644 --- a/tests/test_object_detection_stream.py +++ b/tests/test_object_detection_stream.py @@ -27,8 +27,6 @@ from dimos.perception.object_detection_stream import ObjectDetectionStream from dimos.types.vector import Vector from dimos.utils.reactive import backpressure -from dimos.perception.detection2d.detic_2d_det import Detic2DDetector - from dotenv import load_dotenv @@ -103,9 +101,6 @@ def main(): class_filter = None # No class filtering web_port = 5555 - # Initialize detector - detector = Detic2DDetector(vocabulary=None, threshold=min_confidence) - # Initialize based on mode if args.mode == "robot": print("Initializing in robot mode...") @@ -166,9 +161,9 @@ def main(): camera_intrinsics=camera_intrinsics, min_confidence=min_confidence, class_filter=class_filter, - detector=detector, video_stream=video_stream, disable_depth=False, + draw_masks=True, ) # Set placeholder robot for cleanup From c02eee1243e90fd1e3ac187751a3fa65b431fedc Mon Sep 17 00:00:00 2001 From: stash Date: Mon, 7 Jul 2025 20:03:29 -0700 Subject: [PATCH 07/24] Fix onnxruntime/gpu clash and cuda11/12 support --- bin/cuda/fix_ort.sh | 30 +++++++++++++++++++++ dimos/perception/detection2d/yolo_2d_det.py | 3 ++- dimos/perception/segmentation/sam_2d_seg.py | 3 ++- pyproject.toml | 2 +- 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100755 bin/cuda/fix_ort.sh diff --git a/bin/cuda/fix_ort.sh b/bin/cuda/fix_ort.sh new file mode 100755 index 0000000000..182f387364 --- /dev/null +++ b/bin/cuda/fix_ort.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# This script fixes the onnxruntime <--> onnxruntime-gpu package clash +# that occurs when chromadb and other dependencies require the CPU-only +# onnxruntime package. It removes onnxruntime and reinstalls the GPU version. +set -euo pipefail + +: "${GPU_VER:=1.18.1}" + +python - <=1.17.1,<=1.18.1", # Only versions supporting both cuda11 and cuda12 "ctransformers[cuda]==0.2.27", "mmengine>=0.10.3", "mmcv>=2.1.0", From 806c8a150f9e4fbc8b172419d671bb0bdcf47202 Mon Sep 17 00:00:00 2001 From: stash Date: Mon, 7 Jul 2025 21:11:07 -0700 Subject: [PATCH 08/24] Remove unneeded req file --- requirements-cpu.txt | 108 ------------------------------------------- 1 file changed, 108 deletions(-) delete mode 100644 requirements-cpu.txt diff --git a/requirements-cpu.txt b/requirements-cpu.txt deleted file mode 100644 index 3d167ef43c..0000000000 --- a/requirements-cpu.txt +++ /dev/null @@ -1,108 +0,0 @@ -opencv-python -python-dotenv -openai -anthropic>=0.19.0 -cerebras-cloud-sdk -numpy>=1.26.4,<2.0.0 -colorlog==6.9.0 -yapf==0.40.2 -typeguard -empy==3.3.4 -catkin_pkg -lark -plum-dispatch==2.5.7 - -# pycolmap -ffmpeg-python -pytest -python-dotenv -openai -tiktoken>=0.8.0 -Flask>=2.2 -python-multipart==0.0.20 -reactivex -git+https://github.com/dimensionalOS/rxpy-backpressure.git -pytest-asyncio==0.26.0 -asyncio==3.4.3 --e git+https://github.com/legion1581/go2_webrtc_connect.git@fe64abb5987594e8c048427a98445799f6f6a9cc#egg=go2_webrtc_connect -#-e git+https://github.com/legion1581/aioice.git@ff5755a1e37127411b5fc797c105804db8437445#egg=aioice - -# Web Extensions -fastapi>=0.115.6 -sse-starlette>=2.2.1 -uvicorn>=0.34.0 - -# Agent Memory -langchain-chroma>=0.1.4 -langchain-openai>=0.2.14 - -# Class Extraction -pydantic - -# Developer Specific -ipykernel - -# Unitree webrtc streaming -aiortc==1.9.0 -pycryptodome -opencv-python -sounddevice -pyaudio -requests -wasmtime - -# Audio -openai-whisper -soundfile - -#Hugging Face -# Using CPU-only transformer version -transformers==4.49.0 - -#Vector Embedding -sentence_transformers - -# CTransforms GGUF - CPU version -ctransformers==0.2.27 - -# Perception Dependencies -ultralytics>=8.3.70 -filterpy>=1.4.5 -scipy>=1.15.1 -opencv-python==4.10.0.84 -opencv-contrib-python==4.10.0.84 -scikit-learn -Pillow -mmengine>=0.10.3 -mmcv>=2.1.0 -timm>=1.0.15 -lap>=0.5.12 -# Removed GPU dependencies: xformers, pycuda - -# Detic (CPU version) -opencv-python -mss -timm -dataclasses -ftfy -regex -fasttext -scikit-learn -lvis -nltk -# For CLIP and detectron2, install CPU versions if needed -# git+https://github.com/openai/CLIP.git -# git+https://github.com/facebookresearch/detectron2.git@v0.6 - -# Mapping -open3d - -# Inference -onnxruntime - -# PyTorch CPU-only version -torch==2.0.0 --extra-index-url https://download.pytorch.org/whl/cpu -torchvision==0.15.1 --extra-index-url https://download.pytorch.org/whl/cpu - -# Zenoh -eclipse-zenoh \ No newline at end of file From b5c81aab533526e55d7f6dc45c73e5e5fd6b9508 Mon Sep 17 00:00:00 2001 From: stash Date: Mon, 7 Jul 2025 21:57:14 -0700 Subject: [PATCH 09/24] Fix aiortc/aioice dependency conflict ONLY in github runner(?) --- requirements.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0d79926b2b..5faa7c8874 100644 --- a/requirements.txt +++ b/requirements.txt @@ -40,15 +40,6 @@ pydantic # Developer Specific ipykernel -# Unitree webrtc streaming -aiortc==1.9.0 -pycryptodome -opencv-python -sounddevice -pyaudio -requests -wasmtime - # Audio openai-whisper soundfile From de50600c20007f3c12c8cab05271d17d45b199cb Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 00:13:17 -0700 Subject: [PATCH 10/24] Test docker build from python wheel --- docker/python/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index f08510faa5..e4a9481168 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -33,11 +33,9 @@ RUN apt-get install -y \ RUN mkdir -p /app/dimos -COPY requirements.txt /app/ -COPY base-requirements.txt /app/ +COPY pyproject.toml /app/ WORKDIR /app -RUN --mount=type=cache,target=/root/.cache/pip pip install -r base-requirements.txt - -RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt +# Install dependencies with [cpu] extra +RUN --mount=type=cache,target=/root/.cache/pip pip install .[cpu] From a4fa7f04441c6d0b831df9b15e847ed68690d3fe Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 01:41:03 -0700 Subject: [PATCH 11/24] Test docker python package editable mode --- docker/python/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index e4a9481168..7353313509 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -37,5 +37,5 @@ COPY pyproject.toml /app/ WORKDIR /app -# Install dependencies with [cpu] extra -RUN --mount=type=cache,target=/root/.cache/pip pip install .[cpu] +# Install the package in editable mode with CPU dependencies +RUN --mount=type=cache,target=/root/.cache/pip pip install -e ".[cpu]" From 65a2e3536e0f1dd927b3e7c4f58914d686d1dbd4 Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 01:56:57 -0700 Subject: [PATCH 12/24] Test setuptools docker install --- docker/python/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index 7353313509..0e4220e051 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -33,6 +33,9 @@ RUN apt-get install -y \ RUN mkdir -p /app/dimos +# Ensure we have a recent pip + setuptools that support PEP 660 editable installs +RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade pip "setuptools>=61" wheel + COPY pyproject.toml /app/ WORKDIR /app From 45d03ef00cd5a2bf5b82f2c8d9abb186585f6d96 Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 01:58:22 -0700 Subject: [PATCH 13/24] Test normal package install + added pytest to dev requirements --- docker/dev/dev-requirements.txt | 2 ++ docker/python/Dockerfile | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/dev/dev-requirements.txt b/docker/dev/dev-requirements.txt index 9633816cf2..d7ded50947 100644 --- a/docker/dev/dev-requirements.txt +++ b/docker/dev/dev-requirements.txt @@ -1,3 +1,5 @@ ruff==0.11.10 mypy==1.15.0 pre_commit==4.2.0 +pytest +pytest-asyncio==0.26.0 diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index 0e4220e051..cf0ff2dfd9 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -33,12 +33,8 @@ RUN apt-get install -y \ RUN mkdir -p /app/dimos -# Ensure we have a recent pip + setuptools that support PEP 660 editable installs -RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade pip "setuptools>=61" wheel - COPY pyproject.toml /app/ WORKDIR /app -# Install the package in editable mode with CPU dependencies -RUN --mount=type=cache,target=/root/.cache/pip pip install -e ".[cpu]" +RUN --mount=type=cache,target=/root/.cache/pip pip install ".[cpu]" From 82d9669b6aa94bb50b20be67e026b3fbe3495f7f Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 03:31:10 -0700 Subject: [PATCH 14/24] Test add full dimos source to docker/python --- docker/python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index cf0ff2dfd9..b709706b91 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get install -y \ RUN mkdir -p /app/dimos -COPY pyproject.toml /app/ +COPY . /app/ WORKDIR /app From 2d189a7488dbf3ec8dc2680edda69434d66178af Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 03:51:00 -0700 Subject: [PATCH 15/24] Fix PEP 621 metadata bug --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bc9215b7d7..d47acdbc79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel"] +requires = ["setuptools>=70", "wheel"] build-backend = "setuptools.build_meta" [tool.setuptools] From c37b1e1f94dd2afa3b99429d2ebf8545225b8c7b Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 03:57:36 -0700 Subject: [PATCH 16/24] Force docker/python rebuild --- docker/python/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index b709706b91..eb2112a31b 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -1,6 +1,8 @@ ARG FROM_IMAGE=ghcr.io/dimensionalos/ros:dev FROM ${FROM_IMAGE} +ENV REBUILD=1 + # Install basic requirements RUN apt-get update RUN apt-get install -y \ From 075cc3544260f5cf592df8b40df6cb4db9705dc4 Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 04:10:31 -0700 Subject: [PATCH 17/24] Test setuptools>=70 --- docker/python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index eb2112a31b..31806670f0 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -39,4 +39,4 @@ COPY . /app/ WORKDIR /app -RUN --mount=type=cache,target=/root/.cache/pip pip install ".[cpu]" +RUN --mount=type=cache,target=/root/.cache/pip bash -c "pip install --upgrade 'pip>=24' 'setuptools>=70' wheel && pip install '.[cpu]'" From 1da838535ddc39a8b378d6d333dfbb98b309f6f7 Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 04:41:08 -0700 Subject: [PATCH 18/24] Fix blinker 1.4 distutils error --- docker/python/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index 31806670f0..81e259d095 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -33,6 +33,9 @@ RUN apt-get install -y \ qtbase5-dev-tools \ supervisor +# Fixes distutils blinker 1.4 dependency conflict +RUN apt-get purge -y python3-blinker || true + RUN mkdir -p /app/dimos COPY . /app/ From bfb2fa8b8af0d8983996ec2406b07e7937912a8c Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 04:49:44 -0700 Subject: [PATCH 19/24] Force packaging>=24 in docker --- docker/python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index 81e259d095..92b97498f7 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -42,4 +42,4 @@ COPY . /app/ WORKDIR /app -RUN --mount=type=cache,target=/root/.cache/pip bash -c "pip install --upgrade 'pip>=24' 'setuptools>=70' wheel && pip install '.[cpu]'" +RUN --mount=type=cache,target=/root/.cache/pip bash -c "pip install --upgrade 'pip>=24' 'setuptools>=70' 'wheel' 'packaging>=24' && pip install '.[cpu]'" \ No newline at end of file From 4e2d83d72ad53bee533d2516da275a0f63f7f8a0 Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 05:09:31 -0700 Subject: [PATCH 20/24] Pip break system packages flag --- docker/python/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index 92b97498f7..ab2210914f 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -33,8 +33,12 @@ RUN apt-get install -y \ qtbase5-dev-tools \ supervisor -# Fixes distutils blinker 1.4 dependency conflict -RUN apt-get purge -y python3-blinker || true +# Fix distutils-installed packages that block pip upgrades +# RUN apt-get purge -y python3-blinker python3-sympy || true + +# Allow pip to overwrite any remaining distutils packages +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +# RUN apt-get purge -y python3-blinker || true RUN mkdir -p /app/dimos From 9c8c382fff7080ed1045d6b9f7647fd12853b5ad Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 05:16:01 -0700 Subject: [PATCH 21/24] Fix other distutils packages blocking pip in docker --- docker/python/Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index ab2210914f..e3e7623ef4 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -34,11 +34,7 @@ RUN apt-get install -y \ supervisor # Fix distutils-installed packages that block pip upgrades -# RUN apt-get purge -y python3-blinker python3-sympy || true - -# Allow pip to overwrite any remaining distutils packages -ENV PIP_BREAK_SYSTEM_PACKAGES=1 -# RUN apt-get purge -y python3-blinker || true +RUN apt-get purge -y python3-blinker python3-sympy python3-oauthlib || true RUN mkdir -p /app/dimos From 2236383e4c2ad3836174241f6a8166c03d4e4c11 Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 05:48:52 -0700 Subject: [PATCH 22/24] Docker builds fully working with dimOS CPU package build --- docker/python/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile index e3e7623ef4..f8d06496b4 100644 --- a/docker/python/Dockerfile +++ b/docker/python/Dockerfile @@ -1,8 +1,6 @@ ARG FROM_IMAGE=ghcr.io/dimensionalos/ros:dev FROM ${FROM_IMAGE} -ENV REBUILD=1 - # Install basic requirements RUN apt-get update RUN apt-get install -y \ From f8a3f3c3284e992f8153728db41655be8002c5ee Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 17:54:24 -0700 Subject: [PATCH 23/24] Test no pytest in dev requirements --- docker/dev/dev-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/dev/dev-requirements.txt b/docker/dev/dev-requirements.txt index d7ded50947..0d61f86298 100644 --- a/docker/dev/dev-requirements.txt +++ b/docker/dev/dev-requirements.txt @@ -1,5 +1,5 @@ ruff==0.11.10 mypy==1.15.0 pre_commit==4.2.0 -pytest -pytest-asyncio==0.26.0 +# pytest +# pytest-asyncio==0.26.0 From 3134793ce8426467936ba1fbc0fd63abfd0c3c6c Mon Sep 17 00:00:00 2001 From: stash Date: Tue, 8 Jul 2025 18:50:07 -0700 Subject: [PATCH 24/24] Add dev deps to 'dev' extras, change docker dev build --- docker/dev/Dockerfile | 5 +++-- docker/dev/dev-requirements.txt | 5 ----- pyproject.toml | 10 ++++++++-- 3 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 docker/dev/dev-requirements.txt diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index 05725add6f..4eb6a8f247 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -23,8 +23,9 @@ RUN apt-get update && apt-get install -y \ # Configure git to trust any directory (resolves dubious ownership issues in containers) RUN git config --global --add safe.directory '*' -COPY docker/dev/dev-requirements.txt /app/ -RUN --mount=type=cache,target=/root/.cache/pip pip install -r dev-requirements.txt +COPY . /app/ +WORKDIR /app +RUN --mount=type=cache,target=/root/.cache/pip pip install .[dev] # Copy files and add version to motd COPY /assets/dimensionalascii.txt /etc/motd diff --git a/docker/dev/dev-requirements.txt b/docker/dev/dev-requirements.txt deleted file mode 100644 index 0d61f86298..0000000000 --- a/docker/dev/dev-requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -ruff==0.11.10 -mypy==1.15.0 -pre_commit==4.2.0 -# pytest -# pytest-asyncio==0.26.0 diff --git a/pyproject.toml b/pyproject.toml index d47acdbc79..579f55c29e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,13 +30,11 @@ dependencies = [ "lark", "plum-dispatch==2.5.7", "ffmpeg-python", - "pytest", "tiktoken>=0.8.0", "Flask>=2.2", "python-multipart==0.0.20", "reactivex", "rxpy-backpressure @ git+https://github.com/dimensionalOS/rxpy-backpressure.git", - "pytest-asyncio==0.26.0", "asyncio==3.4.3", "go2-webrtc-connect @ git+https://github.com/dimensionalOS/go2_webrtc_connect.git", @@ -143,6 +141,14 @@ cuda = [ "detectron2 @ git+https://github.com/facebookresearch/detectron2.git@v0.6", ] +dev = [ + "ruff==0.11.10", + "mypy==1.15.0", + "pre_commit==4.2.0", + "pytest", + "pytest-asyncio==0.26.0" +] + [tool.ruff] line-length = 100 exclude = [