hydrosdk.servable module

This module contains all the code associated with Servables and their management at Hydrosphere platform. You can learn more about Servables here https://hydrosphere.io/serving-docs/latest/overview/concepts.html#servable.

show-inheritance

class hydrosdk.servable.Servable(cluster, model_version_id, servable_name, status, status_message, deployment_configuration_name, metadata=None)

Servable is an instance of a model version which is used within applications. Intendend for internal usage only.

Parameters
Return type

Servable

static create(cluster, model_name, version, metadata=None, deployment_configuration=None)

Deploy an instance of uploaded model version at your cluster.

Parameters
Raises

ServableException

Returns

servable

Return type

hydrosdk.servable.Servable

static delete(cluster, servable_name)

Shut down and delete servable instance.

Parameters
Returns

json response from serve

Return type

dict

static find_by_name(cluster, servable_name)

Finds a serving servable in a cluster

Parameters
Raises

ServableException

Returns

Servable

Return type

hydrosdk.servable.Servable

static list(cluster)

Retrieve a list of all servables available at your cluster

Parameters

cluster (hydrosdk.cluster.Cluster) – Hydrosphere cluster

Returns

List of all Servables available at your cluster

Return type

List[hydrosdk.servable.Servable]

lock_while_starting(timeout=120)

Wait for a servable to become ready.

Parameters

timeout (int) –

Return type

hydrosdk.servable.Servable

predictor(monitorable=True, return_type=PredictorDT.DICT_NP_ARRAY)

Returns a predictor object which is used to pass data into the deployed Servable

Parameters
  • monitorable – If True, the data will be shadowed to the monitoring service

  • return_type – Specifies into which data format should predictor return Servable outputs

Returns

Return type

hydrosdk.predictor.PredictServiceClient

class hydrosdk.servable.ServableStatus(value)

Servable can be in one of four states

static from_camel_case(camel_case_servable_status)

Get value of ServableStatus enum from CamelCase style string returned from the manager. :param camel_case_servable_status: :return: ServableStatus

Example

Parameters

camel_case_servable_status (str) –

Return type

hydrosdk.servable.ServableStatus

>>> ServableStatus.from_camel_case("NotServing")
ServableStatus.NOT_SERVING