Make Milvus storage backend opt-in (storage-milvus group)#189
Merged
Conversation
pymilvus is the only consumer of pandas (~48MB) and grpcio (~37MB) in the
project; neither is used directly by vcon-server. pymilvus is just one of
~14 storage backends, loaded lazily via importlib only when a Milvus storage
is configured, so it does not belong in the base install.
- Move pymilvus out of the base `storage` group into a new opt-in
`storage-milvus` group (also pulls openai for the backend's embedding calls).
- Add pytest.importorskip("pymilvus") to test_milvus.py and
test_milvus_branches.py so they skip cleanly when the optional dep is absent
(both import storage.milvus, which imports pymilvus at module load).
- Add --group storage-milvus to the dev/test Dockerfile only, so Milvus tests
still run in CI; the production Dockerfile.conserver / Dockerfile.api images
drop pymilvus/pandas/grpcio.
- Document the opt-in in the Milvus README.
- Regenerate uv.lock (pymilvus node unchanged, just regrouped).
BREAKING: deployments using the Milvus storage backend must now install it
explicitly with `uv sync --group storage --group storage-milvus`. Without it,
loading storage.milvus raises a clear ImportError.
Removes ~85MB (pandas + grpcio) from the production conserver and api images
for the common case that does not use Milvus.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the Milvus storage backend an opt-in dependency by moving pymilvus (and its heavy transitive dependencies) out of the base storage dependency group into a new storage-milvus group, while keeping CI/dev images able to run the Milvus test suite.
Changes:
- Split Milvus dependencies into a new
storage-milvusdependency group (pymilvus+openai) and updated the lockfile accordingly. - Updated the dev/test Docker image to install
storage-milvusso Milvus tests continue to run in CI. - Made Milvus tests skip cleanly when
pymilvusisn’t installed, and documented the opt-in install in the Milvus README.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Removes pymilvus from base groups and adds a new storage-milvus group entry. |
pyproject.toml |
Moves pymilvus out of storage into a new optional storage-milvus group (includes openai). |
docker/Dockerfile |
Installs --group storage-milvus in the dev/test image so Milvus tests run in CI. |
common/storage/milvus/test_milvus.py |
Skips the Milvus test module when optional dependency isn’t present. |
common/storage/milvus/test_milvus_branches.py |
Same skip behavior for the branch coverage tests. |
common/storage/milvus/README.md |
Documents the opt-in installation for Milvus storage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+46
to
+48
| # Includes openai for the embedding calls the backend makes. Only installs | ||
| # pymilvus when explicitly requested; storage.milvus raises a clear ImportError | ||
| # otherwise. Install with: uv sync --group storage --group storage-milvus |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
pavanputhra
approved these changes
Jun 7, 2026
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.
Summary
pymilvusis the only consumer ofpandas(~48MB) andgrpcio(~37MB) in the project, yet neither is used directly anywhere in vcon-server. Milvus is just one of ~14 storage backends, and backends are loaded lazily viaimportlib.import_moduleonly when a storage with that module is configured (common/storage/base.py). Sopymilvus(and its heavy transitive deps) doesn't belong in the base install — this PR makes it opt-in.Same theme as the
transformerschange (#188) and #160: a heavy, specialized dependency carried by every image despite shallow/optional use.Changes
pymilvus>=2.3.0out of the basestoragegroup into a new opt-instorage-milvusgroup (which also includesopenai, used by the backend for embeddings).pytest.importorskip("pymilvus")so both modules skip cleanly when the optional dep isn't installed (both importstorage.milvus, which importspymilvusat module load).--group storage-milvusso Milvus tests still run in CI. The productionDockerfile.conserver/Dockerfile.apiimages are untouched and now drop pymilvus/pandas/grpcio.pymilvusnode is unchanged, just regrouped.Impact
Removes ~85MB (
pandas+grpcio) from the production conserver and api images for the common case that doesn't use Milvus.Deployments using the Milvus storage backend must now install it explicitly:
Without it, loading
storage.milvusraises a clearImportError. (This is the intended opt-in behavior — every other storage backend already imports its own driver this way; this just stops bundling the heavy one by default.)Testing
common/storage/milvus/(both test files): 25 passed withpymilvuspresent (tests run, not skipped — confirmsimportorskipdoesn't break the running case).common/: 254 tests collect cleanly — no import errors from the regroup.uv lock --checkpasses (lock coherent with the regrouped manifest).🤖 Generated with Claude Code