electrolyt.run

Electrolyt job execution and scheduling.

Module Contents

Classes

ElectrolytJob

An electrolyt Job.

ElectrolytJobFactory

Factory for creating and managing electrolyt jobs.

Attributes

logger

STATUS

electrolyt.run.logger
electrolyt.run.STATUS
class electrolyt.run.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: e3.job.Job

An electrolyt Job.

Variables:
  • sandbox (e3.anod.sandbox.SandBox) – The sandbox where to run the electrolyt job.

  • force_status (e3.anod.status.ReturnValue) – Set the status of the job.

  • dry_run (bool) – If True report kind of action without execution.

  • store (e3.store.backends.base.Store) – The store backend for accessing source and binary packages.

property status: e3.anod.status.ReturnValue

See Job.status’ description.

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.

run_anod_primitive(primitive: str) None

Run an anod primitive after setting up the sandbox.

Parameters:

primitive – name of the anod primitive to run (build, install, test, etc.)

do_build() None

Run anod build primitive.

do_install() None

Run anod install primitive.

do_test() None

Run anod test primitive.

do_checkout() None

Get sources from vcs to sandbox vcs_dir.

do_createsource() None

Prepare src from vcs to cache using sourcebuilders.

do_getsource() None

action_item from an intermediate node.

This action should return success status so do_install source can procede.

do_installsource() None

Install the source from tmp/cache to build_space/src.

do_uploadbinarycomponent() None

Upload a binary component.

do_uploadsource() None

Upload a binary component.

do_root() None

Express the final result of the exec.

class electrolyt.run.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.

Variables:
  • job_status – mapping of job uid to job status

  • sandbox – sandbox where jobs run

  • asr – anod spec repository

  • dry_run – whether to run in dry-run mode

  • store – store backend for packages

get_job(uid: str, data: e3.anod.action.Action, predecessors: frozenset[str], notify_end: collections.abc.Callable) ElectrolytJob

Create a new electrolyt job.

Parameters:
  • uid – unique identifier for the job

  • data – action to be executed by the job

  • predecessors – set of predecessor job uids

  • notify_end – callback to call when job is finished

Returns:

a new ElectrolytJob instance

collect(job: e3.job.Job) Literal[False]

Return False as the job is never requeued.

Parameters:

job – the job to collect

Returns:

always False

run(action_list: e3.collection.dag.DAG) None

Run all actions in the given DAG.

Parameters:

action_list – DAG of actions to execute