Skip to content

Commit

Permalink
Merge pull request #32 from lsst-dm/tickets/DM-45456
Browse files Browse the repository at this point in the history
DM-45456 Move from Flask to FastAPI +424-488
  • Loading branch information
bbrondel authored Aug 2, 2024
2 parents 5822be9 + fb4015c commit 19b5224
Show file tree
Hide file tree
Showing 5 changed files with 458 additions and 502 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Editable mode install
run: |
python -m pip install uv
uv pip install --system pytest pytest-cov pytest-html
uv pip install --system pytest pytest-cov pytest-html pytest-asyncio httpx
uv pip install --system -e .
- name: Test with pytest
run: |
Expand Down
7 changes: 3 additions & 4 deletions Dockerfile.pqserver
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM python:3.11
RUN pip install flask gunicorn sqlalchemy psycopg2
RUN pip install fastapi safir astropy uvicorn gunicorn sqlalchemy psycopg2
WORKDIR /
COPY python/lsst/consdb/__init__.py python/lsst/consdb/pqserver.py python/lsst/consdb/utils.py /consdb-pq/
COPY python/lsst/consdb/__init__.py python/lsst/consdb/pqserver.py python/lsst/consdb/utils.py /consdb_pq/
# Environment variables that must be set:
# DB_HOST DB_PASS DB_USER DB_NAME or POSTGRES_URL

# Expose the port.
EXPOSE 8080

ENTRYPOINT [ "gunicorn", "-b", "0.0.0.0:8080", "-w", "2", "consdb-pq.pqserver:app" ]

ENTRYPOINT [ "uvicorn", "consdb_pq.pqserver:app", "--host", "0.0.0.0", "--port", "8080" ]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "consdb"
description = "consdb provides support for the Consolidated Database for the `Vera C. Rubin Observatory <https://lsst.org>`_."
license = { text = "GPL" }
dependencies = ["flask", "requests", "sqlalchemy"]
dependencies = ["fastapi", "requests", "sqlalchemy", "astropy"]
readme = "README.rst"
urls = { documentation = "https://consdb.lsst.io", source_code = "https://github.com/lsst-dm/consdb"}
dynamic = ["version"]
Expand Down
Loading

0 comments on commit 19b5224

Please sign in to comment.