From 0c0edd3763169f0b93fa20348aff0a60820376fd Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Fri, 2 Aug 2024 14:53:20 -0400 Subject: [PATCH 1/9] Deprecate non-working communication pkg funcs. Marking several utility functions (used by some broken places in GUI code) as deprecated, largely because they don't actually work. --- .../dmod/communication/maas_request/utilities.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/lib/communication/dmod/communication/maas_request/utilities.py b/python/lib/communication/dmod/communication/maas_request/utilities.py index dc78924c5..fe1b5f69f 100644 --- a/python/lib/communication/dmod/communication/maas_request/utilities.py +++ b/python/lib/communication/dmod/communication/maas_request/utilities.py @@ -1,6 +1,8 @@ from .model_exec_request import ModelExecRequest, get_available_models +from deprecated import deprecated +@deprecated("Avoid broken util functions not updated for recent message changes") def get_available_outputs() -> set: """ :return: A collection of all valid outputs across any model @@ -13,6 +15,7 @@ def get_available_outputs() -> set: return all_outputs +@deprecated("Avoid broken util functions not updated for recent message changes") def get_distribution_types() -> set: """ :return: The distribution types used across any model @@ -25,6 +28,7 @@ def get_distribution_types() -> set: return all_types +@deprecated("Avoid broken util functions not updated for recent message changes") def get_parameters() -> dict: """ Maps each model to the natural and human readable forms of all of their parameters From 9ed1d8558074726d390140a1e5c0ec2f8f1a3f86 Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Fri, 2 Aug 2024 14:54:02 -0400 Subject: [PATCH 2/9] Bump communication version to 0.21.1. --- python/lib/communication/dmod/communication/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lib/communication/dmod/communication/_version.py b/python/lib/communication/dmod/communication/_version.py index e45337122..8c306aa66 100644 --- a/python/lib/communication/dmod/communication/_version.py +++ b/python/lib/communication/dmod/communication/_version.py @@ -1 +1 @@ -__version__ = '0.21.0' +__version__ = '0.21.1' From 14564a03df45e518200be20501c246cd828cdfe3 Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Fri, 2 Aug 2024 14:59:38 -0400 Subject: [PATCH 3/9] Fix GUI config for django.contrib.staticfiles. Adding required STATIC_ROOT to be main static directory, and removing the addition of this directory in things scanned by the static file finders (i.e., since root, have other found things put here); this was needed to fix issues with static files from main model exec GUI app, which were not being found with previous config. --- python/gui/maas_experiment/application_values.py | 2 ++ python/gui/maas_experiment/settings.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/gui/maas_experiment/application_values.py b/python/gui/maas_experiment/application_values.py index 39f7344a8..297a6ae36 100644 --- a/python/gui/maas_experiment/application_values.py +++ b/python/gui/maas_experiment/application_values.py @@ -173,6 +173,8 @@ def get_full_localtimezone(): BASE_DIRECTORY = Path(__file__).resolve().parent.parent """The path to the base directory of the service""" +STATIC_ROOT = BASE_DIRECTORY / "static" + STATIC_RESOURCE_DIRECTORY = BASE_DIRECTORY / "static" / "resources" APPLICATION_NAME = os.environ.get("APPLICATION_NAME", "Model as a Service") diff --git a/python/gui/maas_experiment/settings.py b/python/gui/maas_experiment/settings.py index 42938835a..589b5e444 100644 --- a/python/gui/maas_experiment/settings.py +++ b/python/gui/maas_experiment/settings.py @@ -134,5 +134,4 @@ STATIC_URL = '/static/' STATICFILES_DIRS = [ - BASE_DIRECTORY / "static" ] From 7b72d01d5c0ab78adcfc854773cd194669e17c37 Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Fri, 2 Aug 2024 15:01:06 -0400 Subject: [PATCH 4/9] Adding required daphne dependency for GUI. Adding daphne to dependencies.txt to install this requirment in GUI image build. --- python/gui/dependencies.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/python/gui/dependencies.txt b/python/gui/dependencies.txt index 82c66ba24..63daec4a2 100644 --- a/python/gui/dependencies.txt +++ b/python/gui/dependencies.txt @@ -18,3 +18,4 @@ channels-redis djangorestframework psycopg2-binary # TODO: get source package in future. Note that psycopg2 cannot be used on Mac; psycopg2-binary must be used numpy +daphne From 94bda9b8b80829d571b8472d7fe9f5e784b3329d Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Fri, 2 Aug 2024 15:03:49 -0400 Subject: [PATCH 5/9] Have base maas GUI template use new CSS standard. Moving base maas config html template to use css/master.css instead of common/css/base.css for consistent presentation. --- python/gui/MaaS/templates/base.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/gui/MaaS/templates/base.html b/python/gui/MaaS/templates/base.html index 2d7d4fc7c..103ca5684 100644 --- a/python/gui/MaaS/templates/base.html +++ b/python/gui/MaaS/templates/base.html @@ -1,12 +1,12 @@ +{% load static %} {{ title|default:"Distributed Model on Demand" }} - {% load static %} - + {% block styles %}{% endblock styles %}