decide the node a job will run early

* Deciding the Instance that a Job runs on at celery task run-time makes
it hard to evenly distribute tasks among Instnaces. Instead, the task
manager will look at the world of running jobs and choose an instance
node to run on; applying a deterministic job distribution algo.
This commit is contained in:
chris meyers
2018-05-22 18:09:29 -04:00
parent f394c02afd
commit e720fe5dd0
4 changed files with 70 additions and 16 deletions

View File

@@ -872,10 +872,12 @@ class BaseTask(Task):
'''
Run the job/task and capture its output.
'''
'''
execution_node = settings.CLUSTER_HOST_ID
if isolated_host is not None:
execution_node = isolated_host
instance = self.update_model(pk, status='running', execution_node=execution_node,
'''
instance = self.update_model(pk, status='running',
start_args='') # blank field to remove encrypted passwords
instance.websocket_emit_status("running")