:py:mod:`electrolyt.run` ======================== .. py:module:: electrolyt.run .. autoapi-nested-parse:: Electrolyt job execution and scheduling. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: electrolyt.run.ElectrolytJob electrolyt.run.ElectrolytJobFactory Attributes ~~~~~~~~~~ .. autoapisummary:: electrolyt.run.logger electrolyt.run.STATUS .. py:data:: logger .. py:data:: STATUS .. py:class:: ElectrolytJob(uid: str, data: e3.anod.action.Action, notify_end: collections.abc.Callable, spec_repo: e3.anod.loader.AnodSpecRepository, sandbox: e3.anod.sandbox.SandBox, store: e3.store.backends.base.Store, force_status: e3.anod.status.ReturnValue = STATUS.unknown, dry_run: bool = False) Bases: :py:obj:`e3.job.Job` An electrolyt Job. :ivar sandbox: The sandbox where to run the electrolyt job. :vartype sandbox: e3.anod.sandbox.SandBox :ivar force_status: Set the status of the job. :vartype force_status: e3.anod.status.ReturnValue :ivar dry_run: If True report kind of action without execution. :vartype dry_run: bool :ivar store: The store backend for accessing source and binary packages. :vartype store: e3.store.backends.base.Store .. py:property:: status :type: e3.anod.status.ReturnValue See Job.status' description. .. py:method:: run() -> None Execute the action by calling its run_method. Updates status to failure if an exception occurs. Skips execution if dry_run is enabled or status is already set. .. py:method:: run_anod_primitive(primitive: str) -> None Run an anod primitive after setting up the sandbox. :param primitive: name of the anod primitive to run (build, install, test, etc.) .. py:method:: do_build() -> None Run anod build primitive. .. py:method:: do_install() -> None Run anod install primitive. .. py:method:: do_test() -> None Run anod test primitive. .. py:method:: do_checkout() -> None Get sources from vcs to sandbox vcs_dir. .. py:method:: do_createsource() -> None Prepare src from vcs to cache using sourcebuilders. .. py:method:: do_getsource() -> None action_item from an intermediate node. This action should return success status so do_install source can procede. .. py:method:: do_installsource() -> None Install the source from tmp/cache to build_space/src. .. py:method:: do_uploadbinarycomponent() -> None Upload a binary component. .. py:method:: do_uploadsource() -> None Upload a binary component. .. py:method:: do_root() -> None Express the final result of the exec. .. py:class:: ElectrolytJobFactory(sandbox: e3.anod.sandbox.SandBox, asr: e3.anod.loader.AnodSpecRepository, store: e3.store.backends.base.Store, dry_run: bool = False) Factory for creating and managing electrolyt jobs. :ivar job_status: mapping of job uid to job status :ivar sandbox: sandbox where jobs run :ivar asr: anod spec repository :ivar dry_run: whether to run in dry-run mode :ivar store: store backend for packages .. py:method:: get_job(uid: str, data: e3.anod.action.Action, predecessors: frozenset[str], notify_end: collections.abc.Callable) -> ElectrolytJob Create a new electrolyt job. :param uid: unique identifier for the job :param data: action to be executed by the job :param predecessors: set of predecessor job uids :param notify_end: callback to call when job is finished :return: a new ElectrolytJob instance .. py:method:: collect(job: e3.job.Job) -> Literal[False] Return False as the job is never requeued. :param job: the job to collect :return: always False .. py:method:: run(action_list: e3.collection.dag.DAG) -> None Run all actions in the given DAG. :param action_list: DAG of actions to execute