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
14 changes: 13 additions & 1 deletion biosim_server/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import dotenv
import uvicorn
from fastapi import FastAPI, File, UploadFile, Query, APIRouter, Depends, HTTPException
from fastapi.openapi.docs import get_swagger_ui_html
from starlette.middleware.cors import CORSMiddleware
from starlette.responses import HTMLResponse

from biosim_server.biosim_omex import OmexFile, get_cached_omex_file_from_upload
from biosim_server.biosim_runs import BiosimulatorVersion
Expand Down Expand Up @@ -81,7 +83,7 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
await shutdown_standalone()


app = FastAPI(title=APP_TITLE, version=APP_VERSION, servers=APP_SERVERS, lifespan=lifespan)
app = FastAPI(openapi_url="/docs", docs_url=None, redoc_url=None, title=APP_TITLE, version=APP_VERSION, servers=APP_SERVERS, lifespan=lifespan)

# add origins
app.add_middleware(
Expand All @@ -106,6 +108,16 @@ def root() -> dict[str, str]:
def get_version() -> str:
return APP_VERSION

@app.get("/docs", include_in_schema=False)
async def custom_swagger_ui_html() -> HTMLResponse:
if app.openapi_url is None:
raise HTTPException(status_code=404, detail="OpenAPI schema not available")
return get_swagger_ui_html(
openapi_url=app.openapi_url,
title=app.title + " - Swagger UI",
swagger_js_url="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.0.21/swagger-ui-bundle.js", # Replace with your CDN URL
swagger_css_url="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.0.21/swagger-ui.css", # Replace with your CDN URL
)

@app.post(
"/verify/omex",
Expand Down
2 changes: 1 addition & 1 deletion biosim_server/api/spec/openapi_3_1_0_generated.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: biosim-server
version: 0.2.1
version: 0.2.3
paths:
/:
get:
Expand Down
2 changes: 1 addition & 1 deletion biosim_server/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.2"
__version__ = "0.2.3"
1 change: 1 addition & 0 deletions kustomize/overlays/biosim-gke/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
app: api-ingress
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/proxy-body-size: 20m
spec:
ingressClassName: nginx
tls:
Expand Down
4 changes: 2 additions & 2 deletions kustomize/overlays/biosim-gke/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace: biosim-gke

images:
- name: ghcr.io/biosimulations/biosim-api
newTag: amd64_0.2.2
newTag: amd64_0.2.3
- name: ghcr.io/biosimulations/biosim-worker
newTag: amd64_0.2.2
newTag: amd64_0.2.3
- name: docker.io/library/mongo
newTag: 8.0.4

Expand Down
4 changes: 2 additions & 2 deletions kustomize/overlays/biosim-local/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace: biosim-local

images:
- name: ghcr.io/biosimulations/biosim-api
newTag: arm64_0.2.1
newTag: arm64_0.2.3
- name: ghcr.io/biosimulations/biosim-worker
newTag: arm64_0.2.1
newTag: arm64_0.2.3
- name: docker.io/library/mongo
newTag: 8.0.4

Expand Down
1 change: 1 addition & 0 deletions kustomize/overlays/biosim-rke/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
app: api-ingress
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/proxy-body-size: "20m"
spec:
ingressClassName: nginx
tls:
Expand Down
4 changes: 2 additions & 2 deletions kustomize/overlays/biosim-rke/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace: biosim-rke

images:
- name: ghcr.io/biosimulations/biosim-api
newTag: amd64_0.2.1
newTag: amd64_0.2.3
- name: ghcr.io/biosimulations/biosim-worker
newTag: amd64_0.2.1
newTag: amd64_0.2.3
- name: docker.io/library/mongo
newTag: 8.0.4

Expand Down
26 changes: 17 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "biosim-server"
version = "0.2.2"
version = "0.2.3"
description = "Server for the consolidated Biosimulations API"
authors = ["Alex Patrie <alexanderpatrie@gmail.com>, Jim Schaff <schaff@uchc.edu>"]
readme = "README.md"
Expand Down