Add build job to statuses monitor
@@ -65,7 +65,9 @@ def run(k8s_manager):
job_state = get_job_state(
event_type=event['type'],
event=event_object,
- job_container_names=(settings.CONTAINER_NAME_JOB, settings.CONTAINER_NAME_PLUGIN_JOB),
+ job_container_names=(settings.CONTAINER_NAME_JOB,
+ settings.CONTAINER_NAME_PLUGIN_JOB,
+ settings.CONTAINER_NAME_DOCKERIZER_JOB),
experiment_type_label=settings.TYPE_LABELS_EXPERIMENT)
if job_state:
@@ -78,14 +80,31 @@ def run(k8s_manager):
job_state = job_state.to_dict()
logger.debug(job_state)
# Only update job containers if it's an experiment job not plugins
- if settings.CONTAINER_NAME_JOB in job_state['details']['container_statuses']:
+ experiment_job_condition = (
+ settings.CONTAINER_NAME_JOB in job_state['details']['container_statuses']
+ )
+
+ plugin_job_condition = (
+ settings.CONTAINER_NAME_PLUGIN_JOB in job_state['details']['container_statuses']
+ )
+
+ dockerizer_job_condition = (
+ settings.CONTAINER_NAME_DOCKERIZER_JOB in job_state['details']['container_statuses']
+ )
+
+ if experiment_job_condition:
update_job_containers(event_object, status, settings.CONTAINER_NAME_JOB)
# Handle experiment job statuses differently than plugin job statuses
celery_app.send_task(
- EventsCeleryTasks.EVENTS_HANDLE_JOB_STATUSES,
+ EventsCeleryTasks.EVENTS_HANDLE_EXPERIMENT_JOB_STATUSES,
kwargs={'payload': job_state})
- elif settings.CONTAINER_NAME_PLUGIN_JOB in job_state['details']['container_statuses']:
+ elif plugin_job_condition:
# Handle plugin job statuses
celery_app.send_task(
EventsCeleryTasks.EVENTS_HANDLE_PLUGIN_JOB_STATUSES,
kwargs={'payload': job_state})
+ elif dockerizer_job_condition:
+ # Handle dockerizer job statuses
+ celery_app.send_task(
+ EventsCeleryTasks.EVENTS_HANDLE_DOCKERIZER_JOB_STATUSES,
+ kwargs={'payload': job_state})
