Skip to content

Commit

Permalink
Rename interactivetools_map_sqlalchemy to interactivetoolsproxy_map
Browse files Browse the repository at this point in the history
  • Loading branch information
kysrpex committed Sep 3, 2024
1 parent 0b6ad17 commit 9ee6636
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 31 deletions.
10 changes: 5 additions & 5 deletions doc/source/admin/galaxy_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2115,17 +2115,17 @@
Map for the interactivetool proxy. Mappings are stored in a SQLite
database file located on this path. As an alternative, you may
also store them in any other RDBMS supported by SQLAlchemy using
the option ``interactivetools_map_sqlalchemy``, which overrides
this one.
the option ``interactivetoolsproxy_map``, which overrides this
one.
The value of this option will be resolved with respect to
<data_dir>.
:Default: ``interactivetools_map.sqlite``
:Type: str


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``interactivetools_map_sqlalchemy``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``interactivetoolsproxy_map``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Description:
Use a database supported by SQLAlchemy as map for the
Expand Down
8 changes: 4 additions & 4 deletions doc/source/admin/special_topics/interactivetools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ the URL and headers, then somewhat massaged, and finally forwarded to the correc
SQLite may not be the best choice. A common case is a high-availability production setup, meaning that multiple
copies of Galaxy are running on different servers behind a load balancer.

For these situations, there exists an optional |configuration option interactivetools_map_sqlalchemy|_ that allows
using any database supported by SQLAlchemy (it overrides ``interactivetools_map``).
For these situations, there exists an optional |configuration option interactivetoolsproxy_map|_ that allows using
any database supported by SQLAlchemy (it overrides ``interactivetools_map``).

.. |configuration option interactivetools_map_sqlalchemy| replace:: configuration option ``interactivetools_map_sqlalchemy``
.. _configuration option interactivetools_map_sqlalchemy: ../config.html#interactivetools-map-sqlalchemy
.. |configuration option interactivetoolsproxy_map| replace:: configuration option ``interactivetoolsproxy_map``
.. _configuration option interactivetoolsproxy_map: ../config.html#interactivetoolsproxy-map

.. note::

Expand Down
16 changes: 8 additions & 8 deletions lib/galaxy/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,19 +1104,19 @@ def _process_config(self, kwargs: Dict[str, Any]) -> None:
self.proxy_session_map = self.dynamic_proxy_session_map
self.manage_dynamic_proxy = self.dynamic_proxy_manage # Set to false if being launched externally

# InteractiveTools propagator mapping
if self.interactivetools_map_sqlalchemy is None:
# Interactive tools proxy mapping
if self.interactivetoolsproxy_map is None:
self.interactivetools_map = "sqlite:///" + self._in_root_dir(
kwargs.get("interactivetools_map", self._in_data_dir("interactivetools_map.sqlite"))
)
else:
self.interactivetools_map = None # overridden by `self.interactivetools_map_sqlalchemy`
self.interactivetools_map = None # overridden by `self.interactivetoolsproxy_map`

# ensure the database URL for the SQLAlchemy map does not match that of a Galaxy DB
urls = {
setting: parse_sqlalchemy_url(value)
for setting, value in (
("interactivetools_map_sqlalchemy", self.interactivetools_map_sqlalchemy),
("interactivetoolsproxy_map", self.interactivetoolsproxy_map),
("database_connection", self.database_connection),
("install_database_connection", self.install_database_connection),
)
Expand All @@ -1128,8 +1128,8 @@ def is_in_conflict(url1, url2):

conflicting_settings = {
setting
for setting, url in tuple(urls.items())[1:] # exclude "interactivetools_map_sqlalchemy"
if is_in_conflict(url, list(urls.values())[0]) # compare with "interactivetools_map_sqlalchemy"
for setting, url in tuple(urls.items())[1:] # exclude "interactivetoolsproxy_map"
if is_in_conflict(url, list(urls.values())[0]) # compare with "interactivetoolsproxy_map"
}

if conflicting_settings:
Expand Down Expand Up @@ -1257,8 +1257,8 @@ def try_parsing(value, name):

try_parsing(self.database_connection, "database_connection")
try_parsing(self.install_database_connection, "install_database_connection")
if self.interactivetools_map_sqlalchemy is not None:
try_parsing(self.interactivetools_map_sqlalchemy, "interactivetools_map_sqlalchemy")
if self.interactivetoolsproxy_map is not None:
try_parsing(self.interactivetoolsproxy_map, "interactivetoolsproxy_map")
try_parsing(self.amqp_internal_connection, "amqp_internal_connection")

def _configure_dataset_storage(self):
Expand Down
5 changes: 2 additions & 3 deletions lib/galaxy/config/sample/galaxy.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,7 @@ galaxy:
# Map for the interactivetool proxy. Mappings are stored in a SQLite
# database file located on this path. As an alternative, you may also
# store them in any other RDBMS supported by SQLAlchemy using the
# option ``interactivetools_map_sqlalchemy``, which overrides this
# one.
# option ``interactivetoolsproxy_map``, which overrides this one.
# The value of this option will be resolved with respect to
# <data_dir>.
#interactivetools_map: interactivetools_map.sqlite
Expand All @@ -1365,7 +1364,7 @@ galaxy:
# Mappings are written to the table "gxitproxy" within the database.
# This value cannot match ``database_connection`` nor
# ``install_database_connection``.
#interactivetools_map_sqlalchemy: null
#interactivetoolsproxy_map: null

# Prefix to use in the formation of the subdomain or path for
# interactive tools
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/config/schemas/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1522,10 +1522,10 @@ mapping:
desc: |
Map for the interactivetool proxy. Mappings are stored in a SQLite database file
located on this path. As an alternative, you may also store them in any other RDBMS
supported by SQLAlchemy using the option ``interactivetools_map_sqlalchemy``, which
supported by SQLAlchemy using the option ``interactivetoolsproxy_map``, which
overrides this one.
interactivetools_map_sqlalchemy:
interactivetoolsproxy_map:
type: str
required: false
desc: |
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/managers/interactivetool.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __init__(self, app):
self.job_manager = app.job_manager
self.encoder = IdAsLowercaseAlphanumEncodingHelper(app.security)
self.propagator = InteractiveToolPropagatorSQLAlchemy(
app.config.interactivetools_map_sqlalchemy or app.config.interactivetools_map,
app.config.interactivetoolsproxy_map or app.config.interactivetools_map,
self.encoder.encode_id,
)

Expand Down
16 changes: 8 additions & 8 deletions test/unit/config/test_config_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def test_error_if_database_connection_contains_brackets(bracket):
config.GalaxyAppConfiguration(override_tempdir=False, amqp_internal_connection=uri)


def test_error_if_interactivetools_map_sqlalchemy_matches_other_database_connections():
def test_error_if_interactivetoolsproxy_map_matches_other_database_connections():
"""
The setting `interactivetools_map_sqlalchemy` allows storing the session map in a
The setting `interactivetoolsproxy_map` allows storing the session map in a
database supported by SQLAlchemy. This database must be different from the Galaxy database
and the tool shed database.
Expand All @@ -85,23 +85,23 @@ def test_error_if_interactivetools_map_sqlalchemy_matches_other_database_connect
)

with pytest.raises(ConfigurationError):
# interactivetools_map_sqlalchemy matches database_connection
# interactivetoolsproxy_map matches database_connection
config.GalaxyAppConfiguration(
**settings,
interactivetools_map_sqlalchemy=database_connection,
interactivetoolsproxy_map=database_connection,
)

with pytest.raises(ConfigurationError):
# interactivetools_map_sqlalchemy matches install_database_connection
# interactivetoolsproxy_map matches install_database_connection
config.GalaxyAppConfiguration(
**settings,
interactivetools_map_sqlalchemy=install_database_connection,
interactivetoolsproxy_map=install_database_connection,
)

# interactivetools_map_sqlalchemy differs from database_connection, install_database_connection
# interactivetoolsproxy_map differs from database_connection, install_database_connection
config.GalaxyAppConfiguration(
**settings,
interactivetools_map_sqlalchemy="dbscheme://user:password@host/gxitproxy",
interactivetoolsproxy_map="dbscheme://user:password@host/gxitproxy",
)


Expand Down

0 comments on commit 9ee6636

Please sign in to comment.