Commit 316a64b
authored
Re-pin deployment desired_worker to current model_version on serve (#1024)
* Re-pin deployment desired_worker to current model_version on serve
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.
* linter1 parent 4493886 commit 316a64b
1 file changed
Lines changed: 36 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1854 | 1854 | | |
1855 | 1855 | | |
1856 | 1856 | | |
| 1857 | + | |
1857 | 1858 | | |
1858 | 1859 | | |
1859 | 1860 | | |
| |||
2224 | 2225 | | |
2225 | 2226 | | |
2226 | 2227 | | |
2227 | | - | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
2228 | 2244 | | |
2229 | 2245 | | |
2230 | 2246 | | |
2231 | | - | |
2232 | 2247 | | |
2233 | 2248 | | |
2234 | 2249 | | |
2235 | 2250 | | |
2236 | 2251 | | |
2237 | 2252 | | |
2238 | 2253 | | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
2239 | 2264 | | |
2240 | 2265 | | |
2241 | | - | |
| 2266 | + | |
2242 | 2267 | | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
2246 | 2276 | | |
2247 | 2277 | | |
2248 | 2278 | | |
| |||
0 commit comments