diff --git a/tools/internal_ci/helper_scripts/install_python38.ps1 b/tools/internal_ci/helper_scripts/install_python38.ps1 deleted file mode 100644 index e47f83b012ee84fa28a96eb0c3dceeddcfbfe12d..0000000000000000000000000000000000000000 --- a/tools/internal_ci/helper_scripts/install_python38.ps1 +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env powershell -# Install Python 3.8 for x64 and x86 in order to build wheels on Windows. - -Set-StrictMode -Version 2 - -# Avoid "Could not create SSL/TLS secure channel" -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - -function Install-Python { - Param( - [string]$PythonVersion, - [string]$PythonInstaller, - [string]$PythonInstallPath, - [string]$PythonInstallerHash - ) - $PythonInstallerUrl = "https://www.python.org/ftp/python/$PythonVersion/$PythonInstaller" - $PythonInstallerPath = "C:\tools\$PythonInstaller" - - # Downloads installer - Write-Host "Downloading the Python installer: $PythonInstallerUrl => $PythonInstallerPath" - Invoke-WebRequest -Uri $PythonInstallerUrl -OutFile $PythonInstallerPath - - # Validates checksum - $HashFromDownload = Get-FileHash -Path $PythonInstallerPath -Algorithm MD5 - if ($HashFromDownload.Hash -ne $PythonInstallerHash) { - throw "Invalid Python installer: failed checksum!" - } - Write-Host "Python installer $PythonInstallerPath validated." - - # Installs Python - & $PythonInstallerPath /passive InstallAllUsers=1 PrependPath=1 Include_test=0 TargetDir=$PythonInstallPath - if (-Not $?) { - throw "The Python installation exited with error!" - } - - # Validates Python binary - # NOTE(lidiz) Even if the install command finishes in the script, that - # doesn't mean the Python installation is finished. If using "ps" to check - # for running processes, you might see ongoing installers at this point. - # So, we needs this "hack" to reliably validate that the Python binary is - # functioning properly. - $ValidationStartTime = Get-Date - $EarlyExitDDL = $ValidationStartTime.addminutes(5) - $PythonBinary = "$PythonInstallPath\python.exe" - While ($True) { - $CurrentTime = Get-Date - if ($CurrentTime -ge $EarlyExitDDL) { - throw "Invalid Python installation! Timeout!" - } - & $PythonBinary -c 'print(42)' - if ($?) { - Write-Host "Python binary works properly." - break - } - Start-Sleep -Seconds 1 - } - - # Installs pip - & $PythonBinary -m ensurepip --user - - Write-Host "Python $PythonVersion installed by $PythonInstaller at $PythonInstallPath." -} - -$Python38x86Config = @{ - PythonVersion = "3.8.0" - PythonInstaller = "python-3.8.0.exe" - PythonInstallPath = "C:\Python38_32bit" - PythonInstallerHash = "412a649d36626d33b8ca5593cf18318c" -} -Install-Python @Python38x86Config - -$Python38x64Config = @{ - PythonVersion = "3.8.0" - PythonInstaller = "python-3.8.0-amd64.exe" - PythonInstallPath = "C:\Python38" - PythonInstallerHash = "29ea87f24c32f5e924b7d63f8a08ee8d" -} -Install-Python @Python38x64Config diff --git a/tools/internal_ci/helper_scripts/prepare_build_windows.bat b/tools/internal_ci/helper_scripts/prepare_build_windows.bat index bfd812345abb9271ea43ed60b08b686292ba3e5f..d129332c3b044eba29e361f7c973e0c3dbe12d72 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_windows.bat +++ b/tools/internal_ci/helper_scripts/prepare_build_windows.bat @@ -35,9 +35,6 @@ python -m pip install google-api-python-client powershell -File src\csharp\install_dotnet_sdk.ps1 set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH% -@rem Install Python 3.8.0 -powershell -File tools\internal_ci\helper_scripts\install_python38.ps1 - @rem Newest version of Go is required to be able to build boringssl with cmake @rem TODO(jtattermusch): try to eliminate the dependency on Go choco install golang -y --version 1.13.1 --limit-output diff --git a/tools/internal_ci/windows/grpc_build_artifacts.bat b/tools/internal_ci/windows/grpc_build_artifacts.bat index be47fe670b6ff68bccee1f194318930637d5b792..190e848b267170a9061a4ec3fdfdb47523ccf960 100644 --- a/tools/internal_ci/windows/grpc_build_artifacts.bat +++ b/tools/internal_ci/windows/grpc_build_artifacts.bat @@ -12,6 +12,13 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. +@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder +@rem TODO(jtattermusch): get rid of this hack +rename C:\Python27_32bit Python27_32bits +rename C:\Python35_32bit Python35_32bits +rename C:\Python36_32bit Python36_32bits +rename C:\Python37_32bit Python37_32bits + @rem Boringssl build no longer supports yasm choco uninstall yasm -y --limit-output choco install nasm -y --limit-output diff --git a/tools/internal_ci/windows/grpc_build_packages.bat b/tools/internal_ci/windows/grpc_build_packages.bat index 19a805adfc2f7acc825aced04b7b9304a70ba376..3cf90af39e681b3a7a30492528023f17a25d7800 100644 --- a/tools/internal_ci/windows/grpc_build_packages.bat +++ b/tools/internal_ci/windows/grpc_build_packages.bat @@ -12,6 +12,12 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. +@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder +@rem TODO(jtattermusch): get rid of this hack +rename C:\Python27_32bit Python27_32bits +rename C:\Python35_32bit Python35_32bits +rename C:\Python36_32bit Python36_32bits + @rem enter repo root cd /d %~dp0\..\..\.. diff --git a/tools/internal_ci/windows/grpc_distribtests.bat b/tools/internal_ci/windows/grpc_distribtests.bat index 72d7076ec90781f10256b3779e3997cfc569e196..effeee649b1f8079646774173d00e90ff0059ba6 100644 --- a/tools/internal_ci/windows/grpc_distribtests.bat +++ b/tools/internal_ci/windows/grpc_distribtests.bat @@ -12,6 +12,12 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. +@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder +@rem TODO(jtattermusch): get rid of this hack +rename C:\Python27_32bit Python27_32bits +rename C:\Python35_32bit Python35_32bits +rename C:\Python36_32bit Python36_32bits + @rem enter repo root cd /d %~dp0\..\..\.. diff --git a/tools/internal_ci/windows/grpc_distribtests_standalone.bat b/tools/internal_ci/windows/grpc_distribtests_standalone.bat index 80334674144a22f1be09629f760721270582e50e..b33b99c71e88e11b2abd32308fd96dba8ffe47d4 100644 --- a/tools/internal_ci/windows/grpc_distribtests_standalone.bat +++ b/tools/internal_ci/windows/grpc_distribtests_standalone.bat @@ -12,6 +12,12 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. +@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder +@rem TODO(jtattermusch): get rid of this hack +rename C:\Python27_32bit Python27_32bits +rename C:\Python35_32bit Python35_32bits +rename C:\Python36_32bit Python36_32bits + @rem enter repo root cd /d %~dp0\..\..\.. diff --git a/tools/run_tests/artifacts/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py index c1288cd0914a6916cbbef2bef2035d5528d53390..0709db94696a00d1dd33856c72854f8d6a69b00a 100644 --- a/tools/run_tests/artifacts/artifact_targets.py +++ b/tools/run_tests/artifacts/artifact_targets.py @@ -407,16 +407,18 @@ def targets(): PythonArtifact('macos', 'x64', 'python3.6'), PythonArtifact('macos', 'x64', 'python3.7'), PythonArtifact('macos', 'x64', 'python3.8'), - PythonArtifact('windows', 'x86', 'Python27_32bit'), - PythonArtifact('windows', 'x86', 'Python35_32bit'), - PythonArtifact('windows', 'x86', 'Python36_32bit'), - PythonArtifact('windows', 'x86', 'Python37_32bit'), - PythonArtifact('windows', 'x86', 'Python38_32bit'), + PythonArtifact('windows', 'x86', 'Python27_32bits'), + PythonArtifact('windows', 'x86', 'Python35_32bits'), + PythonArtifact('windows', 'x86', 'Python36_32bits'), + PythonArtifact('windows', 'x86', 'Python37_32bits'), + # TODO(https://github.com/grpc/grpc/issues/20615) Enable this artifact + # PythonArtifact('windows', 'x86', 'Python38_32bits'), PythonArtifact('windows', 'x64', 'Python27'), PythonArtifact('windows', 'x64', 'Python35'), PythonArtifact('windows', 'x64', 'Python36'), PythonArtifact('windows', 'x64', 'Python37'), - PythonArtifact('windows', 'x64', 'Python38'), + # TODO(https://github.com/grpc/grpc/issues/20615) Enable this artifact + # PythonArtifact('windows', 'x64', 'Python38'), RubyArtifact('linux', 'x64'), RubyArtifact('macos', 'x64'), PHPArtifact('linux', 'x64') diff --git a/tools/run_tests/artifacts/build_artifact_python.bat b/tools/run_tests/artifacts/build_artifact_python.bat index b1e0ee7d0fb9709e704048f5d02d02eb0fff8de2..88a331e2782e84e9c291e65dd67aee7d1195a1de 100644 --- a/tools/run_tests/artifacts/build_artifact_python.bat +++ b/tools/run_tests/artifacts/build_artifact_python.bat @@ -15,10 +15,10 @@ @rem set path to python & mingw compiler set PATH=C:\%1;C:\%1\scripts;C:\msys64\mingw%2\bin;C:\tools\msys64\mingw%2\bin;%PATH% -python -m pip install --upgrade six +pip install --upgrade six @rem some artifacts are broken for setuptools 38.5.0. See https://github.com/grpc/grpc/issues/14317 -python -m pip install --upgrade setuptools==38.2.4 -python -m pip install -rrequirements.txt +pip install --upgrade setuptools==38.2.4 +pip install -rrequirements.txt set GRPC_PYTHON_BUILD_WITH_CYTHON=1