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

change status names

parent 10855cf5
No related branches found
No related tags found
1 merge request!402Mam 88 change status names
Pipeline #117465 failed
Showing
with 36 additions and 36 deletions
atdb/atdb/static/taskdatabase/ATDB-LDV Workflow Diagram.png

766 KiB | W: | H:

atdb/atdb/static/taskdatabase/ATDB-LDV Workflow Diagram.png

766 KiB | W: | H:

atdb/atdb/static/taskdatabase/ATDB-LDV Workflow Diagram.png
atdb/atdb/static/taskdatabase/ATDB-LDV Workflow Diagram.png
atdb/atdb/static/taskdatabase/ATDB-LDV Workflow Diagram.png
atdb/atdb/static/taskdatabase/ATDB-LDV Workflow Diagram.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,12 +3,12 @@ TD { ...@@ -3,12 +3,12 @@ TD {
font-size: 12pt; font-size: 12pt;
} }
.defining,.staging,.fetching,.processing,.storing,.scrub,.scrubbing,.archiving,.aggregating,.get_inputs,.getting_inputs { .staging,.fetching,.processing,.storing,.scrub,.scrubbing,.archiving,.aggregating,.get_inputs,.getting_inputs {
font-style: italic; font-style: italic;
color: green; color: green;
} }
.defined,.staged,.fetched,.processed,.stored,.validated,.scrubbed,.archived,.finished,.aggregate,.aggregated,.populated,.claimed { .defined,.staged,.fetched,.processed,.stored,.validated,.scrubbed,.archived,.finished,.aggregate,.aggregated,.expanded,.defining {
background-color: lemonchiffon; background-color: lemonchiffon;
color: blue; color: blue;
} }
......
atdb/docs/ATDB-LDV Workflow Diagram.png

809 KiB | W: | H:

atdb/docs/ATDB-LDV Workflow Diagram.png

766 KiB | W: | H:

atdb/docs/ATDB-LDV Workflow Diagram.png
atdb/docs/ATDB-LDV Workflow Diagram.png
atdb/docs/ATDB-LDV Workflow Diagram.png
atdb/docs/ATDB-LDV Workflow Diagram.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -51,7 +51,7 @@ class Specification(models.Model): ...@@ -51,7 +51,7 @@ class Specification(models.Model):
inputs = models.JSONField(null=True, blank=True) inputs = models.JSONField(null=True, blank=True)
# the status of this specification # the status of this specification
status = models.CharField(db_index=True, default="claim", max_length=50) status = models.CharField(db_index=True, default="define", max_length=50)
# feedback to whatever/whoever calls the REST API # feedback to whatever/whoever calls the REST API
message = models.CharField(default=None, max_length=200, blank=True, null=True) message = models.CharField(default=None, max_length=200, blank=True, null=True)
......
...@@ -187,7 +187,7 @@ class Task(models.Model): ...@@ -187,7 +187,7 @@ class Task(models.Model):
logger.error(error) logger.error(error)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
logger.info(f"task.save({self}),{args},{kwargs}") logger.info(f"task.save({self})")
# make sure that every task has an activity (also for backward compatibility) # make sure that every task has an activity (also for backward compatibility)
associate_task_with_activity(self) associate_task_with_activity(self)
......
...@@ -35,13 +35,13 @@ class State(Enum): ...@@ -35,13 +35,13 @@ class State(Enum):
IDLE = "idle" IDLE = "idle"
class SpecificationStatus(Enum): class SpecificationStatus(Enum):
CLAIM = "claim" DEFINE = "define"
CLAIMED = "claimed" DEFINING = "defining"
POPULATE = "populate" EXPAND = "expand"
POPULATING = "populating" EXPANDING = "expanding"
POPULATED = "populated" EXPANDED = "expanded"
UNPOPULATE = "unpopulate" COLLAPSE = "collapse"
UPDATE = "update" UPDATE = "update"
DISCARD = "discard" DISCARD = "discard"
ERROR = "error" ERROR = "error"
......
...@@ -82,7 +82,7 @@ def handle_post_save(sender, **kwargs): ...@@ -82,7 +82,7 @@ def handle_post_save(sender, **kwargs):
:param (in) kwargs: The instance of the object that sends the trigger. :param (in) kwargs: The instance of the object that sends the trigger.
""" """
task = kwargs.get('instance') task = kwargs.get('instance')
logger.info("SIGNAL : handle_post_save Task(" + str(kwargs.get('instance')) + ")") #logger.info("SIGNAL : handle_post_save Task(" + str(kwargs.get('instance')) + ")")
#logger.info(''.join(traceback.format_stack())) #logger.info(''.join(traceback.format_stack()))
update_activity_from_task(task) update_activity_from_task(task)
......
...@@ -134,7 +134,7 @@ def create_payload(batch, specification, predecessor_task=None): ...@@ -134,7 +134,7 @@ def create_payload(batch, specification, predecessor_task=None):
return payload return payload
def populate_tasks(specification): def expand(specification):
""" """
instantiate tasks from this specification instantiate tasks from this specification
this is triggered when the specification.status is set to 'populate' this is triggered when the specification.status is set to 'populate'
...@@ -142,7 +142,7 @@ def populate_tasks(specification): ...@@ -142,7 +142,7 @@ def populate_tasks(specification):
from taskdatabase.models import Task # preventing circular imports from taskdatabase.models import Task # preventing circular imports
logger.info(f'populate_tasks {specification.id}') logger.info(f'expand {specification.id}')
try: try:
surls = specification.inputs["surls"] surls = specification.inputs["surls"]
...@@ -151,7 +151,7 @@ def populate_tasks(specification): ...@@ -151,7 +151,7 @@ def populate_tasks(specification):
predecessor_task = get_predecessor_task(specification) predecessor_task = get_predecessor_task(specification)
if not "error" in specification.status: if not "error" in specification.status:
specification.status = "populating" specification.status = "expanding"
specification.save() specification.save()
for batch in batches: for batch in batches:
...@@ -165,7 +165,7 @@ def populate_tasks(specification): ...@@ -165,7 +165,7 @@ def populate_tasks(specification):
task.save() task.save()
specification.nr_of_tasks = nr_of_tasks specification.nr_of_tasks = nr_of_tasks
specification.status = "populated" specification.status = "expanded"
except Exception as error: except Exception as error:
specification.status = "error" specification.status = "error"
...@@ -174,10 +174,10 @@ def populate_tasks(specification): ...@@ -174,10 +174,10 @@ def populate_tasks(specification):
specification.save() specification.save()
def unpopulate_tasks(specification): def collapse(specification):
""" """
tasks that were created for this specification are removed. tasks that were created for this specification are removed.
the specification is reverted to the 'claimed' status. the specification is reverted to the 'defining' status.
""" """
from taskdatabase.models import Task # preventing circular imports from taskdatabase.models import Task # preventing circular imports
...@@ -186,5 +186,5 @@ def unpopulate_tasks(specification): ...@@ -186,5 +186,5 @@ def unpopulate_tasks(specification):
specification.nr_of_tasks = 0 specification.nr_of_tasks = 0
specification.message = None specification.message = None
specification.status = "claimed" specification.status = "defining"
specification.save() specification.save()
...@@ -3,7 +3,7 @@ import logging ...@@ -3,7 +3,7 @@ import logging
from django.contrib.auth.models import User from django.contrib.auth.models import User
from .populate_tasks import * from .expand import *
from .input_validation import * from .input_validation import *
from .meta_specification import * from .meta_specification import *
from ..common import SpecificationStatus, INACTIVE_STATUSSES from ..common import SpecificationStatus, INACTIVE_STATUSSES
...@@ -17,7 +17,7 @@ def validate_specification(specification): ...@@ -17,7 +17,7 @@ def validate_specification(specification):
... otherwise to ERROR with a message ... otherwise to ERROR with a message
""" """
logger.info(f'validate_specification {specification.id}') logger.info(f'validate_specification {specification.id}')
specification.status = SpecificationStatus.CLAIMED.value specification.status = SpecificationStatus.DEFINING.value
# fill in validation logic here... # fill in validation logic here...
...@@ -61,7 +61,7 @@ def update_specification(specification): ...@@ -61,7 +61,7 @@ def update_specification(specification):
status = specification.status status = specification.status
# perform some input validation on a newly created specification # perform some input validation on a newly created specification
if status == SpecificationStatus.CLAIM.value: if status == SpecificationStatus.DEFINE.value:
valid = validate_specification(specification) valid = validate_specification(specification)
if not valid: if not valid:
specification.status = SpecificationStatus.ERROR.value specification.status = SpecificationStatus.ERROR.value
...@@ -71,12 +71,12 @@ def update_specification(specification): ...@@ -71,12 +71,12 @@ def update_specification(specification):
handle_meta_specification(specification) handle_meta_specification(specification)
# populate, create all the tasks from this specification # populate, create all the tasks from this specification
elif status == SpecificationStatus.POPULATE.value: elif status == SpecificationStatus.EXPAND.value:
populate_tasks(specification) expand(specification)
# undefine, remove all the tasks, and set the specification back to 'claimed' # undefine, remove all the tasks, and set the specification back to 'claimed'
elif status == SpecificationStatus.UNPOPULATE.value: elif status == SpecificationStatus.COLLAPSE.value:
unpopulate_tasks(specification) collapse(specification)
# update all the populated tasks with the changed settings of the specification # update all the populated tasks with the changed settings of the specification
# (should this also reorganize the batches? so deleting and adding tasks?) # (should this also reorganize the batches? so deleting and adding tasks?)
......
atdb/taskdatabase/static/taskdatabase/ATDB-LDV Workflow Diagram.png

766 KiB | W: | H:

atdb/taskdatabase/static/taskdatabase/ATDB-LDV Workflow Diagram.png

766 KiB | W: | H:

atdb/taskdatabase/static/taskdatabase/ATDB-LDV Workflow Diagram.png
atdb/taskdatabase/static/taskdatabase/ATDB-LDV Workflow Diagram.png
atdb/taskdatabase/static/taskdatabase/ATDB-LDV Workflow Diagram.png
atdb/taskdatabase/static/taskdatabase/ATDB-LDV Workflow Diagram.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,12 +3,12 @@ TD { ...@@ -3,12 +3,12 @@ TD {
font-size: 12pt; font-size: 12pt;
} }
.defining,.staging,.fetching,.processing,.storing,.scrub,.scrubbing,.archiving,.aggregating,.get_inputs,.getting_inputs { .staging,.fetching,.processing,.storing,.scrub,.scrubbing,.archiving,.aggregating,.get_inputs,.getting_inputs {
font-style: italic; font-style: italic;
color: green; color: green;
} }
.defined,.staged,.fetched,.processed,.stored,.validated,.scrubbed,.archived,.finished,.aggregate,.aggregated,.populated,.claimed { .defined,.staged,.fetched,.processed,.stored,.validated,.scrubbed,.archived,.finished,.aggregate,.aggregated,.expanded,.defining {
background-color: lemonchiffon; background-color: lemonchiffon;
color: blue; color: blue;
} }
......
{% if specification.status == "claimed" %} {% if specification.status == "defining" %}
<a href="{% url 'edit_specification' specification.pk my_specifications.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-pen-alt"></i> Edit</a>&nbsp; <a href="{% url 'edit_specification' specification.pk my_specifications.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-pen-alt"></i> Edit</a>&nbsp;
{% if not specification.inputs %} {% if not specification.inputs %}
...@@ -7,24 +7,24 @@ ...@@ -7,24 +7,24 @@
{% else %} {% else %}
<a href="{% url 'specification-set-status-button' specification.pk 'get_inputs' my_specifications.number %}" class="btn btn-danger btn-sm" role="button"><i class="fas fa-arrow-right-to-bracket"></i> LTA Inputs</a> <a href="{% url 'specification-set-status-button' specification.pk 'get_inputs' my_specifications.number %}" class="btn btn-danger btn-sm" role="button"><i class="fas fa-arrow-right-to-bracket"></i> LTA Inputs</a>
{% endif %} {% endif %}
<a href="{% url 'specification-set-status-button' specification.pk 'populate' my_specifications.number %}" class="btn btn-success btn-sm" role="button"><i class="fas fa-up-down-left-right"></i> Populate</a> <a href="{% url 'specification-set-status-button' specification.pk 'expand' my_specifications.number %}" class="btn btn-success btn-sm" role="button"><i class="fas fa-up-down-left-right"></i> Create Tasks</a>
{% endif %} {% endif %}
{% if specification.status == "populated" %} {% if specification.status == "expanded" %}
<a href="{% url 'specification-set-tasks-status-button' specification.pk 'defined' my_specifications.number %}" class="btn btn-success btn-sm" role="button"><i class="fas fa-person-running"></i> Run Tasks</a> <a href="{% url 'specification-set-tasks-status-button' specification.pk 'defined' my_specifications.number %}" class="btn btn-success btn-sm" role="button"><i class="fas fa-person-running"></i> Run Tasks</a>
<a href="{% url 'specification-set-status-button' specification.pk 'unpopulate' my_specifications.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-arrows-to-dot"></i> Unpopulate</a> <a href="{% url 'specification-set-status-button' specification.pk 'unpopulate' my_specifications.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-arrows-to-dot"></i> Remove Tasks</a>
{% endif %} {% endif %}
{% if specification.status == "error" %} {% if specification.status == "error" %}
<a href="{% url 'specification-set-status-button' specification.pk 'unpopulate' my_specifications.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> Unpopulate</a> <a href="{% url 'specification-set-status-button' specification.pk 'unpopulate' my_specifications.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> Remove Tasks</a>
{% endif %} {% endif %}
{% if specification.status == "get_inputs" or specification.status == "getting_inputs" %} {% if specification.status == "get_inputs" or specification.status == "getting_inputs" %}
<a href="{% url 'specification-set-status-button' specification.pk 'claimed' my_specifications.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> Claimed</a> <a href="{% url 'specification-set-status-button' specification.pk 'defining' my_specifications.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> Defining</a>
{% endif %} {% endif %}
{% if specification.status == "active" %} {% if specification.status == "active" %}
<a href="{% url 'specification-set-status-button' specification.pk 'unpopulate' my_specifications.number %}" class="btn btn-danger btn-sm" role="button"><i class="fas fa-arrows-to-dot"></i> Unpopulate</a> <a href="{% url 'specification-set-status-button' specification.pk 'collapse' my_specifications.number %}" class="btn btn-danger btn-sm" role="button"><i class="fas fa-arrows-to-dot"></i> Remove Tasks</a>
{% endif %} {% endif %}
...@@ -171,9 +171,9 @@ urlpatterns = [ ...@@ -171,9 +171,9 @@ urlpatterns = [
path('tasks/<int:pk>/hold/<hold_it>/<page>', views.Hold, name='task-hold-resume'), path('tasks/<int:pk>/hold/<hold_it>/<page>', views.Hold, name='task-hold-resume'),
path('tasks/<int:pk>/hold/<hold_it>', views.Hold, name='task-hold-resume'), path('tasks/<int:pk>/hold/<hold_it>', views.Hold, name='task-hold-resume'),
path('tasks/<int:pk>/query_hold/<hold_it>/<query_params>', views.HoldQuery, name='query-hold-resume'), path('tasks/<int:pk>/query-hold/<hold_it>/<query_params>', views.HoldQuery, name='query-hold-resume'),
path('tasks/<int:pk>/hold/<hold_it>/<page>', views.Hold, name='service-hold-resume'), path('tasks/<int:pk>/hold/<hold_it>/<page>', views.Hold, name='service-hold-resume'),
path('tasks/<int:pk>/query_purge/<purge_policy>/<query_params>', views.PurgeQuery, name='query-purge'), path('tasks/<int:pk>/query-purge/<purge_policy>/<query_params>', views.PurgeQuery, name='query-purge'),
# some migration and repair endpoints - but switched of some scary/expensive ones to avoid accidental use # some migration and repair endpoints - but switched of some scary/expensive ones to avoid accidental use
#path('tasks/repair/associate-activities/', views.associate_activities, name='associate-activities'), #path('tasks/repair/associate-activities/', views.associate_activities, name='associate-activities'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment