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-41367: Make Butler server deployable #901

Merged
merged 5 commits into from
Nov 3, 2023
Merged

DM-41367: Make Butler server deployable #901

merged 5 commits into from
Nov 3, 2023

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Nov 2, 2023

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (97f57a3) 87.67% compared to head (c50bf28) 87.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #901      +/-   ##
==========================================
+ Coverage   87.67%   87.87%   +0.20%     
==========================================
  Files         277      281       +4     
  Lines       36338    36435      +97     
  Branches     7583     7601      +18     
==========================================
+ Hits        31858    32019     +161     
+ Misses       3318     3263      -55     
+ Partials     1162     1153       -9     
Files Coverage Δ
...n/lsst/daf/butler/remote_butler/_authentication.py 100.00% <100.00%> (ø)
...on/lsst/daf/butler/remote_butler/server/_server.py 88.00% <100.00%> (-0.68%) ⬇️
.../butler/remote_butler/server/handlers/_external.py 100.00% <100.00%> (ø)
tests/test_server.py 96.51% <100.00%> (+0.73%) ⬆️
tests/test_authentication.py 94.11% <94.11%> (ø)
...t/daf/butler/remote_butler/server/_dependencies.py 70.00% <70.00%> (ø)
...on/lsst/daf/butler/remote_butler/_remote_butler.py 87.14% <71.42%> (-2.01%) ⬇️

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


# This is kind of a fragile test. Butler's search logic does a lot of
# manipulations involving creating new ResourcePaths, and ResourcePath
# doesn't use httpx so we can't easily inject the TestClient in there.
Copy link
Member

@timj timj Nov 2, 2023

Choose a reason for hiding this comment

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

If we decide that we want to do that we can consider changing ResourcePath to use httpx rather than requests (Obviously this is not half a day's work but might not be a huge amount of work).

@dhirving dhirving marked this pull request as ready for review November 2, 2023 23:04
@dhirving
Copy link
Contributor Author

dhirving commented Nov 2, 2023

The jenkins run just failed for this, I need to gate out test_authentication.py like the rest of the RemoteButler tests because it ends up implicitly loading httpx

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

I've made a quick scan through the changes. I'll take another look when you've finished it. Lots of docstring tweaks and I need to show you how to build docs.

python/lsst/daf/butler/remote_butler/_authentication.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/remote_butler/_authentication.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/remote_butler/_authentication.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/remote_butler/_authentication.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/remote_butler/_authentication.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/remote_butler/_remote_butler.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/remote_butler/_remote_butler.py Outdated Show resolved Hide resolved
requirements.txt Show resolved Hide resolved
tests/test_authentication.py Outdated Show resolved Hide resolved
tests/test_authentication.py Outdated Show resolved Hide resolved
Base automatically changed from tickets/DM-41366 to main November 3, 2023 19:56
@dhirving dhirving force-pushed the tickets/DM-41367 branch 2 times, most recently from c089ce9 to cfebca2 Compare November 3, 2023 20:48
@dhirving dhirving force-pushed the tickets/DM-41367 branch 3 times, most recently from 51f0d7c to 0acd62f Compare November 3, 2023 21:59
@dhirving
Copy link
Contributor Author

dhirving commented Nov 3, 2023

Alright @timj , I think I got everything. Other than your comments I changed it so that instead of /butler we're under /api/butler like Russ requested. This will need to become variable per-deployment shortly, so to make that easier I aligned us with the safir template's pattern for declaring that prefix. That required declaring a separate APIRouter instance for the external routes and splitting up the main server file into a few files.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

Looks great.

For phalanx deployments, all butler servers will have the same hostname but live under different paths.
For the purposes of the RSP, Butler is considered part of the "API
Aspect", so the path to it needs to start with /api/.  Handlers were
re-organized to be grouped under an APIRouter, since this prefix will
need to be configurable in the future.
@dhirving dhirving merged commit 60026e2 into main Nov 3, 2023
17 checks passed
@dhirving dhirving deleted the tickets/DM-41367 branch November 3, 2023 23:57
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