Added new migration file to change type of Result.taskids field and cleaned up views.py

This commit is contained in:
dvanaken 2020-02-06 15:08:31 -05:00 committed by Dana Van Aken
parent 4d228f5765
commit 9a5dea806f
2 changed files with 20 additions and 17 deletions

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-02-06 20:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0007_executiontime'),
]
operations = [
migrations.AlterField(
model_name='result',
name='task_ids',
field=models.TextField(null=True),
),
]

View File

@ -643,25 +643,17 @@ def handle_result_files(session, files, execution_times=None):
('map_workload', ()), ('map_workload', ()),
('configuration_recommendation', ()), ('configuration_recommendation', ()),
] ]
#response = chain(aggregate_target_results.s(result.pk, session.algorithm),
# map_workload.s(),
# configuration_recommendation.s()).apply_async()
elif session.algorithm == AlgorithmType.DDPG: elif session.algorithm == AlgorithmType.DDPG:
subtask_list = [ subtask_list = [
('train_ddpg', (result_id,)), ('train_ddpg', (result_id,)),
('configuration_recommendation_ddpg', ()), ('configuration_recommendation_ddpg', ()),
] ]
#response = chain(train_ddpg.s(result.pk),
# configuration_recommendation_ddpg.s()).apply_async()
elif session.algorithm == AlgorithmType.DNN: elif session.algorithm == AlgorithmType.DNN:
subtask_list = [ subtask_list = [
('aggregate_target_results', (result_id, session.algorithm)), ('aggregate_target_results', (result_id, session.algorithm)),
('map_workload', ()), ('map_workload', ()),
('configuration_recommendation', ()), ('configuration_recommendation', ()),
] ]
#response = chain(aggregate_target_results.s(result.pk, session.algorithm),
# map_workload.s(),
# configuration_recommendation.s()).apply_async()
subtasks = [] subtasks = []
for name, args in subtask_list: for name, args in subtask_list:
@ -673,15 +665,6 @@ def handle_result_files(session, files, execution_times=None):
result.task_ids = JSONUtil.dumps(response.as_tuple()) result.task_ids = JSONUtil.dumps(response.as_tuple())
result.save() result.save()
#taskmeta_ids = []
#current_task = response
#while current_task:
# taskmeta_ids.insert(0, current_task.id)
# current_task = current_task.parent
#result.task_ids = ','.join(taskmeta_ids)
#result.save()
if execution_times: if execution_times:
try: try:
batch = [] batch = []