-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(libstore): curl-based s3 #13752
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
base: master
Are you sure you want to change the base?
Conversation
Would it be conceivable to just outright replace aws-sdk-cpp with this? I don't think we'd want to support it if we land this eventually. |
I was unsure about just removing the existing implementation outright, but I can do that if folks are OK with it? |
Can't speak for everyone, but I feel ripping out aws-sdk-cpp would be very welcome if the new thing is more lightweight and reuses the curl infrastructure with feature parity. That would definitely be better than supporting both implementations. |
@xokdvium I'm going to get this in a fully working state, and after I'm happy with it I'll tack on a final commit removing the old impl, so if there's tension we can discuss that point separately, or I can make it a separate PR, etc. I'm with you that if this works well, we're better off just tossing the old impl, though that would mean folks building with old curl would lose the ability to talk to s3, but idk if we care to support people building non-standard configurations like that. |
cd41165
to
1046367
Compare
2030275
to
86873ed
Compare
I want to definitely test this with our hydra staging instance to ensure it still can upload stuff to s3 buckets before merging. |
AFAICT this is ready for (very) preliminary testing; at least I was able to pull and push to an S3 store and auth just worked, like magic :) |
Nevermind, I messed something up, buckets outside of us-east-1 don't work :P |
aefcffd
to
3433232
Compare
2dd60ad
to
80e3327
Compare
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.
Some preliminary comments
80e3327
to
3333622
Compare
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This is extracted from the work in NixOS#13752
This is extracted from the work in NixOS#13752
This is extracted from the work in NixOS#13752
This is extracted from the work in NixOS#13752
This is extracted from the work in NixOS#13752
This is extracted from the work in NixOS#13752
97f78c0
to
1c2d53b
Compare
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
1c2d53b
to
55f8b1a
Compare
{ | ||
// Access the curlFileTransfer singleton and clear its cache | ||
try { | ||
auto ft = getFileTransfer(); |
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.
This will not work as expected in builtin derivaiton fetching, because it doesn't use getFileTransfer
in that case because it is in a fork.
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.
Yeah, those would each end up with their own provider. I couldn't see a clean way to improve that though, and AFAICT the status-quo also does that.
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.
We should add a test though.
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.
#13791 (comment) This comment was supposed to go with this PR. It might be a pain, but it looks like if we keep on following the definitions of these global AWS functions, eventually we can avoid global state and fork problems, while still using public things.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
55f8b1a
to
9e2e093
Compare
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
This allows us to replace some very hacky and not correct string concatentation in `HttpBinaryCacheStore`. It will especially be useful with NixOS#13752, when today's hacks started to cause problems in practice, not just theory. Also make `fixGitURL` returned a `ParsedURL`.
9e2e093
to
6cc049a
Compare
This commit replaces the AWS C++ SDK with a lighter curl-based approach for S3 binary cache operations. - Removed dependency on the heavy aws-cpp-sdk-s3 and aws-cpp-sdk-transfer - Added lightweight aws-crt-cpp for credential resolution only - Leverages curl's native AWS SigV4 authentication (requires curl >= 7.75.0) - S3BinaryCacheStore now delegates to HttpBinaryCacheStore - Function s3ToHttpsUrl converts ParsedS3URL to ParsedURL - Multipart uploads are no longer supported (may be reimplemented later) - Build now requires curl >= 7.75.0 for AWS SigV4 support Fixes: NixOS#13084, NixOS#12671, NixOS#11748, NixOS#12403, NixOS#5947
6cc049a
to
e81af42
Compare
@@ -1,3 +1,5 @@ | |||
#pragma once |
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.
#pragma once | |
#pragma once | |
///@file |
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.
And we can land this one write away, just to chip things off to shrink the diff
if not aws_crt_cpp.found() | ||
# Fallback: try pkg-config with different name | ||
aws_crt_cpp = dependency('libaws-crt-cpp', required : false) | ||
endif | ||
if not aws_crt_cpp.found() | ||
# Fallback: try to find library manually | ||
aws_crt_cpp = cxx.find_library('aws-crt-cpp', required : false) | ||
endif |
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.
is it in practice fucked up like this? I would hope not! :)
Motivation
#13084
Context
Early days, just making a draft for visibility and CI
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.