Skip to content

Commit

Permalink
Merge pull request #102 from natefoo/pin-gxit-proxy
Browse files Browse the repository at this point in the history
Pin a minimum package version of gx-it-proxy
  • Loading branch information
mvdbeek authored Mar 28, 2023
2 parents d547656 + 4f114f2 commit f281933
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions gravity/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion gravity/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}"
Expand Down
3 changes: 2 additions & 1 deletion tests/test_process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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


Expand Down

0 comments on commit f281933

Please sign in to comment.