ai2_kit.core.executor module#

class ai2_kit.core.executor.BaseExecutorConfig(*, ssh: Optional[SshConfig] = None, queue_system: QueueSystemConfig, work_dir: str, python_cmd: str = 'python')[source]#

Bases: BaseModel

python_cmd: str#
queue_system: QueueSystemConfig#
ssh: Optional[SshConfig]#
work_dir: str#
class ai2_kit.core.executor.Executor[source]#

Bases: ABC

abstract download(from_artifact: Artifact, to_dir: str) Artifact[source]#
abstract dump_text(text: str, path: str)[source]#
abstract glob(pattern: str) List[str][source]#
init()[source]#
abstract load_text(path: str) str[source]#
abstract mkdir(path: str)[source]#
name: str#
python_cmd: str#
abstract resolve_artifact(artifact: Artifact) List[str][source]#
abstract run(script: str, **kwargs) Result[source]#
abstract run_python_fn(fn: FnType, python_cmd=None) FnType[source]#
abstract run_python_script(script: str, python_cmd=None)[source]#
setup_workspace(workspace_dir: str, dirs: List[str])[source]#
abstract submit(script: str, **kwargs) JobFuture[source]#
tmp_dir: str#
abstract upload(from_artifact: Artifact, to_dir: str) Artifact[source]#
work_dir: str#
class ai2_kit.core.executor.ExecutorManager(executor_configs: Mapping[str, BaseExecutorConfig])[source]#

Bases: object

get_executor(name: str)[source]#
class ai2_kit.core.executor.HpcExecutor(connector: BaseConnector, queue_system: BaseQueueSystem, work_dir: str, python_cmd: str, name: str)[source]#

Bases: Executor

download(from_artifact: Artifact, to_dir: str) Artifact[source]#
dump_text(text: str, path: str)[source]#
classmethod from_config(config: Union[dict, BaseExecutorConfig], name: str = '')[source]#
glob(pattern: str)[source]#
init()[source]#
property is_local#
load_text(path: str) str[source]#
mkdir(path: str)[source]#
name: str#
python_cmd: str#
resolve_artifact(artifact: Artifact) List[str][source]#
run(script: str, **kwargs)[source]#
run_python_fn(fn: FnType, python_cmd=None, cwd=None) FnType[source]#
run_python_script(script: str, python_cmd=None, cwd=None)[source]#
submit(script: str, cwd: str, **kwargs)[source]#
tmp_dir: str#
upload(from_artifact: Artifact, to_dir: str) Artifact[source]#
work_dir: str#
ai2_kit.core.executor.create_executor(config: BaseExecutorConfig, name: str) Executor[source]#
ai2_kit.core.executor.fn_to_script(fn: Callable, delimiter='@')[source]#