Objects responsible for JobControl core functionality.
Note
Important objects from this module should be imported in main __init___, in order to “abstract away” the namespace and have them in a more nicely accessible place.
The main JobControl class.
Parameters: |
|
---|
Initialize JobControl by loading configuration from a file. Will also initialize storage taking values from the configuration.
Parameters: | config_file – Path to configuration file, or an open file descriptor (or file-like object). |
---|---|
Returns: | a JobControl instance |
Initialize JobControl from some configuration.
Parameters: | config – Either a jobcontrol.config.JobControlConfig instance, or a dict to be passed as argument to that class constructor. |
---|---|
Returns: | a JobControl instance |
Get a job, by id.
Parameters: | job_id – The job id |
---|---|
Returns: | a JobInfo class instance associated with the requested job. |
Raises: | jobcontrol.exceptions.NotFound if a job with that id was not found in the configuration. |
Generator yielding all the jobs, one by one.
Yields: | for each job, a JobInfo class instance associated with the job. |
---|
Get a build, by id.
Parameters: | build_id – The build id |
---|---|
Returns: | a BuildInfo instance associated with the build. |
Raises: | jobcontrol.exceptions.NotFound if a build with that id was not found in the configuration. |
Create a build, from a job configuration.
Note
Currently, we require that all the dependencies have already been built; in the future, it will be possible to build them automatically.
Note
Also, current implementation doesn’t allow for customizations to either the job configuration nor the build one (pinning, dep/revdep building, ...).
Parameters: | job_id – Id of the job for which to start a build |
---|---|
Returns: | a BuildInfo instance associated with the newly created build. |
Raises: |
|
Create and run a new build for the specified job.
This is simply a shortcut that runs create_build() then run_build(). (Mostly for compatibility reasons).
Returns: | a BuildInfo instance associated with the newly created build. |
---|
Actually run a build.
Parameters: | build_id – either a BuildInfo instance, or a build id |
---|
Report progress for the currently running build.
Parameters: |
|
---|
Class to hold “global” context during job execution.
This class can also act as a context manager for temporary context:
with JobExecutionContext(app, job_id, build_id):
pass # do stuff in an execution context
Parameters: |
|
---|
Logging handler sending messages to the appropriate JobControl instance that will dispatch them to storage.
High-level interface to jobs.
Provides high-level methods for, eg, creating a build out of this job or iterating builds.
Configuration is stored in the config attribute (a BuildConfig instance).
Return a label describing the current status of the job.
Returns: |
|
---|
Iterate over builds for this job.
Accepts the same arguments as jobcontrol.interfaces.StorageBase.get_job_builds()
Yields: | BuildInfo instances |
---|
Get latest successful build for this job, if any. Otherwise, returns None.
Return the job configuration as serialized YAML, mostly for displaying on user interfaces.
High-level interface to builds.
Parameters: |
|
---|
Property used to lazily access the build attributes.
Returns a dict with the following keys:
Return a label describing the current status of the build.
Returns: |
|
---|