Package backend :: Module dispatcher :: Class Worker
[hide private]
[frames] | no frames]

Class Worker

source code


Instance Methods [hide private]
 
__init__(self, opts, jobs, events, worker_num, ip=None, create=True, callback=None, lock=None) source code
 
event(self, topic, template, content=None)
Multi-purpose logging method.
source code
 
spawn_instance(self, retry=0)
call the spawn playbook to startup/provision a building instance
source code
 
terminate_instance(self, ip)
call the terminate playbook to destroy the building instance
source code
 
parse_job(self, jobfile) source code
 
post_to_frontend(self, data)
send data to frontend
source code
 
mark_started(self, job) source code
 
return_results(self, job) source code
 
run(self)
Worker should startup and check if it can function for each job it takes from the jobs queue run opts.setup_playbook to create the instance do the build (mockremote) terminate the instance.
source code
Method Details [hide private]

event(self, topic, template, content=None)

source code 

Multi-purpose logging method.

Logs messages to two different destinations:

  • To log file
  • The internal "events" queue for communicating back to the dispatcher.
  • The fedmsg bus. Messages are posted asynchronously to a zmq.PUB socket.