Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-47986: Convert the UWS library to use the Wobbly backend #349

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

rra
Copy link
Member

@rra rra commented Dec 10, 2024

Rather than storing UWS jobs directly in a database, which requires every UWS-based application to manage its own separate database, use the Wobbly service to manage all job storage. This service uses a delegated token to determine the user and service, so considerably less tracking of the user is required.

UWS applications now store the serialized parameter model in the database rather than a list of key/value pairs, and rely on methods on the parameters model to convert to the XML format for the current IVOA UWS protocol.

Add a mock for Wobbly that can be used to test UWS applications without having the Wobbly API available.

Drop the ErrorCode enum, since its values were specific to SODA, and instead take the error code as a string. Drop some related exceptions that are not used directly in Safir and are specific to SODA.

@rra rra force-pushed the tickets/DM-47986 branch 2 times, most recently from 95427a0 to 6aae663 Compare December 11, 2024 01:04
@rra rra requested a review from fajpunk December 11, 2024 01:20
@rra
Copy link
Member Author

rra commented Dec 11, 2024

The typing here internally is not great — the parameters type is Any throughout much of the internal code for mypy — because I hadn't come up with a good way to do type propagation into the internals. I have subsequently thought of a strategy that should work, but it's a major refactoring, so I'm saving it for a follow-on PR.

@rra
Copy link
Member Author

rra commented Dec 11, 2024

I should also note that I temporarily removed job expiration. I need to think about the right way to handle that between the application and Wobbly and will re-add it in a later PR.

Copy link
Member

@fajpunk fajpunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, and I think it reenforces that making Wobbly was the right thing to do. Some minor things, mostly documentation stuff.

docs/user-guide/uws/index.rst Show resolved Hide resolved
docs/user-guide/uws/testing.rst Show resolved Hide resolved
docs/user-guide/uws/define-models.rst Show resolved Hide resolved
docs/user-guide/uws/write-backend.rst Show resolved Hide resolved
docs/user-guide/uws/define-inputs.rst Show resolved Hide resolved
safir/src/safir/uws/_config.py Outdated Show resolved Hide resolved
safir/src/safir/uws/_handlers.py Show resolved Hide resolved
safir/src/safir/uws/_storage.py Outdated Show resolved Hide resolved
safir/src/safir/uws/_constants.py Show resolved Hide resolved
safir/src/safir/uws/_app.py Show resolved Hide resolved
Rather than storing UWS jobs directly in a database, which requires
every UWS-based application to manage its own separate database, use
the Wobbly service to manage all job storage. This service uses a
delegated token to determine the user and service, so considerably
less tracking of the user is required.

UWS applications now store the serialized parameter model in the
database rather than a list of key/value pairs, and rely on methods
on the parameters model to convert to the XML format for the current
IVOA UWS protocol.

Add a mock for Wobbly that can be used to test UWS applications
without having the Wobbly API available.

Drop the `ErrorCode` enum, since its values were specific to SODA,
and instead take the error code as a string. Drop some related
exceptions that are not used directly in Safir and are specific to
SODA.
@rra rra force-pushed the tickets/DM-47986 branch from 6aae663 to dbc082f Compare December 12, 2024 00:07
@rra rra enabled auto-merge December 12, 2024 00:07
@rra rra merged commit ed1ff87 into main Dec 12, 2024
5 checks passed
@rra rra deleted the tickets/DM-47986 branch December 12, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants