Unverified Commit e95468cb authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[ci] speed up files downloading for Windows CI (#3682)

* speed up files downloading for Windows CI

* run CI

* revert changing CI branch
parent 67cc4c9c
Write-Output "Installing OpenCL CPU platform" Write-Output "Installing OpenCL CPU platform"
$cache = "$env:PIPELINE_WORKSPACE\opencl_windows-amd_cpu-v3_0_130_135"
$installer = "AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe" $installer = "AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe"
if ($env:OPENCL_INSTALLER_FOUND -ne 'true') { Write-Output "Downloading OpenCL platform installer"
# Pipeline cache miss; download OpenCL platform installer executable into workspace cache $ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed
Write-Output "Downloading OpenCL platform installer" Invoke-WebRequest -OutFile "$installer" -Uri "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/$installer"
Invoke-WebRequest -OutFile "$installer" -Uri "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/$installer"
Write-Output "Caching OpenCL platform installer" if (Test-Path "$installer") {
New-Item $cache -ItemType Directory | Out-Null Write-Output "Successfully downloaded OpenCL platform installer"
Move-Item -Path "$installer" -Destination "$cache\$installer" | Out-Null } else {
Write-Output "Unable to download OpenCL platform installer"
if (Test-Path "$cache\$installer") { Write-Output "Setting EXIT"
Write-Output "Successfully downloaded OpenCL platform installer" $host.SetShouldExit(-1)
} else { Exit -1
Write-Output "Unable to download OpenCL platform installer"
Write-Output "Setting EXIT"
$host.SetShouldExit(-1)
Exit -1
}
} }
# Install OpenCL platform from installer executable expected in workspace cache # Install OpenCL platform from installer executable
Write-Output "Running OpenCL installer" Write-Output "Running OpenCL installer"
Invoke-Command -ScriptBlock {Start-Process "$cache\$installer" -ArgumentList '/S /V"/quiet /norestart /passive /log opencl.log"' -Wait} Invoke-Command -ScriptBlock { Start-Process "$installer" -ArgumentList '/S /V"/quiet /norestart /passive /log opencl.log"' -Wait }
$property = Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors $property = Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors
if ($property -eq $null) { if ($property -eq $null) {
......
...@@ -5,6 +5,7 @@ function Download-File-With-Retries { ...@@ -5,6 +5,7 @@ function Download-File-With-Retries {
[string]$url, [string]$url,
[string]$destfile [string]$destfile
) )
$ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed
do { do {
Write-Output "Downloading ${url}" Write-Output "Downloading ${url}"
sleep 5; sleep 5;
......
...@@ -40,6 +40,7 @@ elseif ($env:TASK -eq "sdist") { ...@@ -40,6 +40,7 @@ elseif ($env:TASK -eq "sdist") {
cd dist; pip install @(Get-ChildItem *.gz) -v ; Check-Output $? cd dist; pip install @(Get-ChildItem *.gz) -v ; Check-Output $?
$env:JAVA_HOME = $env:JAVA_HOME_8_X64 # there is pre-installed Zulu OpenJDK-8 somewhere $env:JAVA_HOME = $env:JAVA_HOME_8_X64 # there is pre-installed Zulu OpenJDK-8 somewhere
$ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed
Invoke-WebRequest -Uri "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/swigwin-3.0.12.zip" -OutFile $env:BUILD_SOURCESDIRECTORY/swig/swigwin.zip -UserAgent "NativeHost" Invoke-WebRequest -Uri "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/swigwin-3.0.12.zip" -OutFile $env:BUILD_SOURCESDIRECTORY/swig/swigwin.zip -UserAgent "NativeHost"
Add-Type -AssemblyName System.IO.Compression.FileSystem Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:BUILD_SOURCESDIRECTORY/swig/swigwin.zip", "$env:BUILD_SOURCESDIRECTORY/swig") [System.IO.Compression.ZipFile]::ExtractToDirectory("$env:BUILD_SOURCESDIRECTORY/swig/swigwin.zip", "$env:BUILD_SOURCESDIRECTORY/swig")
......
...@@ -124,13 +124,6 @@ jobs: ...@@ -124,13 +124,6 @@ jobs:
Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
Write-Host "##vso[task.setvariable variable=AZURE]true" Write-Host "##vso[task.setvariable variable=AZURE]true"
displayName: 'Set Variables' displayName: 'Set Variables'
- task: Cache@2
inputs:
key: '"opencl.windows" | "amd.cpu" | "v3.0.130.135" | "1"'
path: $(Pipeline.Workspace)/opencl_windows-amd_cpu-v3_0_130_135
cacheHitVar: OPENCL_INSTALLER_FOUND
condition: eq(variables['TASK'], 'bdist')
displayName: 'Cache OpenCL Installer'
- script: | - script: |
cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install_opencl.ps1" cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install_opencl.ps1"
condition: eq(variables['TASK'], 'bdist') condition: eq(variables['TASK'], 'bdist')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment