Skip to main content
Version: master πŸƒ

Submarine Client

class SubmarineClient()​

Client of submarine to log metric/param, save model and create/delete serve.

log_metric(job_id, key, value, worker_index, timestamp, step) -> None​

Log a single key-value metric with job id and worker index. The value must always be a number.

ParamTypeDescriptionDefault Value
job_idStringThe job name to which the metric should be logged.x
keyStringMetric name.x
valueFloatMetric worker_index.x
worker_indexStringParameter worker_index.x
timestampDatetimeTime when this metric was calculated. Defaults to the current system time.datetime.now()
stepIntegerA single integer step at which to log the specified Metrics, by default it's 0.0

log_param(job_id, key, value, worker_index) -> None​

Log a single key-value parameter with job id and worker index. The key and value are both strings.

ParamTypeDescriptionDefault Value
job_idStringThe job name to which the parameter should be logged.x
keyStringParameter name.x
valueStringParameter value.x
worker_indexStringParameter worker_index.x

save_model(model, model_type, registered_model_name, input_dim, output_dim) -> None​

Save a model into the minio pod.

ParamTypeDescriptionDefault Value
modelObjectModel artifact.x
model_typeStringVersion of a registered model.x
registered_model_nameStringIf it is not None, the model will be registered into the model registry with this name.None
input_dimList<String>The input dimension of the model.None
output_dimList<String>The output dimension of the model.None

create_serve(self, model_name, model_version, async_req = True) -> dict​

Create serve of a model through Seldon Core.

ParamTypeDescriptionDefault Value
model_nameStringName of a registered model.x
model_versionIntegerVersion of a registered model.x
async_reqBooleanExecute request asynchronously.True

Returns Return a dictionary with inference url.

delete_serve(self, model_name, model_version, async_req) -> None​

Delete a serving model.

ParamTypeDescriptionDefault Value
model_nameStringName of a registered model.x
model_versionIntegerVersion of a registered model.x
async_reqBooleanExecute request asynchronously.True