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-48471 : Create Release 0.2.0 #159

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

tcjennings
Copy link
Contributor

@tcjennings tcjennings commented Jan 15, 2025

This PR ties up some loose ends and creates the 0.2.0 release version.

  • Refactors in-process butler configuration with use of environment variables in place of a "repo index file" and a mounted secret in place of a "db-auth.yaml"
  • Submits htcondor jobs in a custom subprocess environment suitable for wms execution.
  • Adds support for cookies in cm-client requests.
  • Updates dependencies and cleans up unnecessary comments and linting directives.

@tcjennings tcjennings force-pushed the tickets/DM-48099/release branch 19 times, most recently from 8eda6b5 to d5f142c Compare January 17, 2025 23:54
@tcjennings tcjennings force-pushed the tickets/DM-48099/release branch 11 times, most recently from aca3cf1 to 4ff6c31 Compare January 26, 2025 00:57
@tcjennings tcjennings force-pushed the tickets/DM-48099/release branch 11 times, most recently from 88bfbf0 to a6511af Compare January 30, 2025 19:07
- Update uv version in bootstrap script
- Update dependencies
- Remove pause package dependency
- include libexpat1 in base image
- cleanup makefile, readme, comments
- Remove usdf db-altering targets from makefile
- Remove unneeded pylint directives
- Update README. Relocate script.
- Correct default ASGI__PREFIX setting.
- Update ruff version in pre-commit
- Update gitignore
- Update default htcondor host in script template
- Extend settings models
- update ruff formatting, remove pause, fixup actions
Automatically generated by python-semantic-release
@tcjennings tcjennings force-pushed the tickets/DM-48099/release branch from a6511af to a58184e Compare January 30, 2025 19:08
Copy link

@dhirving dhirving left a comment

Choose a reason for hiding this comment

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

Looks alright to me.

repo_uri = repo

try:
bc = ButlerConfig(

Choose a reason for hiding this comment

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

Instantiating a ButlerConfig does synchronous I/O, so you probably don't want to do this in an async function without using a threadpool.

(You should assume that basically every function/constructor/method in daf_butler, resources, and other adjacent packages does synchronous I/O -- even if it seems like it shouldn't need to. I have been caught by surprise many times.)

src/lsst/cmservice/common/butler.py Outdated Show resolved Hide resolved
@@ -220,9 +221,10 @@ async def split(
if mock_butler:
sorted_field_values = np.arange(10)
else:
butler_config = await get_butler_config(butler_repo, without_datastore=True)
butler_f = partial(
Butler.from_config,

Choose a reason for hiding this comment

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

FYI instantiating a Butler is rather expensive (typically 1-2 seconds snuffling around configuration files and the database at startup, and you start with empty caches for other database-snufflings that happen when you call methods later.)

If this function doesn't get called very often that's probably fine, but you might consider some other ways of instantiating a Butler:

  • Use LabeledButlerFactory to instantiate the Butler for each request -- this shares a database connection pool and various caches between instances so they start up faster.
  • Keep a 'template' Butler instance , and use Butler.clone() to make a copy of it for each request.
  • Keep a pool of Butler instances

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 have created a new Jira story (DM-48690) to address these issues and implement an effective butler pool, as I think it will be more important as I expand the amount of in-process Butler operations but for right now these are few and far between.

Comment on lines 79 to 83
access_token: str | None = Field(
description=("Gafaelfawr access token used to authenticate to a Butler server."),
default=None,
)

Choose a reason for hiding this comment

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

You don't need access_token, and if you did it would come in via an HTTP header instead of this configuration.

It only applies to services running on the Rubin Science Platform, using Gafaelfawr authentication to access Butler server.

Copy link
Contributor Author

@tcjennings tcjennings Jan 30, 2025

Choose a reason for hiding this comment

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

I added this because I saw the token in the signature for the create_butler method of the LabeledButlerFactory, thinking it might be useful to have ready to go, but if there's no future case it'd be necessary I will remove it.

Choose a reason for hiding this comment

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

Yeah for your service I don't anticipate you'll ever need it.

@tcjennings tcjennings force-pushed the tickets/DM-48099/release branch 3 times, most recently from b8fded6 to 7e95e3e Compare January 30, 2025 22:32
@tcjennings tcjennings force-pushed the tickets/DM-48099/release branch from 7e95e3e to 0eaceab Compare January 30, 2025 22:44
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