jobcontrol.job_conf

Functions to manage the job configuration

The job configuration is a YAML object (dict) containing (at least) the following keys:

  • module - name of the module from wich to import the function
  • function - name of the function to be called
  • args - arguments to the function (list)
  • kwargs - keyword arguments to the function (dictionary)
  • dependencies - dependencies for this job

Additional “constructors” are available:

  • !retval <n> will be replaced with return value of latest successful build for dependency job <n> (and job <n> must be specified as a dependency)
  • [proposed] !cfg <name> will be replaced with global configuration option <name>
  • [proposed] “system” objects, such as context, job configuration, ... might be passed/accessed as well?
    • execution context
    • current job object
    • current build object
  • [proposed] !secret <name> value from “secret” configuration, usually used for storing passwords etc, on file.

Note: job configuration widgets need to manipulate the configuration, if we want to expose it in a nicer way – is there any way to do so while preserving formatting / comments in other parts of the document?


Job configuration:

jobs:

  - name: my-job-name
    title: A descriptive title
    function: package.module:name
    args: []
    kwargs:
      storage: {url: 'mongodb://...'}
      input_storage: !retval 'other-job-name'
    dependencies: ['other-job-name']

  - name: other-job-name
    title: Another descriptive title
    function: package.module:othername
class jobcontrol.job_conf.Retval(job_id)[source]

Placeholder for !retval <n>

jobcontrol.job_conf.dump(data)[source]
jobcontrol.job_conf.load(stream)[source]
jobcontrol.job_conf.prepare_args(args, build)[source]

Prepare arguments / kwargs by replacing placeholders with actual values from the context.

class jobcontrol.job_conf.JobControlConfigMgr(initial=None)[source]
classmethod from_file(filename)[source]
classmethod from_string(s)[source]
classmethod from_object(data)[source]
config[source]
validate(data)[source]
iter_jobs()[source]
get_job(job_id)[source]
get_job_deps(job_id)[source]
get_job_revdeps(job_id)[source]
get_webapp_config()[source]

Returns a dict containing configuration for the Flask app

get_secret(name)[source]
get_storage()[source]