Skip to content

Auto-download LMDB datasets on first run for local dev - #130

Merged
maximusunc merged 1 commit into
mainfrom
claude/lmdb-auto-download-docker-konb37
Jul 17, 2026
Merged

Auto-download LMDB datasets on first run for local dev#130
maximusunc merged 1 commit into
mainfrom
claude/lmdb-auto-download-docker-konb37

Conversation

@maximusunc

Copy link
Copy Markdown
Collaborator

The aragorn_omnicorp and score_paths workers read from large read-only LMDB datasets that are gitignored and volume-mounted from the host. A new developer running docker compose up starts with those directories empty, so the workers crash trying to open a missing LMDB.

Add shepherd_utils/data_download.py, which each worker calls at startup to check whether its LMDB files are present and, if not, download a .tar.gz from a configured URL and extract it into the volume-mounted directory (so it persists on the host and is fetched only once). Download URLs are read from new settings (OMNICORP_LMDB_URL / PATHFINDER_EMBEDDINGS_URL) and default to empty, so production -- where the data is mounted out of band -- is a no-op; when unset the helper only logs how to enable it.

Extraction guards against path traversal and uses the tarfile "data" filter. Documented the env vars in the README and compose.yml, and added unit tests covering present/missing/no-url/bad-archive/traversal paths.

The aragorn_omnicorp and score_paths workers read from large read-only
LMDB datasets that are gitignored and volume-mounted from the host. A new
developer running `docker compose up` starts with those directories empty,
so the workers crash trying to open a missing LMDB.

Add shepherd_utils/data_download.py, which each worker calls at startup to
check whether its LMDB files are present and, if not, download a .tar.gz
from a configured URL and extract it into the volume-mounted directory (so
it persists on the host and is fetched only once). Download URLs are read
from new settings (OMNICORP_LMDB_URL / PATHFINDER_EMBEDDINGS_URL) and
default to empty, so production -- where the data is mounted out of band --
is a no-op; when unset the helper only logs how to enable it.

Extraction guards against path traversal and uses the tarfile "data"
filter. Documented the env vars in the README and compose.yml, and added
unit tests covering present/missing/no-url/bad-archive/traversal paths.
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.84211% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.38%. Comparing base (f86de24) to head (8cdd493).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
shepherd_utils/data_download.py 90.00% 6 Missing and 1 partial ⚠️
workers/score_paths/worker.py 0.00% 2 Missing ⚠️
workers/aragorn_omnicorp/worker.py 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
shepherd_utils/config.py 94.50% <100.00%> (+0.12%) ⬆️
workers/aragorn_omnicorp/worker.py 74.72% <50.00%> (-0.19%) ⬇️
workers/score_paths/worker.py 0.00% <0.00%> (ø)
shepherd_utils/data_download.py 90.00% <90.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9df6b13...8cdd493. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maximusunc
maximusunc merged commit cd3186a into main Jul 17, 2026
2 checks passed
@maximusunc
maximusunc deleted the claude/lmdb-auto-download-docker-konb37 branch July 17, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants