-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from RockefellerArchiveCenter/v0.5
v0.5
- Loading branch information
Showing
43 changed files
with
615 additions
and
167 deletions.
There are no files selected for viewing
Submodule aquarius
updated
18 files
+0 −1 | .gitignore | |
+0 −5 | README.md | |
+ − | aquarius-services.png | |
+2 −0 | aquarius/config.py.example | |
+1 −16 | aquarius/settings.py | |
+5 −12 | aquarius/urls.py | |
+5 −5 | fixtures/cassettes/process_accessions.json | |
+300 −0 | fixtures/cassettes/send_accession_update.json | |
+17 −31 | requirements.txt | |
+82 −137 | transformer/clients.py | |
+18 −0 | transformer/migrations/0005_auto_20190919_2321.py | |
+3 −1 | transformer/models.py | |
+124 −104 | transformer/routines.py | |
+253 −1 | transformer/templates/rest_framework/api.html | |
+0 −282 | transformer/templates/rest_framework/aquarius_base.html | |
+30 −61 | transformer/tests.py | |
+1 −2 | transformer/transformers.py | |
+18 −33 | transformer/views.py |
Submodule fornax
updated
16 files
+6 −6 | .github/ISSUE_TEMPLATE/bug_report.md | |
+4 −4 | .github/ISSUE_TEMPLATE/feature_request.md | |
+0 −5 | README.md | |
+57 −1 | fixtures/cassettes/archivematica.json | |
+2 −0 | fornax/config.py.example | |
+1 −22 | fornax/settings.py | |
+5 −13 | fornax/urls.py | |
+5 −0 | make_dirs.py | |
+12 −27 | requirements.txt | |
+82 −70 | sip_assembly/assemblers.py | |
+16 −21 | sip_assembly/clients.py | |
+27 −35 | sip_assembly/library.py | |
+251 −1 | sip_assembly/templates/rest_framework/api.html | |
+0 −280 | sip_assembly/templates/rest_framework/sip_assembly_base.html | |
+1 −1 | sip_assembly/tests.py | |
+50 −72 | sip_assembly/views.py |
Submodule gemini
updated
14 files
+6 −6 | .github/ISSUE_TEMPLATE/bug_report.md | |
+4 −4 | .github/ISSUE_TEMPLATE/feature_request.md | |
+0 −5 | README.md | |
+2 −0 | gemini/config.py.example | |
+1 −17 | gemini/settings.py | |
+4 −12 | gemini/urls.py | |
+16 −32 | requirements.txt | |
+9 −13 | storer/clients.py | |
+9 −1 | storer/helpers.py | |
+70 −56 | storer/routines.py | |
+251 −1 | storer/templates/rest_framework/api.html | |
+0 −280 | storer/templates/rest_framework/gemini_base.html | |
+4 −2 | storer/tests.py | |
+31 −39 | storer/views.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule ursa_major
updated
13 files
+6 −6 | .github/ISSUE_TEMPLATE/bug_report.md | |
+4 −4 | .github/ISSUE_TEMPLATE/feature_request.md | |
+0 −4 | README.md | |
+0 −0 | bagdiscovery/forms.py | |
+37 −61 | bagdiscovery/library.py | |
+253 −1 | bagdiscovery/templates/rest_framework/api.html | |
+0 −280 | bagdiscovery/templates/rest_framework/bagdiscovery_base.html | |
+2 −2 | bagdiscovery/tests.py | |
+30 −34 | bagdiscovery/views.py | |
+19 −31 | requirements.txt | |
+2 −0 | ursa_major/config.py.example | |
+1 −17 | ursa_major/settings.py | |
+6 −12 | ursa_major/urls.py |
18 changes: 18 additions & 0 deletions
18
zodiac/gateway/migrations/0021_requestlog_task_result_status.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.0.13 on 2019-09-15 15:08 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('gateway', '0020_auto_20190215_2215'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='requestlog', | ||
name='task_result_status', | ||
field=models.CharField(blank=True, choices=[('success', 'Success'), ('error', 'Error'), ('idle', 'Idle')], max_length=100, null=True), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
zodiac/gateway/migrations/0022_application_health_check_path.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.0.13 on 2019-10-20 21:24 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('gateway', '0021_requestlog_task_result_status'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='application', | ||
name='health_check_path', | ||
field=models.CharField(blank=True, max_length=255, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,47 @@ | ||
import json | ||
|
||
from celery.signals import task_prerun, task_postrun | ||
from django_celery_results.models import TaskResult | ||
from .models import ServiceRegistry, RequestLog | ||
|
||
@task_prerun.connect | ||
def on_task_prerun(task_id=None, task=None, *args, **kwargs): | ||
|
||
print("{}[{}] started".format(task, task_id)) | ||
|
||
# Mark service as active | ||
def update_service_status(kwargs, status): | ||
"""Sets `has_active_task` property on Service""" | ||
if 'service_id' in kwargs['kwargs']: | ||
service = ServiceRegistry.objects.get(pk=kwargs['kwargs']['service_id']) | ||
service.has_active_task = True | ||
service.has_active_task = status | ||
service.save() | ||
return service | ||
return None | ||
|
||
@task_postrun.connect | ||
def on_task_postrun(task_id=None, task=None, retval=None, state=None, *args, **kwargs): | ||
|
||
print("{}[{}] finished".format(task, task_id)) | ||
def get_task_result_status(task_result): | ||
"""Returns custom category of task result status""" | ||
task_result_status = 'Error' | ||
if task_result.status == 'SUCCESS': | ||
task_result_status = 'Idle' | ||
if json.loads(task_result.result).get('count', 0) > 0: | ||
task_result_status = 'Success' | ||
return task_result_status | ||
|
||
# Mark service as inactive | ||
def update_service(kwargs): | ||
if 'service_id' in kwargs['kwargs']: | ||
service = ServiceRegistry.objects.get(pk=kwargs['kwargs']['service_id']) | ||
service.has_active_task = False | ||
service.save() | ||
return service | ||
return None | ||
|
||
# Add result to request log | ||
@task_prerun.connect | ||
def on_task_prerun(task_id=None, task=None, *args, **kwargs): | ||
"""Marks service as active""" | ||
update_service_status(kwargs, True) | ||
|
||
|
||
@task_postrun.connect | ||
def on_task_postrun(task_id=None, task=None, retval=None, state=None, *args, **kwargs): | ||
"""Marks service as inactive and saves TaskResult""" | ||
service = update_service_status(kwargs, False) | ||
if len(kwargs['args']) > 1: | ||
task_result = TaskResult.objects.get(task_id=task_id) | ||
request_log = RequestLog.create( | ||
service=update_service(kwargs), | ||
request_log = RequestLog.objects.create( | ||
service=service, | ||
status_code=None, | ||
request_url=kwargs['args'][1], | ||
async_result_id=task_id, | ||
task_result=task_result | ||
task_result=task_result, | ||
task_result_status=get_task_result_status(task_result), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.