feat(cassandra): add llm_config column to nvcf_api schema - #643
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe Cassandra schema adds Changesnvcf_api schema synchronization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@migrations/cassandra/keyspaces/nvcf_api/08_add_llm_config.up.sql`:
- Around line 1-6: Add executable migration coverage for the ALTER TABLE
statement in the migration test suite, validating fresh installation, upgrade
from a schema without llm_config, and repeated execution when llm_config already
exists. If existing tests already exercise these paths, document that coverage
in the PR instead of adding duplicates.
In `@migrations/cassandra/README.md`:
- Line 157: Align migration terminology in both README files: in
migrations/cassandra/README.md at line 157, replace or qualify “DDL deltas” with
“incremental migrations” so it accurately covers all keyspaces; in
migrations/cassandra/keyspaces/README.md at line 46, clarify that
03_init_tables.up.sql is the canonical schema for fresh installations and
subsequent files apply as incremental changes to existing clusters.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ee5f7d40-7dfc-4cc8-9110-4fa2e8c58d85
📒 Files selected for processing (4)
migrations/cassandra/README.mdmigrations/cassandra/keyspaces/README.mdmigrations/cassandra/keyspaces/nvcf_api/03_init_tables.up.sqlmigrations/cassandra/keyspaces/nvcf_api/08_add_llm_config.up.sql
Sync the self-hosted nvcf_api keyspace with the managed NVCF API schema, which stores function-level LLM configuration in functions_v3.llm_config. Without the column, a self-hosted NVCF API build that carries the LLM invocation config fails against its own database. Fresh installs get the column from 03_init_tables.up.sql. Existing clusters never replay 03, so 08_add_llm_config.up.sql adds it on upgrade using ADD IF NOT EXISTS, which is a no-op where 03 already created it. With this change the self-hosted schema matches the managed one column for column. Closes #622 Signed-off-by: along <along@nvidia.com>
Not every delta is DDL: ess_api/04_* is a data seed. Call the later numbered files incremental migrations and name the exception. Signed-off-by: along <along@nvidia.com>
9b5de7a to
7bda1b8
Compare
|
🎉 This PR is included in version nvcf-cassandra-migrations-v0.15.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
TL;DR
Adds the
llm_configcolumn tofunctions_v3in the self-hostednvcf_apikeyspace, so the self-hosted schema matches the managed NVCF API schema. Without it, a self-hosted NVCF API build that carries the LLM invocation config fails against its own database.Additional Details
The column is added in two places because fresh installs and existing clusters take different paths:
03_init_tables.up.sqlis the canonical schema that fresh installs apply.08_add_llm_config.up.sqlis for existing clusters. It usesADD IF NOT EXISTS, so it is also a no-op on fresh installs that already have the column.The
keyspaces/README.mdpin fornvcf_apimoves to the managed release that introduced the column. Both READMEs listed the deltas as04_*,05_*,06_*, which was already stale before this change and would be more so with08added, so they now say04_*and later.For the Reviewer
The pin row in
keyspaces/README.mdmoves fromv1.5.1/7a422ff1tov1.10.0/fcaea0c1, the release that introducedllm_config.For QA
No QA needed for this change on its own; it takes effect with the migrations image release.
Verified locally:
migrations/cassandra/tests/test-execute-sqls.shpasses, and a column-level comparison against the managed schema file shows no remaining differences, withllm_configat the same ordinal position in both. The repo's migration test harness inventories migration files and validates the runner; it has no schema-content assertions, so there is no test to extend for a new column.Issues
Closes #622
Checklist
Summary by CodeRabbit
New Features
Documentation