Skip to content

Commit

Permalink
Fix: Solve code quality issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
nesitor committed Dec 3, 2024
1 parent 39c4b53 commit 523bc44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/aleph/vm/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
from collections.abc import Iterable
from datetime import datetime, timezone
from typing import List

from aleph_message.models import (
Chain,
Expand All @@ -18,7 +19,7 @@
from aleph.vm.controllers.firecracker.snapshot_manager import SnapshotManager
from aleph.vm.network.hostnetwork import Network, make_ipv6_allocator
from aleph.vm.orchestrator.metrics import get_execution_records
from aleph.vm.resources import get_gpu_info
from aleph.vm.resources import GpuProperties, get_gpu_info
from aleph.vm.systemd import SystemDManager
from aleph.vm.utils import get_message_executable_content
from aleph.vm.vm_type import VmType
Expand Down
7 changes: 5 additions & 2 deletions src/aleph/vm/resources.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import subprocess
from enum import Enum
from typing import Optional, List
from typing import List, Optional

from pydantic import BaseModel, Field, Extra
from pydantic import BaseModel, Extra, Field


class GpuDeviceClass(str, Enum):
Expand Down Expand Up @@ -70,6 +70,8 @@ def parse_gpu_device_info(line: str) -> Optional[GpuProperties]:
if not is_gpu_device_class(device_class):
return None

device_class = GpuDeviceClass(device_class)

vendor, vendor_id = device_vendor.split(" [", maxsplit=1)
vendor_id = vendor_id[:-1]
vendor_name = get_vendor_name(vendor_id)
Expand All @@ -79,6 +81,7 @@ def parse_gpu_device_info(line: str) -> Optional[GpuProperties]:
device_id = f"{vendor_id}:{model_id}"

return GpuProperties(
pci_host=pci_host,
vendor=vendor_name,
device_name=device_name,
device_class=device_class,
Expand Down

0 comments on commit 523bc44

Please sign in to comment.