From 86a94a971a589a0a06a869d8ae801aa4ba16eae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Dom=C3=ADnguez?= Date: Thu, 18 Jul 2024 11:15:50 +0200 Subject: [PATCH] Support new Galaxy configuration setting `interactivetools_map_sqlalchemy` At the moment, the Gravity setting `sessions` is "overridden" with `interactivetools_map` if configured in the Galaxy settings. A new Galaxy setting `interactivetools_map_sqlalchemy` was added in Galaxy PR #18481 that overrides interactivetools_map` if defined. Gravity should do the same. This commit also documents the change. --- docs/installation.rst | 6 +++--- gravity/settings.py | 6 +++--- gravity/state.py | 5 ++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 3ed27cd..073e97e 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -285,9 +285,9 @@ The following options in the ``gravity`` section of ``galaxy.yml`` can be used t # Public-facing port of the proxy # port: 4002 - # Routes file to monitor. - # Should be set to the same path as ``interactivetools_map`` in the ``galaxy:`` section. This is ignored if - # ``interactivetools_map is set``. + # Database to monitor. + # Should be set to the same value as ``interactivetools_map`` (or ``interactivetools_map_sqlalchemy``) in the ``galaxy:`` section. This is + # ignored if either ``interactivetools_map`` or ``interactivetools_map_sqlalchemy`` are set. # sessions: database/interactivetools_map.sqlite # Include verbose messages in gx-it-proxy diff --git a/gravity/settings.py b/gravity/settings.py index 0cff96b..ea7ec9a 100644 --- a/gravity/settings.py +++ b/gravity/settings.py @@ -244,9 +244,9 @@ class GxItProxySettings(BaseModel): sessions: str = Field( default="database/interactivetools_map.sqlite", description=""" -Routes file to monitor. -Should be set to the same path as ``interactivetools_map`` in the ``galaxy:`` section. This is ignored if -``interactivetools_map is set``. +Database to monitor. +Should be set to the same value as ``interactivetools_map`` (or ``interactivetools_map_sqlalchemy``) in the ``galaxy:`` section. This is +ignored if either ``interactivetools_map`` or ``interactivetools_map_sqlalchemy`` are set. """) verbose: bool = Field(default=True, description="Include verbose messages in gx-it-proxy") forward_ip: Optional[str] = Field( diff --git a/gravity/state.py b/gravity/state.py index 78f6161..86e3614 100644 --- a/gravity/state.py +++ b/gravity/state.py @@ -399,7 +399,10 @@ class GalaxyGxItProxyService(Service): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # override from Galaxy config if set - self.settings["sessions"] = self.config.app_config.get("interactivetools_map", self.settings["sessions"]) + self.settings["sessions"] = ( + self.config.app_config.get("interactivetools_map_sqlalchemy") or + self.config.app_config.get("interactivetools_map", self.settings["sessions"]) + ) # this can only be set in Galaxy config it_base_path = self.config.app_config.get("interactivetools_base_path", "/") it_base_path = "/" + f"/{it_base_path.strip('/')}/".lstrip("/")