Skip to content

Conversation

ktlim
Copy link
Contributor

@ktlim ktlim commented Apr 1, 2025

No description provided.

@ktlim ktlim force-pushed the tickets/DM-49822 branch from cb3ba79 to 3208c8a Compare April 3, 2025 04:05
for visit in visit_list:
group = increment_group(instrument, group, 1)
refs = prepare_one_visit(kafka_url, group, butler, instrument, visit)
uris = [butler.getURI(ref) for ref in refs]
Copy link
Member

Choose a reason for hiding this comment

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

In theory butler.get_many_uris is faster than calling getURI in a loop (for direct butler it will do a single database query).

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 wanted to use something like that, but I didn't see that in (daily) pipelines.lsst.io. Did something break the docs?

Copy link
Member

Choose a reason for hiding this comment

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

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 see, it's in the base class. A shame it doesn't get propagated to the derived.

@ktlim ktlim force-pushed the tickets/DM-49822 branch from 3208c8a to 8035dae Compare April 3, 2025 05:46
@eigerx
Copy link
Contributor

eigerx commented Apr 4, 2025

Since this ticket is better practice and works, are we ok to (rebase and then) merge to main? Or is there a way we can wrangle get_many_uris to be even more efficient?

@ktlim ktlim force-pushed the tickets/DM-49822 branch from 8035dae to 404bc69 Compare April 8, 2025 22:00

path = transferred[0].path
path = os.path.join(temp_dir, uri.basename())
ResourcePath(path).transfer_from(uri, transfer="copy")
Copy link
Member

@timj timj Apr 8, 2025

Choose a reason for hiding this comment

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

I'm not entirely sure what this code is trying to do, but it looks like it's downloading a file from remote to posix path, optionally extracting a sidecar json, and then uploading the raw it to a new location. Is that correct?

Why isn't this doing a direct transfer from one location to another using ResourcePath? Secondly, why isn't the JSON header extracted in the remote using astropy.io.fits with ResourcePath.to_fsspec? Would simplify the code a lot (and use ResourcePath.write without boto calls).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a direct transfer because it needs to modify some headers in the files

Copy link
Member

Choose a reason for hiding this comment

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

Why are we modifying the headers of raw files?

Copy link
Collaborator

@hsinfang hsinfang Apr 8, 2025

Choose a reason for hiding this comment

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

Because we are giving them new group ID, new exposure ID, etc to fake new exposures. The script sends a next_visit event with that metadata, and the prompt service will attempt to process the matching exposure (matching via the headers).

@ktlim ktlim force-pushed the tickets/DM-49822 branch from 404bc69 to 14c69d9 Compare April 8, 2025 23:29
@ktlim ktlim merged commit 9975eb9 into main Apr 8, 2025
7 checks passed
@ktlim ktlim deleted the tickets/DM-49822 branch April 8, 2025 23:31
@kfindeisen kfindeisen added the ignore-for-release Does not affect the containers (changes only to docs, the uploaders, and/or unit tests) label Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release Does not affect the containers (changes only to docs, the uploaders, and/or unit tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants