Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 46 additions & 17 deletions planemo/galaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
)
from packaging.version import parse as parse_version

from planemo import git
from planemo import (
git,
network_util,
)
from planemo.config import OptionSource
from planemo.database import postgres_singularity
from planemo.deps import ensure_dependency_resolvers_conf_configured
Expand Down Expand Up @@ -492,24 +495,50 @@ def write_galaxy_config(galaxy_root, properties, env, kwds, template_args, confi
env["GRAVITY_STATE_DIR"] = config_join("gravity")
with NamedTemporaryFile(suffix=".sock", delete=True) as nt:
env["SUPERVISORD_SOCKET"] = nt.name
write_file(
env["GALAXY_CONFIG_FILE"],
json.dumps(
# Enable GxITs by default
gx_it_port = network_util.get_free_port()
properties.update(
dict(
interactivetools_enable="true",
galaxy_infrastructure_url=f"http://localhost:{template_args['port']}",
interactivetools_upstream_proxy="false",
interactivetools_proxy_host=f"localhost:{gx_it_port}",
)
)
gx_it_config = dict(
enable="true",
port=gx_it_port,
)
if kwds.get("disable_gxits", True):
properties.update(
dict(
interactivetools_enable="false",
)
)
gx_it_config.update(
dict(
enable="false",
)
)
config = {
"galaxy": properties,
"gravity": {
"galaxy_root": galaxy_root,
"gunicorn": {
"bind": f"{kwds.get('host', 'localhost')}:{template_args['port']}",
"preload": "false",
},
"gx_it_proxy": gx_it_config,
},
}
if kwds.get("enable_gxits", True):
config["gravity"]["gx_it_proxy"].update(
{
"galaxy": properties,
"gravity": {
"galaxy_root": galaxy_root,
"gunicorn": {
"bind": f"{kwds.get('host', 'localhost')}:{template_args['port']}",
"preload": False,
},
"gx_it_proxy": {
"enable": False,
},
},
"enable": True,
"port": "4002",
}
),
)
)
write_file(env["GALAXY_CONFIG_FILE"], json.dumps(config))


def _expand_paths(galaxy_root: Optional[str], extra_tools: List[str]) -> List[str]:
Expand Down
10 changes: 10 additions & 0 deletions planemo/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,7 @@ def galaxy_serve_options():
install_prebuilt_client_option(),
skip_client_build_option(),
shed_install_option(),
disable_interactive_tools(),
)


Expand Down Expand Up @@ -2261,3 +2262,12 @@ def job_config_init_options():
runner_target_option(),
galaxy_version_option(),
)


def disable_interactive_tools():
return planemo_option(
"--disable_gxits",
is_flag=True,
default=False,
help=("Configure Galaxy to disable interactive tools."),
)
Loading