This is an automated email from the ASF dual-hosted git repository. gaurava pushed a commit to branch docker-local-ci in repository https://gitbox.apache.org/repos/asf/hadoop.git
commit 2d383fb9dc54a7aef2b94b71210aba73b6e206d1 Author: Gautham Banasandra <gautham.bangal...@gmail.com> AuthorDate: Sun Jul 13 20:33:36 2025 +0530 Use Docker for local CI --- dev-support/docker/Dockerfile_windows_10 | 5 ++- dev-support/run-local-ci.ps1 | 68 +++++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/dev-support/docker/Dockerfile_windows_10 b/dev-support/docker/Dockerfile_windows_10 index 0da9e4ce0fc..c6d9c534a6b 100644 --- a/dev-support/docker/Dockerfile_windows_10 +++ b/dev-support/docker/Dockerfile_windows_10 @@ -144,7 +144,7 @@ RUN setx PATH "%PATH%;%JAVA_HOME%\bin" RUN setx PATH "%PATH%;C:\Maven\apache-maven-3.8.8\bin" RUN setx PATH "%PATH%;C:\CMake\cmake-3.19.0-win64-x64\bin" RUN setx PATH "%PATH%;C:\ZStd" -RUN setx PATH "%PATH%;C:\Program Files\Git\usr\bin" +RUN setx PATH "%PATH%;C:\Git\bin;C:\Git\cmd;C:\Git\usr\bin" RUN setx PATH "%PATH%;C:\Python" # The mvnsite module runs a bash script and somewhere down in the invocation, it resorts to call @@ -158,5 +158,8 @@ RUN setx classpath "" RUN git config --global core.autocrlf true RUN git config --global core.longpaths true +# Uninstall Git installed from Program Files via Chocolatey +RUN choco uninstall -y git + # Define the entry point for the docker container. ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat", "&&", "cmd.exe"] diff --git a/dev-support/run-local-ci.ps1 b/dev-support/run-local-ci.ps1 index 29d736dcb83..4855300330a 100644 --- a/dev-support/run-local-ci.ps1 +++ b/dev-support/run-local-ci.ps1 @@ -43,7 +43,7 @@ param ( [Parameter(Mandatory = $False)] [string] $YetusRepoBranch = 'rel/0.14.0', - + # The source dir [Parameter(Mandatory = $False)] [string] @@ -62,7 +62,17 @@ param ( # Bash [Parameter(Mandatory = $False)] [string] - $BashExePath = 'C:\PROGRA~1\Git\bin\bash.exe' + $BashExePath = 'C:\PROGRA~1\Git\bin\bash.exe', + + # The path to the Maven repository + [Parameter(Mandatory = $False)] + [string] + $MavenRepoPath = "$Env:USERPROFILE\.m2", + + # Use Docker for the build + [Parameter(Mandatory = $False)] + [switch] + $UseDocker ) function Get-LinuxPath { @@ -70,7 +80,7 @@ function Get-LinuxPath { [string] $WindowsPath ) - + # Convert to Linux path $linuxPath = $windowsPath -replace '\\', '/' @@ -92,9 +102,6 @@ $Env:DOCKER_BUILDKIT = 0 $Env:IS_OPTIONAL = 0 $Env:IS_NIGHTLY_BUILD = 1 $Env:IS_WINDOWS = 1 -$Env:BASH_EXECUTABLE = $BashExePath -$Env:VCPKG_INSTALLED_PACKAGES = 'D:\projects\github\microsoft\vcpkg\installed\x64-windows' -$Env:CMAKE_TOOLCHAIN_FILE = 'D:\projects\github\microsoft\vcpkg\scripts\buildsystems\vcpkg.cmake' $yetusCheckoutDir = Join-Path ` -Path $Workspace ` @@ -107,14 +114,57 @@ if (-not (Test-Path -Path $yetusCheckoutDir)) { } if (-not (Test-Path -Path $SourceDir)) { - Set-Location -Path $Workspace + Set-Location -Path $Workspace git clone $HadoopRepoUrl Set-Location -Path $SourceDir git checkout $HadoopRepoBranch } -Set-Location -Path $Workspace +if ($UseDocker) { + if (-not (Test-Path -Path $PatchDir)) { + mkdir $PatchDir + } + + docker build --label org.apache.yetus="" ` + --label org.apache.yetus.testpatch.project=hadoop ` + --tag hadoop-windows-10-builder ` + -f $DockerFile $SourceDir\dev-support\docker + + Write-Host 'Running the Docker container to execute the CI build...' + + # Log all variables used in the docker run command + Write-Host "Docker run variables:" + Write-Host " Workspace: $Workspace" + Write-Host " MavenRepoPath: $MavenRepoPath" + Write-Host " Env:YETUS: $($Env:YETUS)" + Write-Host " HadoopRepoBranch: $HadoopRepoBranch" + Write-Host " Env:IS_NIGHTLY_BUILD: $($Env:IS_NIGHTLY_BUILD)" + Write-Host " Env:IS_WINDOWS: $($Env:IS_WINDOWS)" + Write-Host " Env:USERPROFILE: $($Env:USERPROFILE)" + + docker run --rm -v $Workspace\out:C:\out ` + -v $Workspace\hadoop:C:\src ` + -v $Workspace\yetus:C:\yetus ` + -v $MavenRepoPath`:$Env:USERPROFILE\.m2 ` + -e WORKSPACE=/c -e YETUS=$Env:YETUS ` + -e GIT_COMMIT=HEAD ` + -e GIT_BRANCH=$HadoopRepoBranch ` + -e IS_OPTIONAL=0 -e SOURCEDIR=/c/hadoop -e PATCHDIR=/c/out ` + -e IS_NIGHTLY_BUILD=$Env:IS_NIGHTLY_BUILD -e IS_WINDOWS=$Env:IS_WINDOWS ` + -e BASH_EXECUTABLE=/c/Git/bin/bash.exe ` + -e VCPKG_INSTALLED_PACKAGES=/c/vcpkg/installed/x64-windows ` + -e CMAKE_TOOLCHAIN_FILE=/c/vcpkg/scripts/buildsystems/vcpkg.cmake ` + hadoop-windows-10-builder '/c' 'xcopy' '/s' '/e' '/h' '/y' '/i' '/q' 'C:\src' 'C:\hadoop' '&&' 'C:\Git\bin\bash.exe' '-c' '"echo hello"' # '"/c/src/dev-support/jenkins.sh" "run_ci"' +} +else { + $Env:BASH_EXECUTABLE = $BashExePath + $Env:VCPKG_INSTALLED_PACKAGES = 'D:\projects\github\microsoft\vcpkg\installed\x64-windows' + $Env:CMAKE_TOOLCHAIN_FILE = 'D:\projects\github\microsoft\vcpkg\scripts\buildsystems\vcpkg.cmake' + + Set-Location -Path $Workspace + + . $BashExePath -c "$(Get-LinuxPath -WindowsPath $SourceDir\dev-support\jenkins.sh) run_ci" +} -. $BashExePath -c "$(Get-LinuxPath -WindowsPath $SourceDir\dev-support\jenkins.sh) run_ci" Set-Location -Path $startLocation \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org