fix(orch): seed ServiceInstance on first allocate start
This commit is contained in:
parent
c5e12b74f2
commit
27999925cf
1 changed files with 12 additions and 1 deletions
|
|
@ -316,15 +316,26 @@ def create_coordinator_app(
|
|||
)
|
||||
if resp.is_success:
|
||||
data = resp.json()
|
||||
svc_url = data.get("url", "")
|
||||
alloc = service_registry.allocate(
|
||||
service=service,
|
||||
node_id=node_id,
|
||||
gpu_id=gpu_id,
|
||||
model=model,
|
||||
caller=req.caller,
|
||||
url=data.get("url", ""),
|
||||
url=svc_url,
|
||||
ttl_s=req.ttl_s,
|
||||
)
|
||||
# Seed the instance state for first-time starts
|
||||
instance_state = "running" if warm else "starting"
|
||||
service_registry.upsert_instance(
|
||||
service=service,
|
||||
node_id=node_id,
|
||||
gpu_id=gpu_id,
|
||||
state=instance_state,
|
||||
model=model,
|
||||
url=svc_url,
|
||||
)
|
||||
return {
|
||||
"allocation_id": alloc.allocation_id,
|
||||
"service": service,
|
||||
|
|
|
|||
Loading…
Reference in a new issue