Skip to content

Commit

Permalink
Allow configuring a different store for job files tus staging.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jan 16, 2024
1 parent 686bc92 commit c7737c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 9 additions & 1 deletion lib/galaxy/config/schemas/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1886,9 +1886,17 @@ mapping:
required: False
desc: |
The upload store is a temporary directory in which files uploaded by the
tus middleware or server will be placed.
tus middleware or server for user uploads will be placed.
Defaults to new_file_path if not set.
tus_upload_store_job_files:
type: str
required: False
desc: |
The upload store is a temporary directory in which files uploaded by the
tus middleware or server for remote job files (Pulsar) will be placed.
Defaults to tus_upload_store if not set.
chunk_upload_size:
type: int
default: 10485760
Expand Down
6 changes: 5 additions & 1 deletion lib/galaxy/webapps/galaxy/api/job_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ def create(self, trans, job_id, payload, **kwargs):
elif "session_id" in payload:
# code stolen from basic.py
session_id = payload["session_id"]
upload_store = trans.app.config.tus_upload_store or trans.app.config.new_file_path
upload_store = (
trans.app.config.tus_upload_store_job_files
or trans.app.config.tus_upload_store
or trans.app.config.new_file_path
)
if re.match(r"^[\w-]+$", session_id) is None:
raise ValueError("Invalid session id format.")
local_filename = os.path.abspath(os.path.join(upload_store, session_id))
Expand Down
4 changes: 3 additions & 1 deletion lib/galaxy/webapps/galaxy/buildapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,9 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
TusMiddleware,
kwargs={
"upload_path": urljoin(f"{application_stack.config.galaxy_url_prefix}/", "api/job_files/resumable_upload"),
"tmp_dir": application_stack.config.tus_upload_store or application_stack.config.new_file_path,
"tmp_dir": application_stack.config.tus_upload_store_job_files
or application_stack.config.tus_upload_store
or application_stack.config.new_file_path,
"max_size": application_stack.config.maximum_upload_file_size,
},
)
Expand Down

0 comments on commit c7737c4

Please sign in to comment.