Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/aleph/vm/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
try:
if message.requirements and message.requirements.gpu:
# Ensure we have the necessary GPU for the user by reserving them
resources = self.find_resources_available_for_user(cast(message, InstanceContent), message.address)
resources = self.find_resources_available_for_user(message, message.address)

Check warning on line 152 in src/aleph/vm/pool.py

View check run for this annotation

Codecov / codecov/patch

src/aleph/vm/pool.py#L152

Added line #L152 was not covered by tests
# First assign Host GPUs from the available
execution.prepare_gpus(list(resources))
# Prepare VM general Resources and also the GPUs
Expand Down Expand Up @@ -383,7 +383,7 @@
del self.reservations[resource]
return self.reservations.get(resource)

async def reserve_resources(self, message: InstanceContent, user):
async def reserve_resources(self, message: ExecutableContent, user):
gpu_to_reserve = message.requirements.gpu if message.requirements and message.requirements.gpu else []
expiration_date = datetime.now(tz=timezone.utc) + timedelta(seconds=60)
if not gpu_to_reserve:
Expand All @@ -400,8 +400,8 @@

return expiration_date

def find_resources_available_for_user(self, message: InstanceContent, user) -> set[GpuDevice]:
"""Find required resource to run InstanceContent from reserved resources by user or free resources.
def find_resources_available_for_user(self, message: ExecutableContent, user) -> set[GpuDevice]:
"""Find required resource to run ExecutableContent from reserved resources by user or free resources.

Only implement GPU for now"""
# Calling function should use the creation_lock to avoid resource being stollem
Expand Down