Re-pin deployment desired_worker to current model_version on serve#1024
Open
ackizilkale wants to merge 2 commits intomasterfrom
Open
Re-pin deployment desired_worker to current model_version on serve#1024ackizilkale wants to merge 2 commits intomasterfrom
ackizilkale wants to merge 2 commits intomasterfrom
Conversation
When `clarifai model serve` reuses an existing deployment, the patch
silently failed for two reasons:
1. PatchDeployments only accepts action='overwrite' — 'merge' is
rejected by the backend ("Invalid action: Unrecognized action
'merge'. Supported actions: overwrite"). The CLI used 'merge', and
the failure was swallowed by `except Exception: pass`, so even the
visibility patch this code claimed to do was never landing.
2. `Deployment.worker` is the *observed* state (read-only on input);
writes to it are silently ignored by the backend. The writable input
is `Deployment.desired_worker`.
With deploy_latest_version=False (set in #1022 for serve deployments),
the deployment is pinned to whatever desired_worker.model.model_version.id
it has. When the method-signatures hash changes a new model_version and
runner are created, but the deployment's desired_worker stayed on the old
version_id — leaving API calls routed to a version with no live runner
("Model is still deploying...").
Switch action to 'overwrite', patch desired_worker (not worker), and
surface non-success responses + exceptions as warnings instead of
swallowing them. Idempotent when the version is unchanged; heals the
binding when it changed.
Minimum allowed line rate is |
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.
When
clarifai model servereuses an existing deployment, the patch silently failed for two reasons:PatchDeployments only accepts action='overwrite' — 'merge' is rejected by the backend ("Invalid action: Unrecognized action 'merge'. Supported actions: overwrite"). The CLI used 'merge', and the failure was swallowed by
except Exception: pass, so even the visibility patch this code claimed to do was never landing.Deployment.workeris the observed state (read-only on input); writes to it are silently ignored by the backend. The writable input isDeployment.desired_worker.With deploy_latest_version=False (set in #1022 for serve deployments), the deployment is pinned to whatever desired_worker.model.model_version.id it has. When the method-signatures hash changes a new model_version and runner are created, but the deployment's desired_worker stayed on the old version_id — leaving API calls routed to a version with no live runner ("Model is still deploying...").
Switch action to 'overwrite', patch desired_worker (not worker), and surface non-success responses + exceptions as warnings instead of swallowing them. Idempotent when the version is unchanged; heals the binding when it changed.