Skip to content

Commit

Permalink
Support new Galaxy configuration setting `interactivetools_map_sqlalc…
Browse files Browse the repository at this point in the history
…hemy`

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.
  • Loading branch information
kysrpex committed Jul 18, 2024
1 parent 29230e8 commit 86a94a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions gravity/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 4 additions & 1 deletion gravity/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("/")
Expand Down

0 comments on commit 86a94a9

Please sign in to comment.