Skip to content

Commit 1648001

Browse files
committed
[invalid] Test uploads with azcopy
1 parent 3e5b8de commit 1648001

File tree

11 files changed

+81
-5
lines changed

11 files changed

+81
-5
lines changed

scripts/azure-pipelines/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ parameters:
55
- name: vcpkgToolSha
66
displayName: 'Custom SHA of vcpkg-tool to use rather than bootstrap'
77
type: string
8-
default: 'use default'
8+
default: 'refs/pull/1679/merge'
99
- name: tripletPattern
1010
displayName: 'Enable triplets which contain this substring'
1111
type: string

scripts/azure-pipelines/bootstrap-from-source.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/sh
22
set -e
33

4-
git clone https://github.com/microsoft/vcpkg-tool vcpkg-tool
5-
git -C vcpkg-tool switch -d $1
4+
git clone --depth 1 https://github.com/microsoft/vcpkg-tool vcpkg-tool
5+
git -C vcpkg-tool fetch --depth 1 origin $1
6+
git -C vcpkg-tool switch -d FETCH_HEAD
67
rm -rf build.x64.release
78
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF -DVCPKG_WARNINGS_AS_ERRORS=OFF -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=OFF -B build.x64.release -S vcpkg-tool
89
ninja -C build.x64.release

scripts/azure-pipelines/test-modified-ports.ps1

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,53 @@ if ($Triplet -eq 'x64-windows-release') {
128128
$tripletArg = "--triplet=$Triplet"
129129
}
130130

131+
# Test uploads with azcopy
132+
# Using portable binaries from
133+
# https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10?tabs=dnf#download-the-azcopy-portable-binary
134+
if ($Triplet -eq 'x64-windows')
135+
{
136+
$local_name = 'azcopy_windows_amd64_10.29.0'
137+
& $vcpkgExe x-download "$local_name.zip" "--url=https://aka.ms/downloadazcopy-v10-windows" "--sha512=fa2db4d722467eb0daebeddab20625198bbe7cd3102ac0fcec42a1b9f5f633e3d56cf4a02b2396c6ff3459eb291f5bfd5865cc97d4d731b6d05d0db1683c8a57" @cachingArgs
138+
Expand-Archive -Path "$local_name.zip" -Destination azcopy
139+
$env:PATH += ";$PWD\azcopy\$local_name"
140+
}
141+
elseif ($Triplet -eq 'x64-linux')
142+
{
143+
$local_name = 'azcopy_linux_amd64_10.29.0'
144+
& $vcpkgExe x-download "$local_name.tgz" "--url=https://aka.ms/downloadazcopy-v10-linux" "--sha512=c5f21fdf57066f9b4c17deb0b3649cb901863d8c6619f1a010abfde80ff7fdadf7ea9483bfa3820ae833e7953558294215b3a413b5efff75967fb368dcb1426a" @cachingArgs
145+
& tar xvzf "$local_name.tgz"
146+
$env:PATH += ":$PWD/$local_name"
147+
}
148+
$env:AZCOPY_LOG_LOCATION = Join-Path $ArtifactStagingDirectory 'azcopy-logs'
149+
$env:AZCOPY_JOB_PLAN_LOCATION = Join-Path $ArtifactStagingDirectory 'azcopy-plans'
150+
& azcopy --version
151+
$lastLastExitCode = $LASTEXITCODE
152+
if ($lastLastExitCode -ne 0)
153+
{
154+
Write-Error 'Cannot run azcopy.'
155+
exit $lastLastExitCode
156+
}
157+
# Build large artifacts with unique ABI hashes
158+
Get-Date | Out-File "scripts/manual-tests/azcopy/test-upload-artifacts/mutable"
159+
# 3 GB < single max write (5 GB) < 6 GB, in files of 1.5 GB random data
160+
$data = New-Object byte[] 1.5GB
161+
(New-Object System.Random).NextBytes($data)
162+
[System.IO.File]::WriteAllBytes("scripts/manual-tests/azcopy/core-1.dat", $data)
163+
(New-Object System.Random).NextBytes($data)
164+
[System.IO.File]::WriteAllBytes("scripts/manual-tests/azcopy/core-2.dat", $data)
165+
(New-Object System.Random).NextBytes($data)
166+
[System.IO.File]::WriteAllBytes("scripts/manual-tests/azcopy/large-1.dat", $data)
167+
(New-Object System.Random).NextBytes($data)
168+
[System.IO.File]::WriteAllBytes("scripts/manual-tests/azcopy/large-2.dat", $data)
169+
& $vcpkgExe x-test-features test-upload-artifacts --overlay-ports=scripts/manual-tests/azcopy $tripletArg $failureLogsArg @commonArgs @cachingArgs
170+
if ($LASTEXITCODE -eq 0)
171+
{
172+
Get-Item $env:VCPKG_DOWNLOADS
173+
& $vcpkgExe remove test-upload-artifacts $tripletArg @commonArgs @cachingArgs
174+
& $vcpkgExe install --only-binarycaching --downloads-root=$env:VCPKG_DOWNLOADS/disabled "test-upload-artifacts[*]" --overlay-ports=scripts/manual-tests/azcopy $tripletArg @commonArgs @cachingArgs
175+
}
176+
exit $LASTEXITCODE
177+
131178
$failureLogs = Join-Path $ArtifactStagingDirectory 'failure-logs'
132179
$failureLogsArg = "--failure-logs=$failureLogs"
133180
$knownFailuresFromArgs = @()

scripts/azure-pipelines/windows/bootstrap-from-source.cmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86
2-
git clone https://github.com/microsoft/vcpkg-tool vcpkg-tool
3-
git -C vcpkg-tool switch -d %1
2+
git clone --depth 1 https://github.com/microsoft/vcpkg-tool vcpkg-tool
3+
git -C vcpkg-tool fetch --depth 1 origin %1
4+
git -C vcpkg-tool switch -d FETCH_HEAD
45
rmdir /s /q build.x86.release > nul 2> nul
56
cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF -DVCPKG_WARNINGS_AS_ERRORS=OFF -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=OFF -B build.x86.release -S vcpkg-tool
67
ninja.exe -C build.x86.release
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
2+
3+
file(INSTALL "${CURRENT_PORT_DIR}/mutable" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
4+
foreach(name IN LISTS FEATURES)
5+
file(GLOB blobs "${CURRENT_PORT_DIR}/../${name}-*.dat")
6+
file(INSTALL ${blobs} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
7+
endforeach()

0 commit comments

Comments
 (0)