genvid.toolbox.ClusterTool

Warning

This module has been deprecated. Although the code is still working for our oldest model, it is not expected to work with the new Bastion API. Please, use the new genvid-bastion and genvid-sdk tools.

class genvid.toolbox.ClusterTool(cluster_id='local', **kwargs)

Bases: genvid.toolbox.cluster_api.ClusterAPI, genvid.toolbox.project.ProjectTool

This class allow the configuration of a cluster.

JOBS = {}

The list of available jobs

List of links.

RE_BITRATE = re.compile('(?P<number>\\d+)(?P<prefix>[kmg]i?)?(?P<byte>b)?')

Regexp matching for bitrate conversion

SETUP_JOBS = ('hashi-ui', 'cluster-api', 'bastion-api')

Jobs run on setup.

SETUP_LOGS = ('hashi-ui', 'cluster-api', 'bastion-api')

Logs available on setup.

START_JOBS = ('services',)

Jobs run on start.

add_job(name, dependencies=None)

Add a new nomad job to run. :param name: The name of the job. :param dependencies: A list of service name which the job depends on.

is_jobs_running()

Return True if a job is configured to be running

load_project_jobs()

Load project jobs into consul.

Load project links into consul.

load_project_logs()

Load project logs into consul.

load_project_map_reduce(events)

Load the project map/reduce definitions into the configuration. :param events: The events definition

merge_config(*paths: typing.List[str]) → dict

Merge configuration from file

Parameters:paths – The path of the files
merge_dict(source, destination)

Merge 2 dictionaries

Parameters:
  • source – The source dictionary
  • destination – The destination dictionary
start_project_jobs(*jobs)

Starts an array of jobs :param jobs: The list of jobs

stop_project_jobs(*jobs)

Stops an array of jobs :param jobs: The list of jobs