Add x-azcopy and x-azcopy-sas binary caching sources#1738
Add x-azcopy and x-azcopy-sas binary caching sources#1738vicroms merged 26 commits intomicrosoft:mainfrom
x-azcopy and x-azcopy-sas binary caching sources#1738Conversation
x-azcopy providerx-azcopy and x-azcopy-sas binary caching sources
b7f6328 to
1065502
Compare
|
Back to draft while the |
a8e6ee3 to
3e09823
Compare
Co-authored-by: Billy O'Neal <[email protected]>
b300bb9 to
ea49e5c
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds two new binary caching sources for vcpkg that use Azure Storage blob containers via the azcopy executable. The implementation provides both SAS token-based authentication and Microsoft Entra ID authentication options.
Key changes:
- Introduces
x-azcopyandx-azcopy-sasbinary cache providers as alternatives to existing Azure blob storage options - Implements batch downloading using
azcopy copy --include-pathfor improved performance compared to individual file downloads - Adds comprehensive test coverage for both new provider types with various configuration scenarios
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vcpkg/metrics.cpp | Adds metrics tracking for the two new azcopy binary cache providers |
| src/vcpkg/binarycaching.cpp | Core implementation of AzCopy providers with batch download/upload logic and configuration parsing |
| src/vcpkg-test/configparser.cpp | Comprehensive unit tests for both azcopy provider variants with various configuration scenarios |
| locales/messages.json | Adds localized message for Azure Storage restoration feedback |
| include/vcpkg/metrics.h | Defines new metric types for tracking azcopy provider usage |
| include/vcpkg/binarycaching.h | Declares AzCopyUrl structure and adds provider state fields |
| include/vcpkg/base/message-data.inc.h | Declares the new Azure Storage restoration message |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
27ab43d to
16a9aaf
Compare
| struct AzCopyStorageProvider : ZipReadBinaryProvider | ||
| { | ||
| AzCopyStorageProvider( | ||
| ZipTool zip, const Filesystem& fs, const Path& buildtrees, AzCopyUrl&& az_url, const Path& tool) |
There was a problem hiding this comment.
Copy/move antipattern on ZipTool seems bad to me but the other providers are already doing it so no change requested.
There was a problem hiding this comment.
I think this would be greatly improved by something like @autoantwort's #911 but out of the scope of this PR.
Co-authored-by: Billy O'Neal <[email protected]>
Adds two new binary sources that interact with Azure Storage blob containers using the
azcopyexecutable.x-azcopy-sas,<url>,<sas>[,<rw>]: Intended as a drop-in replacement forazblob, it uses SAS tokens for authentication.x-azcopy,<url>[,<rw>]: Intended for non-SAS authentication methods like Microsoft Entra ID; requires preloading credentials or/and theAZCOPY_AUTO_LOGIN_TYPE.Internally, we use
azcopy copy --from-to BlobLocal {destination} --include-path {files}argument to download multiple files in a singleazcopyjob, this improves performance and brings it more in line withazblob, that uses a singlecurlinvocation to download a batch of files. Upload happens one file at a time in the background.Small test
Large test
Related:
x-azcopyandx-azcopy-sasbinary caching sources MicrosoftDocs/vcpkg-docs#511)