diff --git a/Dockerfile b/Dockerfile index 0539d5b..1d29bb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh ENV PATH="/root/.local/bin:$PATH" RUN uv venv --python 3.12 /app/venv && uv pip install --python /app/venv/bin/python sentence-transformers RUN /app/venv/bin/python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" +# Pre-warm uv cache with common packages (shared across all project venvs) +RUN uv pip install --python /app/venv/bin/python httpx fastapi uvicorn requests flask pydantic numpy pandas matplotlib pillow jinja2 pyyaml python-dotenv beautifulsoup4 lxml aiohttp aiofiles pytest rich click typer sqlalchemy RUN mkdir -p /app/data/workspaces WORKDIR /app COPY target/aarch64-unknown-linux-musl/release/tori . diff --git a/src/agent.rs b/src/agent.rs index c9d52ce..d7ccdac 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -257,6 +257,7 @@ async fn ensure_workspace(exec: &LocalExecutor, workdir: &str) { let venv_path = format!("{}/.venv", workdir); if !Path::new(&venv_path).exists() { let _ = exec.execute("uv venv .venv", workdir).await; + let _ = exec.execute("uv pip install httpx fastapi uvicorn requests flask pydantic numpy pandas matplotlib pillow jinja2 pyyaml python-dotenv beautifulsoup4 lxml aiohttp aiofiles pytest rich click typer sqlalchemy", workdir).await; } } }