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-26378: Refactor S3/WebDAV datastores #355

Merged
merged 14 commits into from Aug 20, 2020
Merged

DM-26378: Refactor S3/WebDAV datastores #355

merged 14 commits into from Aug 20, 2020

Conversation

timj
Copy link
Member

@timj timj commented Aug 19, 2020

Implements a remote datastore entirely in terms of ButlerURI so there is now no special datastore for S3 or WebDAV (apart from the stub classes).

cc/ @bgounon

This simplifies some usage in datastore passing in
the root.
copy is always a good default and it's only posix that
needs to be cleverer.
@timj timj marked this pull request as draft August 19, 2020 15:30
The bulk of the logic is in ButlerURI so there is no
reason for the datastores dealing with remote resources
to be special themselves.

Currently backoff in S3 means that we have simple wrappers
there. Ideally backoff should move to ButlerURI
We don't want a relative path to be given that jumps out
of datastore.
Now uses generic ButlerURI so has no reason to be specific
to a particular datastore backend.
Datastore no longer needs to know what "auto" transfer means
and it is best to leave it to ButlerURI unless we have the
special case of the files all being within datastore.
We special case file because we can ask directly whether
we have a directory. Remove special S3/HTTP logic
and instead defer to ButlerURI
if len(serializedDataset) != storedFileInfo.file_size:
raise RuntimeError("Integrity failure in Datastore. "
f"Size of file {location.path} ({len(serializedDataset)}) "
f"does not match recorded size of {storedFileInfo.file_size}")
Copy link
Contributor

Choose a reason for hiding this comment

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

I recently added a function unwrap to lsst.daf.butler.cli.utils. Using it with one triple-quoted string might be more useful than many strings? It could be moved to a more general utils file.

            raise RuntimeError(unwrap(f"""Integrity failure in Datastore. 
                                          Size of file {location.path} ({len(serializedDataset)})
                                          does not match recorded size of {storedFileInfo.file_size}""")

@n8pease
Copy link
Contributor

n8pease commented Aug 20, 2020

just a couple comments, looks good.

@timj timj merged commit c1f0a48 into master Aug 20, 2020
@timj timj deleted the tickets/DM-26378 branch February 16, 2024 17:15
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.

None yet

2 participants