Skip to content

Commit dd11d1b

Browse files
nesitorAndres D. Molins
andauthored
Solve VM stop from scheduler request (#842)
Fix: Solved issue that a credit VM is stopped when receive the allocations request from the scheduler. Co-authored-by: Andres D. Molins <[email protected]>
1 parent 105c7f0 commit dd11d1b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/aleph/vm/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ def controller_service(self) -> str:
233233
def uses_payment_stream(self) -> bool:
234234
return self.message.payment and self.message.payment.is_stream
235235

236+
@property
237+
def uses_payment_credit(self) -> bool:
238+
return self.message.payment and self.message.payment.is_credit
239+
236240
@property
237241
def has_resources(self) -> bool:
238242
assert self.vm, "The VM attribute has to be set before calling has_resources()"

src/aleph/vm/orchestrator/views/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ async def update_allocations(request: web.Request):
465465
execution.vm_hash not in allocations
466466
and execution.is_running
467467
and not execution.uses_payment_stream
468+
and not execution.uses_payment_credit
468469
and not execution.gpus
469470
and not execution.is_confidential
470471
):

0 commit comments

Comments
 (0)