diff --git a/atdb/taskdatabase/migrations/0047_activity_storage_location_and_more.py b/atdb/taskdatabase/migrations/0047_activity_storage_location_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..3c4ff74ec36a1eccdc4f98bb6c47fd07c5a668be --- /dev/null +++ b/atdb/taskdatabase/migrations/0047_activity_storage_location_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 5.0 on 2024-07-16 11:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('taskdatabase', '0046_rename_is_combined_activity_is_aggregated_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='activity', + name='storage_location', + field=models.CharField(blank=True, default='unknown', max_length=250, null=True), + ), + migrations.AddField( + model_name='workflow', + name='aggregation_script', + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AddField( + model_name='workflow', + name='aggregation_strategy', + field=models.CharField(choices=[('none', 'none'), ('wait_for_summary_task', 'wait_for_summary_task'), ('collect_h5', 'collect_h5')], default='none', max_length=50), + ), + migrations.AddField( + model_name='workflow', + name='quality_thresholds', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/atdb/taskdatabase/migrations/0048_alter_activity_storage_location.py b/atdb/taskdatabase/migrations/0048_alter_activity_storage_location.py new file mode 100644 index 0000000000000000000000000000000000000000..34ff0dc07e9bda549a7275c2355c562b983cce6a --- /dev/null +++ b/atdb/taskdatabase/migrations/0048_alter_activity_storage_location.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0 on 2024-07-16 11:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('taskdatabase', '0047_activity_storage_location_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='activity', + name='storage_location', + field=models.CharField(blank=True, default=None, max_length=250, null=True), + ), + ] diff --git a/atdb/taskdatabase/models.py b/atdb/taskdatabase/models.py index 779dd8a55407030577b191d9d20f57a503b95bfc..9f94f94f2fc5fbe18878e41c670c025aee85cdd2 100644 --- a/atdb/taskdatabase/models.py +++ b/atdb/taskdatabase/models.py @@ -15,6 +15,11 @@ logger = logging.getLogger(__name__) # constants datetime_format_string = '%Y-%m-%dT%H:%M:%SZ' +AGGREGATION_STRATEGY_CHOICES = ( + ("none", "none"), + ("wait_for_summary_task", "wait_for_summary_task"), + ("collect_h5", "collect_h5"), +) class Workflow(models.Model): description = models.CharField(max_length=500, blank=True, null=True) @@ -28,6 +33,11 @@ class Workflow(models.Model): default_parameters = models.JSONField(null=True, blank=True) prefetch = models.BooleanField(null=True, default=True) + # this is a fixed list of options, because when an option is added it also requires changes in the aggregator service + aggregation_strategy = models.CharField(max_length=50, choices = AGGREGATION_STRATEGY_CHOICES, default="none") + aggregation_script = models.CharField(max_length=100, blank=True, null=True) + quality_thresholds = models.CharField(max_length=50, blank=True, null=True) + def __str__(self): return str(self.id) + ' - ' + str(self.workflow_uri) @@ -120,6 +130,8 @@ class Activity(models.Model): # flag set (and used) by the aggregator service, so that it doesn't do double work is_aggregated = models.BooleanField(default=False) + # storage_location for aggregation files + storage_location = models.CharField(max_length=250, blank=True, null=True, default=None) finished_fraction = models.FloatField(blank=True, null=True) ingested_fraction = models.FloatField(blank=True, null=True) diff --git a/atdb/taskdatabase/templates/taskdatabase/details/workflow_details.html b/atdb/taskdatabase/templates/taskdatabase/details/workflow_details.html index 4fcd58019722c932c007cc18925250b564a81031..96fab931c981063151563d1b45fe5858a69633bd 100644 --- a/atdb/taskdatabase/templates/taskdatabase/details/workflow_details.html +++ b/atdb/taskdatabase/templates/taskdatabase/details/workflow_details.html @@ -14,6 +14,12 @@ <tr><td><b>repository</b></td><td><a href="{{ workflow.repository }}" target="_blank">{{ workflow.repository }} </a></td></tr> <tr><td><b>commit_id</b></td><td>{{ workflow.commit_id }}</td></tr> <tr><td><b>path</b></td><td>{{ workflow.path }}</td></tr> + + {% if workflow.aggregation_strategy != "none" %} + <tr><td><b>aggregration strategy</b></td><td>{{ workflow.aggregation_strategy }}</td></tr> + <tr><td><b>aggregration script</b></td><td>{{ workflow.aggregation_script }}</td></tr> + {% endif %} + <tr><td><b>oi_size_fraction</b></td><td>{{ workflow.oi_size_fraction }}</td></tr> <tr> <td><b>workflows list</b></td><td><a href="{% url 'workflows-api' %}" class="btn btn-secondary btn-sm" role="button" target="_blank">REST API</a></td> diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index c03c9d6cce272bfcba5528372b8bcd778e6bb1b5..e5941648725060db6ee8041b9dd4990a098f0db4 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -31,7 +31,7 @@ {% include 'taskdatabase/pagination.html' %} </div> </div> - <p class="footer"> Version 15 Jul 2024 + <p class="footer"> Version 16 Jul 2024 </div> {% include 'taskdatabase/refresh.html' %}