Skip to content

Commit

Permalink
Merge pull request #18 from bento-platform/refact/fastapi-config
Browse files Browse the repository at this point in the history
refact: correctly use FastAPI base config class + update uvicorn
  • Loading branch information
davidlougheed authored Aug 13, 2024
2 parents 9a08b7f + 56657c3 commit 6ec586c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v4

- name: Run Bento build action
uses: bento-platform/bento_build_action@v0.11.1
uses: bento-platform/bento_build_action@v1.0.0
with:
registry: ghcr.io
registry-username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.08.12

# Use uvicorn (instead of hypercorn) in production since I've found
# multiple benchmarks showing it to be faster - David L
RUN pip install --no-cache-dir "uvicorn[standard]==0.30.5"
RUN pip install --no-cache-dir "uvicorn[standard]==0.30.6"

WORKDIR /reference

Expand Down
8 changes: 2 additions & 6 deletions bento_reference_service/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from bento_lib.config.pydantic import BentoBaseConfig
from bento_lib.config.pydantic import BentoFastAPIBaseConfig
from fastapi import Depends
from functools import lru_cache
from pathlib import Path
Expand All @@ -13,14 +13,10 @@
]


class Config(BentoBaseConfig):
class Config(BentoFastAPIBaseConfig):
service_id: str = f"{SERVICE_GROUP}:{SERVICE_ARTIFACT}"
service_name: str = "Bento Reference Service"
service_description: str = "Reference data (genomes & annotations) service for the Bento platform."
service_url_base_path: str = "http://127.0.0.1:5000" # Base path to construct URIs from

service_docs_path: str = "/docs"
service_openapi_path: str = "/openapi.json"

database_uri: str = "postgres://localhost:5432"
file_ingest_tmp_dir: Path = Path(__file__).parent.parent / "tmp" # Default to repository `tmp` folder
Expand Down
2 changes: 1 addition & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LABEL devcontainer.metadata='[{ \
}]'

# FastAPI uses uvicorn for a development server as well
RUN pip install --upgrade pip && pip install --no-cache-dir "uvicorn[standard]==0.30.5"
RUN pip install --upgrade pip && pip install --no-cache-dir "uvicorn[standard]==0.30.6"
WORKDIR /reference

COPY pyproject.toml .
Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

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

0 comments on commit 6ec586c

Please sign in to comment.