feat(BA-5421): Make initial_revision optional and remove duplicate revision columns from endpoints table#10542
Draft
jopemachine wants to merge 14 commits intomainfrom
Draft
feat(BA-5421): Make initial_revision optional and remove duplicate revision columns from endpoints table#10542jopemachine wants to merge 14 commits intomainfrom
jopemachine wants to merge 14 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make the initial_revision field optional across deployment creation DTOs (v1 REST, v2 DTO used by GraphQL), enabling “create deployment first, add revisions later” workflows.
Changes:
- Make
initial_revisionoptional in GraphQLCreateDeploymentInput. - Make
initial_revisionoptional in v2CreateDeploymentInputDTO. - Make
initial_revisionoptional in v1CreateDeploymentRequestDTO.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/ai/backend/manager/api/gql/deployment/types/deployment.py |
Makes GraphQL create input accept initial_revision = null/omitted. |
src/ai/backend/common/dto/manager/v2/deployment/request.py |
Makes v2 create DTO accept initial_revision = None. |
src/ai/backend/common/dto/manager/deployment/request.py |
Makes v1 REST create DTO accept initial_revision = None. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
49702ff to
a6ff914
Compare
initial_revision optional in deployment creation DTOs
initial_revision optional in deployment creation DTOs47cdf25 to
25367dc
Compare
…DTOs Allow creating a deployment without specifying an initial revision so that revisions can be added separately after deployment creation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ment adapters Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…able Remove 15 revision-related columns from endpoints table that were already present in deployment_revisions. All revision data is now accessed through current_revision_row relationship on EndpointRow. - Make initial_revision optional in deployment creation DTOs - Add current_revision_row relationship to EndpointRow - Add model_row relationship to DeploymentRevisionRow - Move resource_group from endpoint metadata to revision level - Update all consumers (event_dispatcher, model_serving, gql_legacy, registry, sokovan) to read from DeploymentRevisionRow - Add alembic migration to drop columns and constraints Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…_revision Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use actual DB constraint names (ck_endpoints_ck_*, fk_endpoints_*) instead of assumed names. Use raw SQL for check constraint drop/create to avoid alembic auto-prefixing issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…olumns Remove image, resource_group, resource_slots, cluster_mode, and other revision-related keyword arguments from EndpointRow() constructor calls across all test files. Add deployment_revisions stub table to scaling group test conftest. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace ValueError with DeploymentRevisionNotFound (BackendAIError-based) - Add resource_group to ModelRevisionCreator in _apply_preset - Remove resource_group from DeploymentMetadataFields (moved to revision) - Fix formatting in deployment adapter - Remove unused yarl import Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
abb8895 to
fb700fd
Compare
- Add get_endpoint_info mock (service now re-fetches after creation) - Patch add_model_revision in with_revision test (avoid deep async chain) - Remove mark_lifecycle_needed assertions (no longer called in create_deployment) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Migration 8d01fe40664a (already on main) already drops 14 revision columns from endpoints. This migration now only drops the remaining resource_group column with its FK constraint and index. Also revert unrelated blank line change in image/row.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Delete migration (resource_group stays on EndpointRow) - Restore resource_group column and references in EndpointRow - Restore DeploymentMetadata.resource_group as required str - Restore DeploymentMetadataFields.resource_group - Revert cosmetic renames (current_rev variable name kept) - Revert sokovan resource_group null checks - Revert scaling_group db_source query changes - Revert test files to main (resource_group parameter restored) - Keep functional changes: current_revision_row relationship, load_current_revision parameter, initial_revision optional Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ld_row() The EndpointRow creation was missing the resource_group field assignment, causing a NOT NULL constraint violation on the endpoints table during deployment creation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Resolves BA-5421.
Summary
initial_revisionoptional (Noneby default) in deployment creation DTOs (v2, REST v1, GraphQL)endpointstable — these were legacy leftovers already present indeployment_revisionstable:image,model,model_mount_destination,model_definition_pathresource_group,resource_slots,resource_optscluster_mode,cluster_sizestartup_command,bootstrap_script,callback_url,environ,runtime_variant,extra_mountscurrent_revision_rowrelationship toEndpointRow— all revision data is now accessed throughDeploymentRevisionRowmodel_rowrelationship toDeploymentRevisionRowresource_groupfrom endpoint metadata to revision levelcurrent_revision_rowck_image_required_unless_destroyed), and FK constraintsTest plan
initial_revisionstill works as beforeinitial_revisionis acceptedcurrent_revision_row🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--10542.org.readthedocs.build/en/10542/
📚 Documentation preview 📚: https://sorna-ko--10542.org.readthedocs.build/ko/10542/