From 54965cd3e00154e913b807c3fc62e034f1e4f596 Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Fri, 17 Mar 2023 15:33:54 -0400 Subject: [PATCH 1/2] Pin a minimum package version of gx-it-proxy. --- docs/installation.rst | 3 +++ gravity/settings.py | 2 ++ gravity/state.py | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index 2a9d3ab..3ed27cd 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -276,6 +276,9 @@ The following options in the ``gravity`` section of ``galaxy.yml`` can be used t # Set to true to start gx-it-proxy # enable: false + # gx-it-proxy version + # version: '>=0.0.5' + # Public-facing IP of the proxy # ip: localhost diff --git a/gravity/settings.py b/gravity/settings.py index 475724f..0cff96b 100644 --- a/gravity/settings.py +++ b/gravity/settings.py @@ -10,6 +10,7 @@ from pydantic import BaseModel, BaseSettings, Extra, Field, validator DEFAULT_INSTANCE_NAME = "_default_" +GX_IT_PROXY_MIN_VERSION = "0.0.5" def none_to_default(cls, v, field): @@ -237,6 +238,7 @@ class ReportsSettings(BaseModel): class GxItProxySettings(BaseModel): enable: bool = Field(default=False, description="Set to true to start gx-it-proxy") + version: str = Field(default=f">={GX_IT_PROXY_MIN_VERSION}", description="gx-it-proxy version") ip: str = Field(default="localhost", description="Public-facing IP of the proxy") port: int = Field(default=4002, description="Public-facing port of the proxy") sessions: str = Field( diff --git a/gravity/state.py b/gravity/state.py index b6c8aa1..78f6161 100644 --- a/gravity/state.py +++ b/gravity/state.py @@ -391,7 +391,7 @@ class GalaxyGxItProxyService(Service): "reverse_proxy": "--reverseProxy", "proxy_path_prefix": "--proxyPathPrefix {settings[proxy_path_prefix]}", } - _command_template = "{virtualenv_bin}npx gx-it-proxy --ip {settings[ip]} --port {settings[port]}" \ + _command_template = "{virtualenv_bin}npx gx-it-proxy@{settings[version]} --ip {settings[ip]} --port {settings[port]}" \ " --sessions {settings[sessions]} {command_arguments[verbose]}" \ " {command_arguments[forward_ip]} {command_arguments[forward_port]}" \ " {command_arguments[reverse_proxy]} {command_arguments[proxy_path_prefix]}" From 4f114f2bb1b9f84dafe6eb280f02c96029e5171c Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Fri, 17 Mar 2023 16:00:21 -0400 Subject: [PATCH 2/2] Fix test for gx-it-proxy version --- tests/test_process_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_process_manager.py b/tests/test_process_manager.py index e615f11..cc350fb 100644 --- a/tests/test_process_manager.py +++ b/tests/test_process_manager.py @@ -7,6 +7,7 @@ import pytest from gravity import process_manager from gravity.process_manager.supervisor import supervisor_program_names +from gravity.settings import GX_IT_PROXY_MIN_VERSION from yaml import safe_load @@ -328,7 +329,7 @@ def test_gxit_handler(default_config_manager, galaxy_yml, gxit_config, process_m gxit_port = gxit_config["gravity"]["gx_it_proxy"]["port"] sessions = "database/interactivetools_map.sqlite" gxit_config_contents = gxit_config_path.read_text() - assert f'npx gx-it-proxy --ip localhost --port {gxit_port} --sessions {sessions}' in gxit_config_contents + assert f'npx gx-it-proxy@>={GX_IT_PROXY_MIN_VERSION} --ip localhost --port {gxit_port} --sessions {sessions}' in gxit_config_contents assert '--proxyPathPrefix /interactivetool/access/interactivetoolentrypoint' in gxit_config_contents