Package backend :: Package daemons :: Module backend :: Class CoprBackend
[hide private]
[frames] | no frames]

Class CoprBackend

source code


Core process - starts/stops/initializes workers and other backend components

:param config_file: path to the backend configuration file :param ext_opts: additional options for backend

Instance Methods [hide private]
 
__init__(self, config_file=None, ext_opts=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
clean_task_queues(self)
Make sure there is nothing in our task queues
source code
 
init_task_queues(self)
Connect to the retask.Queue for each group_id.
source code
 
init_sub_process(self)
Create backend logger
source code
 
event(self, what)
Put a new event into the queue :param what: Event content
source code
 
update_conf(self)
Update backend config from config file
source code
 
spin_up_workers_by_group(self, group)
Handles starting/growing the number of workers
source code
 
prune_dead_workers_by_group_id(self, group_id)
Removes dead workers from the pool
source code
 
terminate(self)
Cleanup backend processes (just workers for now) And also clean all task queues as they would survive copr restart
source code
 
run(self)
Starts backend process.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, config_file=None, ext_opts=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

init_task_queues(self)

source code 

Connect to the retask.Queue for each group_id. Remove old tasks from queues.

spin_up_workers_by_group(self, group)

source code 

Handles starting/growing the number of workers

:param dict group: Builders group

Utilized keys:

  • **id**
  • **max_workers**

prune_dead_workers_by_group_id(self, group_id)

source code 
Removes dead workers from the pool

:return list: alive workers

:raises:
    :py:class:`~backend.exceptions.CoprBackendError` when got dead worker and
        option "exit_on_worker" is enabled

run(self)

source code 

Starts backend process. Control sub process start/stop.