Skip to content
Snippets Groups Projects
Commit c2a95466 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #8392: fix in redirecting jobs to lexar3/4

parent 1fcbafcb
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ ltaClient = None ...@@ -21,7 +21,7 @@ ltaClient = None
host = socket.gethostname() host = socket.gethostname()
## Using netifaces module or something similar would be nicer, but it doesn't want to install in a custom dir ## Using netifaces module or something similar would be nicer, but it doesn't want to install in a custom dir
## So we use this hack ## So we use this hack
if 'lexar001' in host or 'lexar002' in host: if 'lexar00' in host:
host = host + '.offline.lofar' host = host + '.offline.lofar'
if 'gridftp01.target.rug.nl' in host: if 'gridftp01.target.rug.nl' in host:
host = 'lotar2.staging.lofar' host = 'lotar2.staging.lofar'
......
...@@ -205,7 +205,9 @@ class jobHandler(Process): ...@@ -205,7 +205,9 @@ class jobHandler(Process):
self.update_job_msg.put((job, job['Status'], JobProducing, None)) self.update_job_msg.put((job, job['Status'], JobProducing, None))
job['Status'] = JobProducing job['Status'] = JobProducing
self.active[job['ExportID']] = job self.active[job['ExportID']] = job
self.manager.get(job.get('slave_hosts')).put(job) ## sends it to the slave with the shortest queue of the possible slave_hosts job_slave_hosts = job.get('slave_hosts')
slave_for_job = self.manager.get(job_slave_hosts)
slave_for_job.put(job) ## sends it to the slave with the shortest queue of the possible slave_hosts
self.logger.debug("Job's started: %s (%i)" % (job['ExportID'], len(self.active))) self.logger.debug("Job's started: %s (%i)" % (job['ExportID'], len(self.active)))
first = True first = True
except Empty: pass except Empty: pass
...@@ -263,8 +265,9 @@ class queueHandler(Process): ...@@ -263,8 +265,9 @@ class queueHandler(Process):
job['destination'] = self.job_groups[job['job_group']].get_destination() job['destination'] = self.job_groups[job['job_group']].get_destination()
sourcehost = job['Location'].split(':')[0] sourcehost = job['Location'].split(':')[0]
self.logger.info("job: %s sourcehost=%s" % (fileName, sourcehost))
if 'cep4' in sourcehost.lower(): if 'cep4' in sourcehost.lower():
job['slave_hosts'] = ['lexar003.lexar.control.lofar', 'lexar004.lexar.control.lofar'] job['slave_hosts'] = ['lexar003.offline.lofar', 'lexar004.offline.lofar']
self.scheduled.put(job) self.scheduled.put(job)
# self.talker.put(job) ## Tell MoM we've done something # self.talker.put(job) ## Tell MoM we've done something
...@@ -376,7 +379,7 @@ class ltaMaster(): ...@@ -376,7 +379,7 @@ class ltaMaster():
result = None result = None
length = sys.maxint length = sys.maxint
for k in self.slaves.keys(): for k in slave_hosts:
size = self.slaves[k].qsize() size = self.slaves[k].qsize()
if length > size: if length > size:
result = self.slaves[k] result = self.slaves[k]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment