Skip to content

Commit 11d4b48

Browse files
author
Andres D. Molins
committed
Fix: Solved issue that a credit VM is stopped when receive the allocations request from the scheduler.
1 parent 105c7f0 commit 11d4b48

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies = [
5252
"pydantic>=2,<3",
5353
"pydantic-settings~=2.6.1",
5454
"pyroute2==0.7.12",
55-
"python-cpuid==0.1.1",
55+
#"python-cpuid==0.1.1",
5656
"python-dotenv~=1.1.0",
5757
"pyyaml==6.0.1",
5858
"qmp==1.1",
@@ -61,7 +61,7 @@ dependencies = [
6161
"setproctitle==1.3.3",
6262
"solathon==1.0.2",
6363
"sqlalchemy[asyncio]>=2",
64-
"systemd-python==235",
64+
#"systemd-python==235",
6565
]
6666

6767
urls.Discussions = "https://community.aleph.im/"

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)