fix(BA-5557): register appproxy endpoints for deployments entering DEPLOYING via ActivateRevision#10728
Open
jopemachine wants to merge 9 commits intomainfrom
Open
fix(BA-5557): register appproxy endpoints for deployments entering DEPLOYING via ActivateRevision#10728jopemachine wants to merge 9 commits intomainfrom
jopemachine wants to merge 9 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes BA-5557 by ensuring deployments that enter DEPLOYING via ActivateRevision (skipping the check_pending path) still get registered with appproxy, preventing them from staying DEGRADED.
Changes:
- Add appproxy endpoint registration to the
DEPLOYING/PROVISIONINGhandler for deployments missingnetwork.url(usingdeploying_revision_id). - Update
check_pending_deployments()to skip already-registered deployments and to resolve the revision viacurrent_revision_idordeploying_revision_id. - Make
DeploymentExecutor.register_endpoint()public and wire additional dependencies through the coordinator.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/ai/backend/manager/sokovan/deployment/handlers/deploying.py |
Pre-registers missing appproxy endpoints during DEPLOYING provisioning and bulk-persists URLs. |
src/ai/backend/manager/sokovan/deployment/executor.py |
Adjusts pending registration logic (skip when URL exists; revision fallback) and exposes register_endpoint() publicly. |
src/ai/backend/manager/sokovan/deployment/coordinator.py |
Injects DeploymentExecutor + DeploymentRepository into the deploying provisioning handler. |
Comments suppressed due to low confidence (1)
src/ai/backend/manager/sokovan/deployment/executor.py:446
- This method is now public (register_endpoint) but it still sits under a "Private helper methods" section header. Consider updating the section header/comment to avoid confusion about intended API surface (or move register_endpoint above the private helpers section).
# Private helper methods
async def register_endpoint(
self,
deployment: DeploymentInfo,
scaling_group_target: ScalingGroupProxyTarget,
revision_id: UUID,
) -> str:
"""Resolve the target revision's model definition and register the endpoint to the app proxy.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ai/backend/manager/sokovan/deployment/handlers/deploying.py
Outdated
Show resolved
Hide resolved
src/ai/backend/manager/sokovan/deployment/handlers/deploying.py
Outdated
Show resolved
Hide resolved
…PLOYING via ActivateRevision Deployments that enter DEPLOYING through CreateDeployment → AddRevision → ActivateRevision bypass check_pending, which normally registers endpoints with appproxy. This caused routes to have no appproxy endpoint, leaving deployments stuck in DEGRADED status. - Add _register_unregistered_endpoints to DeployingProvisioningHandler that directly calls register_endpoint for deployments without a URL - Make register_endpoint public on DeploymentExecutor for cross-handler use - Restore check_pending_deployments name for the pending handler path - Inject DeploymentRepository into DeployingProvisioningHandler for proxy target loading and URL persistence Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ews fragment The _register_endpoint method was renamed to register_endpoint (public) but tests still referenced the old private name, causing AttributeError in CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ba2c662 to
148d2b1
Compare
- Remove unnecessary network.url check and deploying_revision_id fallback from check_pending_deployments - Replace asyncio.ensure_future with direct coroutines in gather - Rename _register_unregistered_endpoints to _ensure_endpoints_registered - Extract _build_registration_batch and _execute_registration_batch methods - Introduce _EndpointRegistrationBatch dataclass for type safety Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests now accurately simulate the bug: deployment created without a revision, then ActivateRevision'd into DEPLOYING, must get its appproxy endpoint registered via deploying_revision_id. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
ActivateRevision(bypassingcheck_pending) were not getting registered with appproxy, causing them to stay DEGRADEDDeployingProvisioningHandlernow directly callsregister_endpointfor unregistered deployments usingdeploying_revision_idregister_endpointpublic onDeploymentExecutorfor cross-handler reusecheck_pending_deploymentsname for the pending handler pathTest plan
CreateDeployment → AddRevision → ActivateRevisionregisters endpoint in appproxycheck_pending) still works unchanged🤖 Generated with Claude Code
Fixes BA-5557