Skip to content

Commit 3def72c

Browse files
committed
Add tool request config option, set default to true
1 parent afe1ce5 commit 3def72c

5 files changed

Lines changed: 34 additions & 2 deletions

File tree

client/src/components/Tool/submit/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import { submitToolJob as submitLegacy } from "./submitLegacy";
77

88
export async function submitToolJob(params) {
99
const configStore = useConfigStore();
10+
const toolRequestsEnabled = configStore.config?.enable_tool_requests !== false;
1011
const celeryEnabled = !!configStore.config?.enable_celery_tasks;
1112
const hasParameters = !!params.formConfig?.has_parameters;
12-
if (celeryEnabled && hasParameters) {
13+
if (toolRequestsEnabled && celeryEnabled && hasParameters) {
1314
return submitAsync(params);
1415
}
15-
if (celeryEnabled && !hasParameters) {
16+
if (toolRequestsEnabled && celeryEnabled && !hasParameters) {
1617
Sentry.captureMessage("tool submission fell back to /api/tools: no typed parameters", {
1718
level: "info",
1819
tags: {

doc/source/admin/galaxy_options.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5431,6 +5431,20 @@
54315431
:Type: bool
54325432

54335433

5434+
~~~~~~~~~~~~~~~~~~~~~~~~
5435+
``enable_tool_requests``
5436+
~~~~~~~~~~~~~~~~~~~~~~~~
5437+
5438+
:Description:
5439+
Submit tool jobs through the asynchronous tool requests API
5440+
(`/api/jobs`) when available. The client falls back to the legacy
5441+
`/api/tools` endpoint when this is disabled, when Celery is not
5442+
enabled, or when the tool does not provide a typed parameter
5443+
schema.
5444+
:Default: ``true``
5445+
:Type: bool
5446+
5447+
54345448
~~~~~~~~~~~~~~~
54355449
``celery_conf``
54365450
~~~~~~~~~~~~~~~

lib/galaxy/config/sample/galaxy.yml.sample

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,6 +2949,12 @@ galaxy:
29492949
# https://docs.galaxyproject.org/en/master/admin/production.html#use-celery-for-asynchronous-tasks
29502950
#enable_celery_tasks: false
29512951

2952+
# Submit tool jobs through the asynchronous tool requests API
2953+
# (`/api/jobs`) when available. The client falls back to the legacy
2954+
# `/api/tools` endpoint when this is disabled, when Celery is not
2955+
# enabled, or when the tool does not provide a typed parameter schema.
2956+
#enable_tool_requests: true
2957+
29522958
# Configuration options passed to Celery.
29532959
# To refer to a task by name, use the template `galaxy.foo` where
29542960
# `foo` is the function name of the task defined in the

lib/galaxy/config/schemas/config_schema.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4017,6 +4017,16 @@ mapping:
40174017
backend URL. By default, Galaxy uses an SQLite database at '<data_dir>/results.sqlite' for storing task results.
40184018
For details, see https://docs.galaxyproject.org/en/master/admin/production.html#use-celery-for-asynchronous-tasks
40194019
4020+
enable_tool_requests:
4021+
type: bool
4022+
default: true
4023+
required: false
4024+
desc: |
4025+
Submit tool jobs through the asynchronous tool requests API (`/api/jobs`)
4026+
when available. The client falls back to the legacy `/api/tools` endpoint
4027+
when this is disabled, when Celery is not enabled, or when the tool does
4028+
not provide a typed parameter schema.
4029+
40204030
celery_conf:
40214031
type: any
40224032
required: false

lib/galaxy/managers/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def _config_is_truthy(item, key, **context):
215215
"expose_user_email": _use_config,
216216
"enable_tool_source_display": _use_config,
217217
"enable_celery_tasks": _use_config,
218+
"enable_tool_requests": _use_config,
218219
"quota_source_labels": lambda item, key, **context: list(
219220
object_store.get_quota_source_map().get_quota_source_labels()
220221
),

0 commit comments

Comments
 (0)