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-42191: Allow use of Butler client/server #140

Merged
merged 3 commits into from
Feb 14, 2024
Merged

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Jan 24, 2024

Changed the way Butler is used to support client/server Butler. We now pass a Gafaelfawr delegated token down to the cutouts worker, so that it can be used to authenticate with Butler server.

This required updating safir, which in turn required updating FastAPI. Fixed a slight incompatibility in FastAPI's handling of form data -- it appears to no longer coerce single form values into list[str] automatically.

@dhirving dhirving force-pushed the tickets/DM-42191 branch 3 times, most recently from af49300 to 3fad1f1 Compare January 26, 2024 21:01
Upgrade safir to get auth_delegated_token_dependency.

FastAPI had to be upgraded as a result.  It appears that it no longer automatically coerces single-item form parameters to list[str], so some types had to be updated.  (These appear to be intended only as documentation, but are still validated by FastAPI.)
Retrieve delegated access tokens from Gafaelfawr headers, and pass them down to the job dispatch layer.  This will be used to pass the access token to the backend for use by the Butler client.
@dhirving dhirving force-pushed the tickets/DM-42191 branch 8 times, most recently from 24bf4cb to a2b946b Compare February 2, 2024 21:27
@@ -25,7 +25,8 @@ set -x
# alternative (no releases and no tags).
mkdir /backend
cd /backend
git clone --depth 1 https://github.com/lsst-dm/image_cutout_backend.git
# TODO: This should not reference a ticket branch..
git clone --depth 1 -b tickets/DM-42191 https://github.com/lsst-dm/image_cutout_backend.git
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add a tag in image-cutout-backend that we can reference after the changes there get through review.

@dhirving dhirving marked this pull request as ready for review February 9, 2024 19:10
@dhirving dhirving requested a review from rra February 9, 2024 19:11
Copy link
Member

@rra rra left a comment

Choose a reason for hiding this comment

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

This looks great to me. Thanks! As with datalinker, I'll do a modernization pass on the service once this is merged and before making a new release, since it hasn't gotten any attention in a while.

Create Butlers using LabeledButlerFactory and provide the Gafaelfawr access token.  This allows us to use Butler client/server if the environment is configured to do so.
@dhirving dhirving merged commit 9b4798b into main Feb 14, 2024
2 checks passed
@dhirving dhirving deleted the tickets/DM-42191 branch February 14, 2024 18:15
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