Auto-download LMDB datasets on first run for local dev - #130
Merged
Conversation
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 Report❌ Patch coverage is
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 upstarts 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.