Skip to content

fix(cookbook): redirect pip cache away from $HOME (#1219)#1231

Open
PrabinDevkota wants to merge 2 commits into
odysseus-dev:devfrom
PrabinDevkota:fix/this
Open

fix(cookbook): redirect pip cache away from $HOME (#1219)#1231
PrabinDevkota wants to merge 2 commits into
odysseus-dev:devfrom
PrabinDevkota:fix/this

Conversation

@PrabinDevkota

@PrabinDevkota PrabinDevkota commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Redirect pip wheel/build cache and temp dirs away from $HOME so Cookbook dependency installs and pip install -r requirements.txt do not fill a small home partition (No space left on device). Complements the existing --no-cache-dir Cookbook path (#1477) by also covering Docker, native install scripts, and wheel build temps via TMPDIR.

Target branch

  • This PR targets dev, not main. All PRs land in dev; main is curated by the maintainer at each release. If your PR is on main by accident, click "Edit" on this PR and change the base.

Linked Issue

Fixes #1219

Type of Change

  • Bug fix (non-breaking — fixes a confirmed issue)
  • New feature (non-breaking — adds new behaviour)
  • Breaking change (changes or removes existing behaviour)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app (docker compose up or uvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.

How to Test

  1. Confirm the focused unit tests pass:
    python -m pytest tests/test_cookbook_helpers.py -k pip_build -q
    python -m py_compile routes/cookbook_helpers.py routes/cookbook_routes.py
  2. Native install path: with a tight home disk (or by inspecting env), run a local Cookbook dependency install or pip install -r requirements.txt and verify PIP_CACHE_DIR / TMPDIR point under ./data/ (or /app/data/ in Docker).
  3. Docker: docker compose config (or inspect the running container env) should show PIP_CACHE_DIR=/app/data/pip-cache and TMPDIR=/app/data/tmp by default; entrypoint creates those dirs on the data volume.
  4. Optional regression: remote Cookbook serve/download scripts should not inject the local pip-cache exports (only local bash runners do).

Visual / UI changes — REQUIRED if you touched anything that renders

N/A — no UI/rendering changes.

@pewdiepie-archdaemon

Copy link
Copy Markdown
Collaborator

Thanks, this is pointed at a real issue from #1219 and the intended file list makes sense, but the branch is currently stale against main. The two-dot diff still includes already-merged/unrelated files like routes/model_routes.py, src/url_safety.py, static/app.js, static/js/sessions.js, and multiple endpoint/sidebar tests.

Can you rebase onto current main and push again so the two-dot diff contains only the intended files? Expected scope from the PR file list is:

  • .env.example
  • CONTRIBUTING.md
  • README.md
  • docker-compose.yml
  • docker/entrypoint.sh
  • routes/cookbook_helpers.py
  • routes/cookbook_routes.py
  • start-macos.sh
  • tests/test_cookbook_helpers.py

Also, minor naming note: the PR changes Cookbook install runtime behavior, not only docs, so a fix(cookbook) title would describe it more accurately than docs(install). Once rebased, the focused checks I would run are the cookbook helper tests plus py_compile for the touched route/helper files.

@PrabinDevkota
PrabinDevkota deleted the fix/this branch June 2, 2026 15:22
@PrabinDevkota
PrabinDevkota restored the fix/this branch July 16, 2026 18:01
@PrabinDevkota PrabinDevkota reopened this Jul 16, 2026
@github-actions github-actions Bot added needs work PR description incomplete — please update before review merge conflict Conflicts with the base branch; needs a rebase before review. labels Jul 16, 2026
@PrabinDevkota PrabinDevkota changed the title docs(install): redirect pip cache away from $HOME (#1219) fix(cookbook): redirect pip cache away from $HOME (#1219) Jul 16, 2026
Pip wheel/build caches default to ~/.cache/pip and can fill small home
partitions during requirements or Cookbook dependency installs. Docker
Compose and the entrypoint now use data/pip-cache and data/tmp; local
Cookbook runners export the same paths; install docs show the workaround.
Complements --no-cache-dir for Cookbook dependency installs (odysseus-dev#1477).
@github-actions github-actions Bot removed the merge conflict Conflicts with the base branch; needs a rebase before review. label Jul 16, 2026
@PrabinDevkota
PrabinDevkota changed the base branch from main to dev July 16, 2026 18:09
@github-actions github-actions Bot added ready for review Description complete — ready for maintainer review and removed needs work PR description incomplete — please update before review labels Jul 16, 2026
Keep docker-compose.gpu-*.yml aligned with base docker-compose.yml so
standalone GPU files stay equal to base+overlay after PIP_CACHE_DIR/TMPDIR.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change the direction of installation files in env

2 participants