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-42189: Serve multiple Butler repositories from a single server #931

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Dec 27, 2023

In most environments, users will access multiple Butler repositories (multiple data releases, prompt processing, etc.). To avoid the need to instantiate a separate service for every repository, allow multiple repositories to be hosted from a single server.

This uses the same DAF_BUTLER_REPOSITORY_INDEX configuration system as DirectButler.

Checklist

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

Copy link

codecov bot commented Dec 27, 2023

Codecov Report

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

Comparison is base (e6ab75b) 87.99% compared to head (f85bdf0) 88.00%.

Files Patch % Lines
...n/lsst/daf/butler/remote_butler/server/_factory.py 75.00% 1 Missing and 1 partial ⚠️
...t/daf/butler/remote_butler/server/_dependencies.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #931      +/-   ##
==========================================
+ Coverage   87.99%   88.00%   +0.01%     
==========================================
  Files         309      308       -1     
  Lines       39468    39452      -16     
  Branches     8311     8309       -2     
==========================================
- Hits        34730    34720      -10     
+ Misses       3531     3524       -7     
- Partials     1207     1208       +1     

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

@dhirving dhirving force-pushed the tickets/DM-42189 branch 2 times, most recently from 447f91c to ddfe56d Compare December 28, 2023 18:09
@dhirving dhirving marked this pull request as ready for review December 28, 2023 18:33
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 good. Is the /repo in the path really necessary?

Butler to use.
repository : `str`
The label of the Butler repository requested by the user.

Copy link
Member

Choose a reason for hiding this comment

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

Numpydoc doesn't need the blank line here.

index_filename = "repo_index.yaml"
repo_name = "testserver"
with open(os.path.join(temp_dir, index_filename), "wb") as fh:
fh.write(f"{repo_name}: {butler_root}\n".encode())
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fh.write(f"{repo_name}: {butler_root}\n".encode())
yaml.dump({repo_name: butler_root}, stream=fh)

?

@dhirving
Copy link
Contributor Author

dhirving commented Jan 2, 2024

Looks good. Is the /repo in the path really necessary?

Yeah, it leaves a free namespace where we can put per-server endpoints, like "list_available_repositories" or "health_check". Otherwise we'd have to worry about repository labels colliding with endpoint names. (Not sure but I wouldn't be surprised if FastAPI doesn't even support having a /{placeholder} that potentially collides with another name.)

Base automatically changed from tickets/DM-42188 to main January 3, 2024 19:46
In most environments, users will access multiple Butler repositories (multiple data releases, prompt processing, etc.).  To avoid the need to instantiate a separate service for every repository, allow multiple repositories to be hosted from a single server.

This uses the same DAF_BUTLER_REPOSITORY_INDEX configuration system as DirectButler.
@dhirving dhirving merged commit c6b19fb into main Jan 3, 2024
18 checks passed
@dhirving dhirving deleted the tickets/DM-42189 branch January 3, 2024 20:03
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