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

deploy 1 (disabled aggregate functionality)

parent 5c73dc07
No related branches found
No related tags found
No related merge requests found
...@@ -3,12 +3,12 @@ TD { ...@@ -3,12 +3,12 @@ TD {
font-size: 12pt; font-size: 12pt;
} }
.defining,.staging,.fetching,.processing,.storing,.scrub,.scrubbing,.archiving,.discarding,.pre_archiving { .defining,.staging,.fetching,.processing,.storing,.scrub,.scrubbing,.archiving,.aggregating {
font-style: italic; font-style: italic;
color: green; color: green;
} }
.defined,.staged,.fetched,.processed,.stored,.validated,.scrubbed,.archived,.pre_archived,.finished { .defined,.staged,.fetched,.processed,.stored,.validated,.scrubbed,.archived,.finished,.aggregated {
background-color: lemonchiffon; background-color: lemonchiffon;
color: blue; color: blue;
} }
...@@ -32,10 +32,9 @@ TD { ...@@ -32,10 +32,9 @@ TD {
background-color: lightgreen; background-color: lightgreen;
} }
.aggregate_failed { .aggregate_failed,.aggregating_failed {
font-weight: bold;
color: red; color: red;
background-color: lightgreen; font-weight: bold;
} }
...@@ -149,3 +148,8 @@ p.title { ...@@ -149,3 +148,8 @@ p.title {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
.img {
color: white;
font-family: "Courier New";
}
\ No newline at end of file
...@@ -239,7 +239,9 @@ class Task(models.Model): ...@@ -239,7 +239,9 @@ class Task(models.Model):
# if so, temporarily put it on hold so that the ancillary service can grab it with it # if so, temporarily put it on hold so that the ancillary service can grab it with it
if self.is_summary: if self.is_summary:
self.resume = False #TODO: uncomment to enable aggregator
#self.resume = False
pass
except Exception as error: except Exception as error:
# this should never happen # this should never happen
......
...@@ -136,16 +136,24 @@ def update_activity(task): ...@@ -136,16 +136,24 @@ def update_activity(task):
if task.status in processed_statusses: if task.status in processed_statusses:
current_is_processed = activity.is_processed current_is_processed = activity.is_processed
activity.is_processed = True activity.is_processed = True
non_discarded_found = False
for t in Task.objects.filter(sas_id=task.sas_id): for t in Task.objects.filter(sas_id=task.sas_id):
if t.status not in processed_statusses: if t.status not in processed_statusses:
activity.is_processed = False activity.is_processed = False
break break
# at least one of the tasks should NOT be in discarded,
# otherwise a fully discarded SAS_ID will also register as 'is_processed' and ready to 'AGGREGATE'
if t.status != State.DISCARDED.value:
non_discarded_found = True
# only save when changed # only save when changed
if activity.is_processed != current_is_processed: if activity.is_processed != current_is_processed:
# if the whole activity has become processed, then set the status of this activity to 'AGGREGATE' # if the whole activity has become processed, then set the status of this activity to 'AGGREGATE'
if activity.is_processed: if (activity.is_processed & non_discarded_found):
activity.status = State.AGGREGATE.value # TODO: uncomment to enable aggregator
# activity.status = State.AGGREGATE.value
pass
activity.save() activity.save()
......
...@@ -3,12 +3,12 @@ TD { ...@@ -3,12 +3,12 @@ TD {
font-size: 12pt; font-size: 12pt;
} }
.defining,.staging,.fetching,.processing,.storing,.scrub,.scrubbing,.archiving { .defining,.staging,.fetching,.processing,.storing,.scrub,.scrubbing,.archiving,.aggregating {
font-style: italic; font-style: italic;
color: green; color: green;
} }
.defined,.staged,.fetched,.processed,.stored,.validated,.scrubbed,.archived,.finished { .defined,.staged,.fetched,.processed,.stored,.validated,.scrubbed,.archived,.finished,.aggregated {
background-color: lemonchiffon; background-color: lemonchiffon;
color: blue; color: blue;
} }
...@@ -32,10 +32,9 @@ TD { ...@@ -32,10 +32,9 @@ TD {
background-color: lightgreen; background-color: lightgreen;
} }
.aggregate_failed { .aggregate_failed,.aggregating_failed {
font-weight: bold;
color: red; color: red;
background-color: lightgreen; font-weight: bold;
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %} {% include 'taskdatabase/pagination.html' %}
</div> </div>
</div> </div>
<p class="footer"> Version 15 Apr 2024 <p class="footer"> Version 19 Apr 2024 (a)
</div> </div>
{% include 'taskdatabase/refresh.html' %} {% include 'taskdatabase/refresh.html' %}
......
...@@ -32,14 +32,16 @@ class TestProcessedSummary(TestCase): ...@@ -32,14 +32,16 @@ class TestProcessedSummary(TestCase):
actual = self.task1.resume actual = self.task1.resume
self.assertEqual(actual, True) self.assertEqual(actual, True)
def test_processed_on_hold(self): # TODO: uncomment to enable aggregator
""" # def test_processed_on_hold(self):
task 2 is processed, and a summary dataproduct. Should go on hold # """
""" # task 2 is processed, and a summary dataproduct. Should go on hold
# """
#
# actual = self.task2.resume
# # this test fails, because "self.resume = False" is still commented out in models.py L249
# self.assertEqual(actual, False)
actual = self.task2.resume
# this test fails, because "self.resume = False" is still commented out in models.py L249
self.assertEqual(actual, False)
def test_activity_is_processed(self): def test_activity_is_processed(self):
""" """
......
...@@ -51,12 +51,13 @@ class TestSummaryTasks(TestCase): ...@@ -51,12 +51,13 @@ class TestSummaryTasks(TestCase):
self.summary_task_processed_77777.save() self.summary_task_processed_77777.save()
self.assertTrue(self.summary_task_processed_77777.is_summary) self.assertTrue(self.summary_task_processed_77777.is_summary)
def test_summary_task_processed_goes_on_halt(self): # TODO: uncomment to enable aggregator
""" # def test_summary_task_processed_goes_on_hold(self):
test summary task, at 'stored' it should know that it is a summary task and return True) # """
""" # test summary task, at 'stored' it should know that it is a summary task and return True)
self.summary_task_processed_88888.save() # """
self.assertFalse(self.summary_task_processed_88888.resume) # self.summary_task_processed_88888.save()
# self.assertFalse(self.summary_task_processed_88888.resume)
def test_activity_77777_not_is_processed(self): def test_activity_77777_not_is_processed(self):
""" """
......
...@@ -185,16 +185,17 @@ class TestUpdateActivity(TestCase): ...@@ -185,16 +185,17 @@ class TestUpdateActivity(TestCase):
actual = activity.is_processed actual = activity.is_processed
self.assertEqual(actual, False) self.assertEqual(actual, False)
def test_is_processed(self): # TODO: uncomment to enable aggregator
""" # def test_is_processed(self):
task 6, 7 and 8 are processed, # """
activity.is_processed should be true and activity status should go to 'aggregate' # task 6, 7 and 8 are processed,
""" # activity.is_processed should be true and activity status should go to 'aggregate'
# """
activity = self.task6.activity #
# activity = self.task6.activity
actual = activity.is_processed #
self.assertEqual(actual, True) # actual = activity.is_processed
# self.assertEqual(actual, True)
actual = activity.status #
self.assertEqual(actual, State.AGGREGATE.value) # actual = activity.status
\ No newline at end of file # self.assertEqual(actual, State.AGGREGATE.value)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment