Skip to content

Commit

Permalink
trying a different way
Browse files Browse the repository at this point in the history
  • Loading branch information
Heather MacDonald committed Aug 10, 2023
1 parent a9dd9db commit 1d833ea
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 68 deletions.
34 changes: 28 additions & 6 deletions client/verta/verta/endpoint/build/_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from verta._internal_utils import _utils, time_utils
from . import _build_scan
from ._build_hardware_compatibility import BuildHardwareCompatibility


class Build:
Expand Down Expand Up @@ -42,6 +41,8 @@ class Build:
Message or logs associated with the build.
is_complete : bool
Whether the build is finished either successfully or with an error.
nvidia_gpu_compatible_hardware : set, Optional
The set of nvidia gpu hardware that is compatible with this build.
"""

Expand Down Expand Up @@ -112,17 +113,38 @@ def get_scan(self) -> _build_scan.BuildScan:
return _build_scan.BuildScan._get(self._conn, self.id)

def get_hardware_compatibility(self):
"""Get this build's hardware compatibility. If no hardware compatibility was specified,
returns None.

.. versionadded:: 0.25.0
return BuildHardwareCompatibility._get(self._conn, self.id)

@property
def nvidia_gpu_compatible_hardware(self):
"""Get this build's Nvidia GPU hardware compatibility. If no hardware compatibility was
specified or if this build does not use GPUs, returns None.
.. versionadded:: 0.24.1
Returns
-------
:class:`~verta.endpoint.build.BuildHardwareCompatibility` or None
set or None
"""
return BuildHardwareCompatibility._get(self._conn, self.id)

hardware_compatibility = self._json["creator_request"].get("hardware_compatibility")
if hardware_compatibility is None:
return None
nvidia_gpu = hardware_compatibility.get("nvidia_gpu")
if nvidia_gpu is None:
return None

allows_all_models = nvidia_gpu.get("all")
allowed_models = set()
for model, allowed in nvidia_gpu.items():
if model == "all":
continue
if allowed or allows_all_models:
allowed_models.add(model)
return allowed_models


def start_scan(self, external: bool) -> _build_scan.BuildScan:
"""Start a new scan for this build. Internal scans are not yet supported.
Expand Down
62 changes: 0 additions & 62 deletions client/verta/verta/endpoint/build/_build_hardware_compatibility.py

This file was deleted.

1 comment on commit 1d833ea

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker Tag: hm_VRD-1043_addGpuResource-2023-08-10T23-21-02--1d833ea

Please sign in to comment.