Skip to content

Commit

Permalink
Convert to Wobby and the new Safir UWS library
Browse files Browse the repository at this point in the history
Remove the direct database connection and convert to the new Safir
UWS library and the Wobbly backend for job storage. Remove the
command-line tool, since its only purpose was to manage the database
schema. Simplify the application startup now that schema creation is
not required.

Change the dependencies to return the full cutout model, now that
Safir supports this. Move the parsing from strings into a helper
function used by the dependencies, since the cutout model no longer
has to be aware of the SODA input parameters.

Move the `MultiValuedParameterError` exception here from Safir, since
that error code is SODA-specific.
  • Loading branch information
rra committed Dec 12, 2024
1 parent 97f5116 commit 6a7bbaa
Show file tree
Hide file tree
Showing 24 changed files with 349 additions and 863 deletions.
12 changes: 1 addition & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ RUN useradd --create-home appuser
# Copy the virtualenv
COPY --from=install-image /opt/venv /opt/venv

# Copy the Alembic configuration and migrations, and set that path as the
# working directory so that Alembic can be run with a simple entry command
# and no extra configuration.
COPY --from=install-image /workdir/alembic.ini /app/alembic.ini
COPY --from=install-image /workdir/alembic /app/alembic
WORKDIR /app

# Copy the startup script
COPY scripts/start-frontend.sh /start-frontend.sh

# Make sure we use the virtualenv
ENV PATH="/opt/venv/bin:$PATH"

Expand All @@ -72,4 +62,4 @@ USER appuser
EXPOSE 8080

# Run the application.
CMD ["/start-frontend.sh"]
CMD ["uvicorn", "vocutouts.main:app", "--host", "0.0.0.0", "--port", "8080"]
22 changes: 0 additions & 22 deletions alembic.ini

This file was deleted.

14 changes: 0 additions & 14 deletions alembic/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions alembic/docker-compose.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions alembic/env.py

This file was deleted.

26 changes: 0 additions & 26 deletions alembic/script.py.mako

This file was deleted.

27 changes: 0 additions & 27 deletions alembic/versions/20240912_1902_5ab72a20365b_initial_uws_schema.py

This file was deleted.

5 changes: 0 additions & 5 deletions changelog.d/20241021_232057_steliosvoutsinas_DM_47027.md

This file was deleted.

11 changes: 11 additions & 0 deletions changelog.d/20241210_140315_rra_DM_47986.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Backwards-incompatible changes

- Switch to Wobbly for job storage. All previous job history will be lost unless the vo-cutouts database is converted into Wobbly's storage format and inserted into Wobbly's database.

### Bug fixes

- Append a colon after the error code when reporting UWS errors.

### Other changes

- Render all UWS XML output except for error VOTables using vo-models rather than hand-written XML templates.
20 changes: 4 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,17 @@ classifiers = [
# be able to install vo-cutouts there so that we can use supporting code.
requires-python = ">=3.11"
dependencies = [
# FastAPI including some optional features
"fastapi",
"python-multipart",
"uvicorn[standard]",
# Other dependencies.
"alembic[tz]",
"astropy",
"click",
"fastapi",
"pydantic>2",
"pydantic-settings",
"safir[db,uws] @ git+https://github.com/lsst-sqre/safir@main#subdirectory=safir",
"safir[uws]>=9.0.1",
"structlog",
"uvicorn[standard]",
]


dynamic = ["version"]

[project.scripts]
vo-cutouts = "vocutouts.cli:main"

[project.urls]
Homepage = "https://github.com/lsst-sqre/vo-cutouts"
Source = "https://github.com/lsst-sqre/vo-cutouts"
Expand Down Expand Up @@ -79,10 +70,7 @@ disallow_untyped_defs = true
disallow_incomplete_defs = true
ignore_missing_imports = true
local_partial_types = true
plugins = [
"pydantic.mypy",
"sqlalchemy.ext.mypy.plugin",
]
plugins = ["pydantic.mypy"]
no_implicit_reexport = true
show_error_codes = true
strict_equality = true
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ click-log==0.4.0 \
--hash=sha256:3970f8570ac54491237bcdb3d8ab5e3eef6c057df29f8c3d1151a51a9c23b975 \
--hash=sha256:a43e394b528d52112af599f2fc9e4b7cf3c15f94e53581f74fa6867e68c91756
# via scriv
colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows' \
colorama==0.4.6 ; platform_system == 'Windows' or sys_platform == 'win32' \
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
# via
Expand Down
Loading

0 comments on commit 6a7bbaa

Please sign in to comment.