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
60 changes: 44 additions & 16 deletions planemo/galaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from packaging.version import parse as parse_version

from planemo import git
from planemo import 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 @@ -426,6 +427,7 @@ def config_join(*args):
if kwds.get("mulled_containers", False):
properties["mulled_channels"] = kwds.get("conda_ensure_channels", "")


_handle_kwd_overrides(properties, kwds)

# TODO: consider following property
Expand Down Expand Up @@ -488,23 +490,49 @@ 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
# 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({
"enable": True,
"port": "4002",
})
write_file(
env["GALAXY_CONFIG_FILE"],
json.dumps(
{
"galaxy": properties,
"gravity": {
"galaxy_root": galaxy_root,
"gunicorn": {
"bind": f"{kwds.get('host', 'localhost')}:{template_args['port']}",
"preload": False,
},
"gx_it_proxy": {
"enable": False,
},
},
}
),
env["GALAXY_CONFIG_FILE"], json.dumps(config)
)


Expand Down
12 changes: 12 additions & 0 deletions planemo/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,7 @@ def galaxy_serve_options():
install_prebuilt_client_option(),
skip_client_build_option(),
shed_install_option(),
disable_interactive_tools(),
)


Expand Down Expand Up @@ -2257,3 +2258,14 @@ 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