Skip to main content

Module clients.internal_dai_version.client

Classes

InternalDAIVersionClient

class InternalDAIVersionClient(connection_config: h2o_engine_manager.clients.connection_config.ConnectionConfig, verify_ssl: bool = True, ssl_ca_cert: Optional[str] = None)

InternalDAIVersionClient manages InternalDAIVersions.

Initializes InternalDAIVersionClient.

Args
connection_config : ConnectionConfig
AIEM connection configuration object.
verify_ssl
Set to False to disable SSL certificate verification.
ssl_ca_cert
Path to a CA cert bundle with certificates of trusted CAs.

Methods

apply_internal_dai_versions

def apply_internal_dai_versions(self, version_configs: List[h2o_engine_manager.clients.internal_dai_version.version_config.InternalDAIVersionConfig]) ‑> List[h2o_engine_manager.clients.internal_dai_version.version.InternalDAIVersion]

Set all InternalDAIVersions to a state defined in the version_configs. InternalDAIVersions not specified in the version_configs will be deleted. InternalDAIVersions specified in the version_configs will be recreated with the new values. When multiple InternalDAIVersions are configured with the same alias, the latest one in the version_configs list will have this alias assigned (rest will have it removed).

Args
version_configs
configuration of InternalDAIVersions that should be applied

Returns: applied InternalDAIVersions

assign_aliases

def assign_aliases(self, internal_dai_version_id: str, aliases: List[str]) ‑> List[h2o_engine_manager.clients.internal_dai_version.version.InternalDAIVersion]

Assign new set of aliases to InternalDAIVersion. This will replace existing InternalDAIVersion aliases with the new aliases. If there are other InternalDAIVersions with the same alias that we try to assign, they will be deleted from the other InternalDAIVersions.

Example 1 - assign only alias latest to another InternalDAIVersion:

  • InternalDAIVersions: daiv1.aliases=["latest", "foo"], daiv2.aliases=["bar", "baz"], daiv3.aliases=["goo"]
  • AssignAliases(daiv3, aliases=["latest"])
  • InternalDAIVersions: daiv1.aliases=["foo"], daiv2.aliases=["bar", "baz"], daiv3.aliases=["latest"] Note that alias "latest" was deleted from daiv1 and alias "goo" was deleted from daiv3.

Example 2 - add alias latest to another InternalDAIVersion:

  • InternalDAIVersions: daiv1.aliases=["latest", "foo"], daiv2.aliases=["bar", "baz"], daiv3.aliases=["goo"]
  • AssignAliases(daiv3, aliases=["goo", "latest"])
  • InternalDAIVersions: daiv1.aliases=["foo"], daiv2.aliases=["bar", "baz"], daiv3.aliases=["goo", "latest"] Note that alias "latest" was deleted from daiv1 and alias "goo" remained in the daiv3.

Example 3 - assign multiple aliases which affects aliases of multiple InternalDAIVersions:

  • InternalDAIVersions: daiv1.aliases=["latest", "foo"], daiv2.aliases=["bar", "baz"], daiv3.aliases=["goo"]
  • AssignAliases(daiv3, aliases=["latest", "bar"])
  • InternalDAIVersions: daiv1.aliases=["foo"], daiv2.aliases=["baz"], daiv3.aliases=["latest", "bar"] Note that
  • alias "latest" was deleted from daiv1
  • alias "latest" was added to daiv3
  • alias "bar" was deleted from daiv2
  • alias "goo" was deleted from daiv3
Args
internal_dai_version_id
ID of the InternalDAIVersion
aliases
aliases to assign to the InternalDAIVersion
Returns

all InternalDAIVersions after applying the new aliases

create_version

def create_version(self, internal_dai_version_id: str, image: str, image_pull_policy: h2o_engine_manager.clients.base.image_pull_policy.ImagePullPolicy = ImagePullPolicy.IMAGE_PULL_POLICY_UNSPECIFIED, image_pull_secrets: List[str] = [], gpu_resource_name: str = '', data_directory_storage_class: str = '', annotations: Dict[str, str] = , deprecated: bool = False) ‑> h2o_engine_manager.clients.internal_dai_version.version.InternalDAIVersion

Create InternalDAIVersion.

Args
internal_dai_version_id
version identifier. Must be in semver format. More than three segments are supported. For example "1.10.3" or "1.10.3.1".
image
Name of the Docker image when using this version.
image_pull_policy
Image pull policy applied when using this version.
image_pull_secrets
List of references to k8s secrets that can be used for pulling an image of this version from a private container image registry or repository.
aliases
Aliases of this version. For example ["latest"].
gpu_resource_name
K8s GPU resource name. For example: "nvidia.com/gpu" or "amd.com/gpu".
data_directory_storage_class
Name of the storage class used by Driverless AI when using this version.
annotations
Additional arbitrary metadata associated with this version.
deprecated
Indicates whether this version is deprecated.
Returns

Created InternalDAIVersion.

delete_all_internal_dai_versions

def delete_all_internal_dai_versions(self) ‑> None

Help function for deleting all InternalDAIVersions.

delete_version

def delete_version(self, internal_dai_version_id: str) ‑> None

Delete InternalDAIVersion.

Args
internal_dai_version_id
ID of to-be-deleted InternalDAIVersion

get_version

def get_version(self, internal_dai_version_id: str) ‑> h2o_engine_manager.clients.internal_dai_version.version.InternalDAIVersion

Get InternalDAIVersion.

Args
internal_dai_version_id
resource ID of InternalDAIVersion
Returns

InternalDAIVersion

list_all_versions

def list_all_versions(self) ‑> List[h2o_engine_manager.clients.internal_dai_version.version.InternalDAIVersion]

List all InternalDAIVersions.

Returns

InternalDAIVersions

list_versions

def list_versions(self, page_size: int = 0, page_token: str = '') ‑> h2o_engine_manager.clients.internal_dai_version.page.InternalDAIVersionsPage

List InternalDAIVersions.

Args
page_size
Maximum number of InternalDAIVersions to return in a response. If unspecified (or set to 0), at most 50 InternalDAIVersions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
page_token
Leave unset to receive the initial page. To list any subsequent pages use the value of 'next_page_token' returned from the InternalDAIVersionsPage.
Returns

Page of InternalDAIVersions

update_version

def update_version(self, internal_dai_version: h2o_engine_manager.clients.internal_dai_version.version.InternalDAIVersion, update_mask: str = '*') ‑> h2o_engine_manager.clients.internal_dai_version.version.InternalDAIVersion

Update InternalDAIVersion.

Args
internal_dai_version
InternalDAIVersion with to-be-updated values.
update_mask
Comma separated paths referencing which fields to update. Update mask must be non-empty. Allowed field paths are: annotations.
Returns

Updated InternalDAIVersion


Feedback