Skip to content
Snippets Groups Projects
Commit 6d4f1df2 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

database changes

- skip -> resume
- added task.metrics
parent 03fc2ac5
No related branches found
No related tags found
No related merge requests found
Pipeline #8558 passed
# Generated by Django 3.1.4 on 2021-01-28 10:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('taskdatabase', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='task',
name='skip',
),
migrations.AddField(
model_name='task',
name='metrics',
field=models.JSONField(blank=True, null=True),
),
migrations.AddField(
model_name='task',
name='resume',
field=models.BooleanField(default=True),
),
migrations.AlterField(
model_name='task',
name='stage_request_id',
field=models.IntegerField(null=True),
),
]
......@@ -27,18 +27,19 @@ class Task(models.Model):
new_workflow_id = models.CharField(max_length=15, blank=True, null=True)
new_workflow_uri = models.CharField(max_length=100, blank=True, null=True)
skip = models.BooleanField(default=False)
resume = models.BooleanField(default=True)
creationTime = models.DateTimeField(default=datetime.utcnow, blank=True)
priority = models.IntegerField(null=True)
purge_policy = models.CharField(max_length=5, default="no", blank=True, null=True)
stage_request_id = models.IntegerField(default=0,null=True)
stage_request_id = models.IntegerField(null=True)
# LOFAR properties
project = models.CharField(max_length=100, blank=True, null=True, default="unknown")
sas_id = models.CharField(max_length=15, blank=True, null=True)
inputs = models.JSONField(null=True, blank=True)
outputs = models.JSONField(null=True, blank=True)
metrics = models.JSONField(null=True, blank=True)
# relationships
workflow = models.ForeignKey(Workflow, related_name='tasks', on_delete=models.SET_NULL, null=True, blank=True)
......
......@@ -44,11 +44,11 @@ class TaskSerializer(serializers.ModelSerializer):
class Meta:
model = Task
fields = ('id','task_type','taskID','filter','predecessor','successors',
'project','sas_id','priority','purge_policy','skip',
'project','sas_id','priority','purge_policy','resume',
'new_workflow_id','new_workflow_uri','workflow',
'stage_request_id',
'status','new_status',
'inputs','outputs','status_history',
'inputs','outputs','metrics','status_history',
'log_entries'
)
......
......@@ -44,7 +44,7 @@
</div>
{% include 'taskdatabase/pagination.html' %}
</div>
<p class="footer"> Version 1.0.0 (26 jan 2021 - 10:00)
<p class="footer"> Version 1.0.0 (28 jan 2021 - 11:00)
<script type="text/javascript">
(function(seconds) {
var refresh,
......
......@@ -189,6 +189,13 @@ class LogEntryDetailsViewAPI(generics.RetrieveUpdateDestroyAPIView):
queryset = LogEntry.objects.all()
serializer_class = LogEntrySerializer
# overriding the update, because the status that comes in with the LogEntry
# also needs to propagate to the task.new_status
def perform_update(self, serializer):
log_entry = serializer.save()
task = log_entry.task
task.new_status = log_entry.status
task.save()
# --- controller resources, triggered by a button in the GUI or directoy with a URL ---
# set task status to 'new_status' - called from the GUI
......
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