chap_core.runners package¶
Submodules¶
chap_core.runners.command_line_runner module¶
- class chap_core.runners.command_line_runner.CommandLineRunner(working_dir: str | Path)[source]¶
Bases:
Runner
- class chap_core.runners.command_line_runner.CommandLineTrainPredictRunner(runner: CommandLineRunner, train_command: str, predict_command: str, model_configuration_filename: str | None = None)[source]¶
Bases:
TrainPredictRunner
chap_core.runners.conda_runner module¶
chap_core.runners.docker_runner module¶
- class chap_core.runners.docker_runner.DockerRunner(docker_name: str, working_dir: str | Path, model_configuration_filename: str | None = None)[source]¶
Bases:
RunnerRuns through a docker image specified by name (e.g. on dockerhub), not a Dockerfile
- class chap_core.runners.docker_runner.DockerTrainPredictRunner(runner: DockerRunner, train_command: str, predict_command: str, model_configuration_filename: str | None = None)[source]¶
Bases:
CommandLineTrainPredictRunnerThis is basically a CommandLineTrainPredictRunner, but with a DockerRunner instead of a CommandLineRunner as runner
chap_core.runners.helper_functions module¶
- chap_core.runners.helper_functions.get_train_predict_runner(mlproject_file: Path, runner_type: Literal['mlflow', 'docker'], skip_environment=False) TrainPredictRunner[source]¶
Returns a TrainPredictRunner based on the runner_type. If runner_type is “mlflow”, returns an MlFlowTrainPredictRunner. If runner_type is “docker”, the mlproject file is parsed to create a runner if skip_environment, mlflow and docker is not used, instead returning a TrainPredictRunner that uses the command line
- chap_core.runners.helper_functions.get_train_predict_runner_from_model_template_config(model_template_config: ModelTemplateConfigV2, working_dir: Path, skip_environment=False, model_configuration: ModelConfiguration | None = None) TrainPredictRunner[source]¶
Utility function that returns a suitbale runner for a model given a ModelTemplateConfig (which contains information about what runner the Template says that its models shold use) Returns a TrainPredictRunner (e.g. a MlFlowTrainPredictRunner or a DockerTrainPredictRunner) by parsing the config for the template.
chap_core.runners.mlflow_runner module¶
- class chap_core.runners.mlflow_runner.MlFlowTrainPredictRunner(model_path, model_configuration_filename=None, train_params=None)[source]¶
Bases:
TrainPredictRunner
chap_core.runners.runner module¶
- class chap_core.runners.runner.Runner[source]¶
Bases:
objectAn interface for Runners. A runner is able to run “something”, e.g. a command on the command line through Docker.