Skip to content

DM-52238: Redo the UWS pattern to call Wobbly in the worker#432

Draft
rra wants to merge 2 commits intomainfrom
tickets/DM-52238
Draft

DM-52238: Redo the UWS pattern to call Wobbly in the worker#432
rra wants to merge 2 commits intomainfrom
tickets/DM-52238

Conversation

@rra
Copy link
Copy Markdown
Member

@rra rra commented Aug 21, 2025

Originally, the UWS pattern stored job information directly in a PostgreSQL database specific to the service and therefore needed a separate database worker to store status and results because layering the SQLAlchemy models on top of a stack container was likely to fail. Subsequently, we switched to the Wobbly web service to store job results, which can be accessed with much lighter-weight dependencies. However, we kept the database worker to avoid major refactoring.

This is that delayed major refactoring. Eliminate the separate database worker in favor of having the wrapper around the backend job function update the job status and store results directly. This eliminates all of the setup for the separate UWS worker and the code to force serialization of tracebacks in exceptions so that they could be serialized by arq in job results. Job workers no longer need to know anything about the arq queue.

The (temporary) drawbacks are that safir.arq.uws gains a separate Wobbly client from the proper Pydantic-based client in safir.uws, and we temporarily lose Slack notifications of failures in the backend worker because that would require a Safir dependency. Hopefully both can be worked around in the future.

@rra rra force-pushed the tickets/DM-52238 branch 3 times, most recently from 2ff34ef to db86b59 Compare August 21, 2025 17:10
rra added 2 commits August 21, 2025 10:21
Originally, the UWS pattern stored job information directly in a
PostgreSQL database specific to the service and therefore needed a
separate database worker to store status and results because layering
the SQLAlchemy models on top of a stack container was likely to fail.
Subsequently, we switched to the Wobbly web service to store job
results, which can be accessed with much lighter-weight dependencies.
However, we kept the database worker to avoid major refactoring.

This is that delayed major refactoring. Eliminate the separate database
worker in favor of having the wrapper around the backend job function
update the job status and store results directly. This eliminates all
of the setup for the separate UWS worker and the code to force
serialization of tracebacks in exceptions so that they could be
serialized by arq in job results. Job workers no longer need to know
anything about the arq queue.

The (temporary) drawbacks are that safir.arq.uws gains a separate
Wobbly client from the proper Pydantic-based client in safir.uws, and
we temporarily lose Slack notifications of failures in the backend
worker because that would require a Safir dependency. Hopefully both
can be worked around in the future.
Updating dependencies on vo-cutouts tried to downgrade the Google
API modules to an ancient version for some reason. Ensure this
cannot happen.
@rra rra force-pushed the tickets/DM-52238 branch from db86b59 to 052c156 Compare August 21, 2025 17:21
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.

1 participant