Skip to content

DM-50087: Preload IERS data in Prompt Processing #328

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

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

Conversation

kfindeisen
Copy link
Member

This PR implements a two-part system for caching IERS data at USDF and importing it into Prompt Processing at pod start. This is expected to be faster than a direct download from IERS/ObsPM, and ensures that we do not download in the middle of processing (though by happening at pod start it will still reduce our response time at the start of a sequence).

We don't need any special support to handle setting up and tearing down
mock patchers; TestCase.enterContext does exactly what's needed.
This lets Prompt Processing access a cache that's been prepared at
USDF, instead of a potentially slow download from official repos.
The updater can run in either service or initializer pods. It needs an
extra variable (CENTRAL_IERS_CACHE) to know what to download; default
is to skip download.
The function checks if the cache has already been imported and skips
download if that's the case.
@kfindeisen kfindeisen requested a review from ktlim July 3, 2025 17:03
astropy.utils.data.download_file(url, cache="update")
with tempfile.NamedTemporaryFile(suffix=".zip") as local_cache:
astropy.utils.data.export_download_cache(local_cache, IERS_URLS, overwrite=True)
dest = lsst.resources.ResourcePath(args.destination)
Copy link
Contributor

Choose a reason for hiding this comment

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

While we can run this multiple times for different destinations, it seems that it wouldn't be a lot harder to take a list of destinations here.

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