Skip to content

Make Milvus storage backend opt-in (storage-milvus group)#189

Merged
pavanputhra merged 5 commits into
mainfrom
deps/milvus-optional-storage
Jun 7, 2026
Merged

Make Milvus storage backend opt-in (storage-milvus group)#189
pavanputhra merged 5 commits into
mainfrom
deps/milvus-optional-storage

Conversation

@howethomas

Copy link
Copy Markdown
Contributor

Summary

pymilvus is the only consumer of pandas (~48MB) and grpcio (~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 via importlib.import_module only when a storage with that module is configured (common/storage/base.py). So pymilvus (and its heavy transitive deps) doesn't belong in the base install — this PR makes it opt-in.

Same theme as the transformers change (#188) and #160: a heavy, specialized dependency carried by every image despite shallow/optional use.

Changes

  • pyproject.toml: move pymilvus>=2.3.0 out of the base storage group into a new opt-in storage-milvus group (which also includes openai, used by the backend for embeddings).
  • test_milvus.py / test_milvus_branches.py: add pytest.importorskip("pymilvus") so both modules skip cleanly when the optional dep isn't installed (both import storage.milvus, which imports pymilvus at module load).
  • docker/Dockerfile (dev/test image only): add --group storage-milvus so Milvus tests still run in CI. The production Dockerfile.conserver / Dockerfile.api images are untouched and now drop pymilvus/pandas/grpcio.
  • Milvus README: document the opt-in install.
  • uv.lock: regenerated — the pymilvus node 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.

⚠️ Breaking change

Deployments using the Milvus storage backend must now install it explicitly:

uv sync --group storage --group storage-milvus

Without it, loading storage.milvus raises a clear ImportError. (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 with pymilvus present (tests run, not skipped — confirms importorskip doesn't break the running case).
  • common/: 254 tests collect cleanly — no import errors from the regroup.
  • uv lock --check passes (lock coherent with the regrouped manifest).

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 3, 2026 22:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-milvus dependency group (pymilvus + openai) and updated the lockfile accordingly.
  • Updated the dev/test Docker image to install storage-milvus so Milvus tests continue to run in CI.
  • Made Milvus tests skip cleanly when pymilvus isn’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.

Comment thread common/storage/milvus/test_milvus.py Outdated
Comment thread common/storage/milvus/test_milvus_branches.py Outdated
Comment thread pyproject.toml
Comment thread common/storage/milvus/README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 4, 2026 19:58
howethomas and others added 2 commits June 4, 2026 15:59
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Comment thread pyproject.toml
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
Comment thread common/storage/milvus/README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 7, 2026 10:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@pavanputhra pavanputhra merged commit 3fe2b14 into main Jun 7, 2026
1 check passed
@pavanputhra pavanputhra deleted the deps/milvus-optional-storage branch June 7, 2026 10:55
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.

3 participants