-
Notifications
You must be signed in to change notification settings - Fork 106
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
Support HTTP, HTTPS schemes as well as whatever Go CDK supports for blob storage #1280
base: main
Are you sure you want to change the base?
Conversation
8c6a52a
to
b2ab8ad
Compare
I realised the docs were part of this repo so I updated |
I tested this out on S3, it works with the auth credentials i have on my desktop. It's a little sad that this doubles the binary size from 18-> 36MB. @wkalt do you have any thoughts on this? |
The binary size increase doesn't seem like a big issue to me. I haven't looked at the patch in depth but it would be useful to understand exactly what the UX is on Azure, S3, and GCS. Specifically, do they all work with CLI flags, or do some of them require environment vars and others not, etc. Looking at the previous patch, the Azure solution would require environment vars. I agree with the author of that patch that this is kind of confusing. I don't know if that's a dealbreaker or not, but if it is also the case in this patch I think we'd need to, I'm +1 on expanding the remote file options but would be wary of inheriting Go CDK's default behavior, unless it aligns with what makes sense for the tool. |
Let me set up some buckets in S3, GCS and Azure to compare the CLI invocations.
Do you have a sense of what makes sense for the cli tools? As in, should I err on the side of automatically pull config from well known places (like FWIW, I only really care about HTTP access, so if adding just HTTP is an easier thing for this PR I can remove the S3/Azure stuff and go back to supporting just GCS (+ HTTP). On the topic of HTTP, the dependency that I brought in to support HTTP range requests has some behaviour I don't like. It makes a series of 8 byte range requests as |
I think there's going to need to be some compromise between consistency in the This is what I found doing some testing of various storage providers GCS
Then CLI tools and
This is consistent with other CLI tools which all pull the active config & credentials from S3/B2/R2/S3 compatible storageSet up config and credentials with in
Then CLI tools and
The CLI tools and
This is consistent with other CLI tools which use AzureOther CLI tools which support
TL;DRInteractions with Azure storage are very different to S3 and GCS. I propose either:
|
@a7g4 thanks for all that detail. I haven't tested anything but, from your description GCP and AWS both seem good to me. I like option 1 between the two options in the TLDR, which agrees with your analysis. I think some docs updates are still needed to convey what you've described in the patch. I also want to clarify I'm not a blocker for this PR, I was just pinged based on previous involvement. |
} | ||
default: | ||
return closeReader, nil, fmt.Errorf("unsupported remote file scheme: %s", scheme) | ||
func GetReader(ctx context.Context, uri string) (io.ReadSeekCloser, bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be useful to add a docstring here describing the behavior of the new bool returned
I'll update the docs (probably with some variation of the test examples I have above) and I'll make the HTTP change I described above. |
Changelog
Support HTTP, HTTPS schemes as well as whatever Go CDK supports for blob storage (s3, gcs, azure).
Docs
https://mcap.dev/guides/cli#remote-file-support was updated to reflect that s3, azure and http(s) are supported.
Description
Currently the mcap CLI only supports remote files stored in Google Cloud Storage. This change allows users to operate on files stored in S3 (and S3 compatible services), Azure as well as plain HTTP(S).
I manually tested with some mcap files stored on S3, B2 (an S3 compatible service) and GCS.
This is basically a resurection of #957
I also removed some duplicated code between
utils.GetReader
andutils.WithReader
.Go isn't a language I am super familiar with so let me know if anything un-idiomatic.