Skip to content
Merged
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
4 changes: 2 additions & 2 deletions lib/galaxy/dependencies/pinned-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ edam-ontology==1.25.2
email-validator==2.3.0
et-xmlfile==2.0.0
exceptiongroup==1.3.0 ; python_full_version < '3.11'
fastapi-slim==0.118.3
fastapi==0.118.3
filelock==3.19.1 ; python_full_version < '3.10'
filelock==3.20.0 ; python_full_version >= '3.10'
fissix==24.4.24
Expand Down Expand Up @@ -224,7 +224,7 @@ tomli==2.3.0 ; python_full_version < '3.11'
tornado==6.5.2
tqdm==4.67.1
tuspy==1.1.0
tuswsgi==0.5.5
tuspyserver==4.2.0
typing-extensions==4.15.0
typing-inspection==0.4.2
tzdata==2025.2
Expand Down
26 changes: 0 additions & 26 deletions lib/galaxy/webapps/galaxy/buildapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
import threading
import traceback
from typing import Optional
from urllib.parse import urljoin

from paste import httpexceptions
from tuswsgi import TusMiddleware

import galaxy.app
import galaxy.datatypes.registry
Expand Down Expand Up @@ -1084,30 +1082,6 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
from galaxy.web.framework.middleware.translogger import TransLogger

app = wrap_if_allowed(app, stack, TransLogger)
# TUS upload middleware
app = wrap_if_allowed(
app,
stack,
TusMiddleware,
kwargs={
"upload_path": urljoin(f"{application_stack.config.galaxy_url_prefix}/", "api/upload/resumable_upload"),
"tmp_dir": application_stack.config.tus_upload_store or application_stack.config.new_file_path,
"max_size": application_stack.config.maximum_upload_file_size,
},
)
# TUS upload middleware for job files....
app = wrap_if_allowed(
app,
stack,
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_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,
},
)
# X-Forwarded-Host handling
app = wrap_if_allowed(app, stack, XForwardedHostMiddleware)
# Request ID middleware
Expand Down
20 changes: 20 additions & 0 deletions lib/galaxy/webapps/galaxy/fast_app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import (
Any,
)
from urllib.parse import urljoin

from a2wsgi import WSGIMiddleware
from fastapi import (
Expand All @@ -9,6 +10,7 @@
)
from fastapi.openapi.constants import REF_TEMPLATE
from starlette.middleware.cors import CORSMiddleware
from tuspyserver import create_tus_router

from galaxy.schema.generics import CustomJsonSchema
from galaxy.version import VERSION
Expand Down Expand Up @@ -165,6 +167,23 @@ def get_openapi_schema() -> dict[str, Any]:
)


def include_tus(app: FastAPI, gx_app):
config = gx_app.config
root_path = "" if config.galaxy_url_prefix == "/" else config.galaxy_url_prefix
upload_tus_router = create_tus_router(
prefix=urljoin(root_path, "api/upload/resumable_upload"),
files_dir=config.tus_upload_store or config.new_file_path,
max_size=config.maximum_upload_file_size,
)
job_files_tus_router = create_tus_router(
prefix=urljoin(root_path, "api/job_files/resumable_upload"),
files_dir=config.tus_upload_store_job_files or config.tus_upload_store or config.new_file_path,
max_size=config.maximum_upload_file_size,
)
app.include_router(upload_tus_router)
app.include_router(job_files_tus_router)


def initialize_fast_app(gx_wsgi_webapp, gx_app):
root_path = "" if gx_app.config.galaxy_url_prefix == "/" else gx_app.config.galaxy_url_prefix
app = get_fastapi_instance(root_path=root_path)
Expand All @@ -178,6 +197,7 @@ def initialize_fast_app(gx_wsgi_webapp, gx_app):
include_legacy_openapi(app, gx_app)
wsgi_handler = WSGIMiddleware(gx_wsgi_webapp)
gx_app.haltables.append(("WSGI Middleware threadpool", wsgi_handler.executor.shutdown))
include_tus(app, gx_app)
app.mount("/", wsgi_handler) # type: ignore[arg-type]
if gx_app.config.galaxy_url_prefix != "/":
parent_app = FastAPI()
Expand Down
2 changes: 1 addition & 1 deletion packages/web_apps/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ install_requires =
SQLAlchemy>=2.0.37,<2.1,!=2.0.41
starlette
starlette-context
tuswsgi
tuspyserver
typing-extensions
uvicorn
uvloop>=0.21.0
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"docutils!=0.17,!=0.17.1",
"dparse",
"edam-ontology",
"fastapi-slim>=0.111.0,!=0.119.*,!=0.120.0,!=0.120.1,!=0.120.2", # https://github.com/fastapi/fastapi/pull/13918
"fastapi>=0.111.0,!=0.119.*,!=0.120.0,!=0.120.1,!=0.120.2", # https://github.com/fastapi/fastapi/pull/13918
"fissix",
"fs",
"future>=1.0.0", # Python 3.12 support
Expand Down Expand Up @@ -101,8 +101,8 @@ dependencies = [
"starlette-context",
"svgwrite",
"tifffile",
"tuswsgi",
"typing-extensions",
"tuspyserver",
"uvicorn!=0.28.0", # https://github.com/galaxyproject/galaxy/issues/17669
"uvloop>=0.21.0", # Python 3.13 support
"WebOb>=1.8.9", # Python 3.13 support
Expand Down
Loading