Skip to content

Commit

Permalink
Fix up build infrastructure for pq.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim committed May 13, 2024
1 parent 7fc24f8 commit fce7d93
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ jobs:
image: ${{ github.repository }}-hinfo
github_token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile.hinfo

- name: Build pqserver
uses: lsst-sqre/build-and-push-to-ghcr@v1
with:
image: ${{ github.repository }}-pq
github_token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile.pqserver
14 changes: 9 additions & 5 deletions Dockerfile.pqserver
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM python:3.11
RUN pip install flask gunicorn sqlalchemy
WORKDIR /consdb-server
COPY src/server.py /consdb-server/
RUN pip install flask gunicorn sqlalchemy psycopg2
WORKDIR /consdb-pq
COPY python/lsst/consdb/pqserver.py python/lsst/consdb/utils.py /consdb-pq/
# Environment variables that must be set:
# POSTGRES_URL
ENTRYPOINT [ "gunicorn", "-b", "0.0.0.0:8000", "-w", "2", "server:app" ]
# 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", "pqserver:app" ]

7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"

[project]
name = "consdb"
description = "consdb is a Commandable SAL Component for the `Vera C. Rubin Observatory <https://lsst.org>`_."
description = "consdb provides support for the Consolidated Database for the `Vera C. Rubin Observatory <https://lsst.org>`_."
license = { text = "GPL" }
dependencies = ["pymodbus"]
dependencies = ["flask", "requests"]
readme = "README.rst"
urls = { documentation = "https://consdb.lsst.io", source_code = "https://github.com/lsst-dm/consdb"}
dynamic = ["version"]
Expand All @@ -17,9 +17,6 @@ version = { attr = "setuptools_scm.get_version" }
[tool.setuptools.packages.find]
where = [ "python" ]

[project.scripts]
run_consdb = "lsst.consdb.cli:execute_csc"

[tool.setuptools_scm]
write_to = "python/lsst/consdb/version.py"
write_to_template = """
Expand Down

0 comments on commit fce7d93

Please sign in to comment.