backend.daemons.backend

class backend.daemons.backend.CoprBackend(config_file=None, ext_opts=None)[source]

Core process - starts/stops/initializes workers

Parameters:
  • config_file – path to the backend configuration file
  • ext_opts – additional options for backend
init_task_queues()[source]

Remove old tasks from queues.

update_conf()[source]

Update backend config from config file

spin_up_workers_by_group(group)[source]

Handles starting/growing the number of workers

Parameters:group (dict) – Builders group
Utilized keys:
  • id
  • max_workers
prune_dead_workers_by_group_id(group_id)[source]

Removes dead workers from the pool

Return list:

alive workers

Raises:
CoprBackendError when got dead worker and

option “exit_on_worker” is enabled

terminate()[source]

Cleanup backend processes (just workers for now) And also clean all task queues as they would survive copr restart

run()[source]

Starts backend process. Control sub process start/stop.

backend.daemons.backend.run_backend(opts)[source]

Start main backend daemon

Parameters:opts – Munch object with command line options
Expected opts fields:
  • config_file - path to the backend config file
  • daemonize - boolean flag to enable daemon mode
  • pidfile - path to the backend pidfile
  • daemon_user
  • daemon_group

Previous topic

backend.exceptions

Next topic

backend.daemons.dispatcher

This Page