caikit.core.model_management.local_job_base
The LocalJobBase is the base class for running training and prediction jobs using either local threads or subprocesses.
- model_management:
- <job type>:
- <job executor name>:
type: LOCAL config:
# How long to retain results retention_duration: <null or str>
Attributes
Classes
LocalJobBase is the base class for running background jobs on a local |
Module Contents
- caikit.core.model_management.local_job_base.error
- class caikit.core.model_management.local_job_base.LocalJobBase(config: aconfig.Config, instance_name: str)[source]
Bases:
caikit.core.model_management.job_base.JobBaseLocalJobBase is the base class for running background jobs on a local machine and does not depend on any datastore or backend. Any result is cleared after the defined retention_duration
- class LocalJobFuture(future_name: str, module_class: Type[caikit.core.modules.ModuleBase], save_path: str | caikit.interfaces.common.data_model.stream_sources.S3Path | None, save_with_id: bool, future_id: str | None, args: Iterable[Any], kwargs: Dict[str, Any], model_name: str | None = None, use_subprocess: bool = False, extra_path_args: List[str] | None = None, subprocess_start_method: str | None = 'fork')[source]
Bases:
caikit.core.model_management.job_base.JobFutureBaseA local job future manages running a job in a thread and tracking its status
- _module_class
- _completion_time = None
- _submission_time
- _save_path
- _use_subprocess = False
- _subprocess_start_method = 'fork'
- property save_path: str | None
If created with a save path, the future must expose it, including any injected background id
- property completion_time: datetime.datetime | None
- abstract run()[source]
Abstract method for starting the job. Needs to be implemented by the trainers and predictors
- get_info() caikit.core.model_management.job_base.JobInfo[source]
The local job checks the info by the current thread status
- _make_background_info(status: caikit.core.data_model.JobStatus, errors: List[Exception] | None = None) caikit.core.model_management.job_base.JobInfo[source]
- _timedelta_expr
- _instance_name
- _retention_duration
- _futures: Dict[str, LocalJobBase.__init__.self]
- _futures_lock
- get_local_future(job_id: str) LocalJobFuture[source]
Look up the model future for the given id