-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose components versions in API (#1152)
* update worker get version * WIP - Added debugging points to check endpoints * Add ods + oed version to model versions. * Include migration with additional version fields * Add server components version info * Bug/Fix ktools version * Extract components version logic to model * Remove debug tools from Dockerfile * Update tests for server info --------- Co-authored-by: Sam Gamble <[email protected]>
- Loading branch information
Showing
9 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
src/server/oasisapi/analysis_models/migrations/0010_auto_20241209_1632.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,23 @@ | ||
# Generated by Django 3.2.25 on 2024-12-09 16:32 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('analysis_models', '0009_alter_analysismodel_run_mode'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='analysismodel', | ||
name='ver_ods', | ||
field=models.CharField(default=None, help_text='The worker ods-tools version.', max_length=255, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='analysismodel', | ||
name='ver_oed', | ||
field=models.CharField(default=None, help_text='The worker oed-schema version.', 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,6 +246,8 @@ class Meta: | |
'ver_ktools', | ||
'ver_oasislmf', | ||
'ver_platform', | ||
'ver_ods', | ||
'ver_oed', | ||
) | ||
|
||
|
||
|
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,17 @@ | ||
from ods_tools import __version__ as ods_version | ||
import logging | ||
|
||
|
||
def get_components_version(): | ||
components_versions = { | ||
'ods_version': ods_version | ||
} | ||
|
||
try: | ||
from ods_tools.oed.oed_schema import OedSchema | ||
OedSchemaData = OedSchema.from_oed_schema_info(oed_schema_info=None) | ||
components_versions['oed_version'] = OedSchemaData.schema['version'] | ||
except Exception as _: | ||
logging.exception("Failed to get OED version info") | ||
|
||
return components_versions |
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