caikit.core.model_management.job_base

A Base class for background model operations. This class is used for background training and predictions

Classes

JobInfo

JobFutureBase

Every JobBase implementation must have a JobFutureBase class that can access the

JobBase

A class can be constructed by a factory if its constructor takes exactly

Module Contents

class caikit.core.model_management.job_base.JobInfo[source]
status: caikit.core.data_model.JobStatus
errors: List[Exception] | None = None
submission_time: datetime.datetime | None = None
completion_time: datetime.datetime | None = None
class caikit.core.model_management.job_base.JobFutureBase(future_name: str, future_id: str, use_reversible_hash: bool = True, **kwargs)[source]

Bases: abc.ABC

Every JobBase implementation must have a JobFutureBase class that can access the job information in the infrastructure managed by the task.

ID_DELIMITER = ':'
_id = ''
property id: str

Every job future must have a unique ID that can be used to look up the in-flight background task

abstract get_info() JobInfo[source]

Every model future must be able to poll the status of the background job

abstract cancel()[source]

Terminate the given job

abstract wait()[source]

Block until the job reaches a terminal state

abstract result() Any[source]

Support result() to match concurrent.futures.Future

class caikit.core.model_management.job_base.JobBase(config: aconfig.Config, instance_name: str)[source]

Bases: caikit.core.toolkit.factory.FactoryConstructible

A class can be constructed by a factory if its constructor takes exactly one argument that is an aconfig.Config object and it has a name to identify itself with the factory.

abstract get_future(job_id: str) JobFutureBase[source]

Look up the model future for the given id

classmethod get_job_name(job_id: str) str[source]

Un-hash the background’s instance name from the given job id