Skip to content

GH-49676: [Python][Packaging] Avoid rebuilding all base images by not pulling base images on docker build#49678

Draft
raulcd wants to merge 14 commits intoapache:mainfrom
raulcd:GH-49676
Draft

GH-49676: [Python][Packaging] Avoid rebuilding all base images by not pulling base images on docker build#49678
raulcd wants to merge 14 commits intoapache:mainfrom
raulcd:GH-49676

Conversation

@raulcd
Copy link
Copy Markdown
Member

@raulcd raulcd commented Apr 7, 2026

TBD

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

This PR includes breaking changes to public APIs. (If there are any breaking changes to public APIs, please explain which changes are breaking. If not, you can remove this.)

This PR contains a "Critical Fix". (If the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld), please provide explanation. If not, you can remove this.)

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 7, 2026

@github-actions crossbow submit wheel-windows-*

@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

⚠️ GitHub issue #49676 has been automatically assigned in GitHub to PR creator.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Revision: 663e4a6

Submitted crossbow builds: ursacomputing/crossbow @ actions-2d3c582858

Task Status
wheel-windows-cp310-cp310-amd64 GitHub Actions
wheel-windows-cp311-cp311-amd64 GitHub Actions
wheel-windows-cp312-cp312-amd64 GitHub Actions
wheel-windows-cp313-cp313-amd64 GitHub Actions
wheel-windows-cp313-cp313t-amd64 GitHub Actions
wheel-windows-cp314-cp314-amd64 GitHub Actions
wheel-windows-cp314-cp314t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 7, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Revision: a0edd40

Submitted crossbow builds: ursacomputing/crossbow @ actions-a1756da700

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 7, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Revision: b45c287

Submitted crossbow builds: ursacomputing/crossbow @ actions-946cdff5a8

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 7, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Revision: 4b9fd9c

Submitted crossbow builds: ursacomputing/crossbow @ actions-e9e5587b8a

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 7, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Revision: 5479a8d

Submitted crossbow builds: ursacomputing/crossbow @ actions-310307e9a4

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@kou any idea what might be the issue here?

@kou
Copy link
Copy Markdown
Member

kou commented Apr 8, 2026

I'll take a look at this in a few hours!

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Revision: a7c0613

Submitted crossbow builds: ursacomputing/crossbow @ actions-66876a4e34

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@kou
Copy link
Copy Markdown
Member

kou commented Apr 8, 2026

Sorry. I couldn't take a look at this in a few hours... I'll take a look at this in 24 hours...

@rok
Copy link
Copy Markdown
Member

rok commented Apr 8, 2026

As per 🤖 we should implement the change below: "this adds a step that makes the job explicitly check for the docker service, start it if needed, and wait until docker version succeeds before any archery docker pull/build/run commands execute. So this turns an intermittent windows-2022 runner issue into a handled setup step, which should reduce spurious CI failures."

--- a/dev/tasks/python-wheels/github.windows.yml
+++ b/dev/tasks/python-wheels/github.windows.yml
@@ -43,6 +43,32 @@
      {{ macros.github_checkout_arrow()|indent }}
      {{ macros.github_login_ghcr()|indent }}
      {{ macros.github_install_archery()|indent }}
+
+      - name: Wait for Docker
+        shell: pwsh
+        run: |
+          $dockerService = Get-Service -Name docker -ErrorAction SilentlyContinue
+          if ($null -eq $dockerService) {
+            Write-Error "Docker service not found."
+            exit 1
+          }
+
+          if ($dockerService.Status -ne "Running") {
+            Write-Host "Starting Docker service..."
+            Start-Service -Name docker
+          }
+
+          for ($i = 1; $i -le 60; $i++) {
+            docker version *> $null
+            if ($LASTEXITCODE -eq 0) {
+              Write-Host "Docker is ready."
+              exit 0
+            }
+            Start-Sleep -Seconds 2
+          }
+
+          Write-Error "Docker failed to become ready."
+          exit 1

      - name: Prepare
        shell: bash

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

I think that could solve the "intermittent failure" around docker being unable but the big issue is not that one.

The real problem is when docker is running at building the flight dependencies from vcpkg step. If I isolate the different vcpkg features being built the image builds fine until the flight feature step. Flight pulls grpc/abseil/protobuf. The hcsshim::ImportLayer failed in Win32 error seems to hint that the docker image layer is too big to be added to the Windows image. This checks with the following upstream issue:
microsoft/vcpkg#43603
We've always had problems building gRPC on Windows taking 2 hours but never had issues with docker being unable to "commit" the image layer until now.

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

Docker seemed to have been upgraded on the runner images from 27.x/28.x to 29.1 which might be the issue:

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Revision: 14c89a4

Submitted crossbow builds: ursacomputing/crossbow @ actions-d3af6272a6

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Revision: 7f24ad8

Submitted crossbow builds: ursacomputing/crossbow @ actions-574c6b6bb8

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Revision: 6bd3713

Submitted crossbow builds: ursacomputing/crossbow @ actions-15fa7be7ef

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@kou
Copy link
Copy Markdown
Member

kou commented Apr 8, 2026

Hmm. It seems that we need to patch vcpkg to remove unconditional /Z7:

diff --git a/ci/vcpkg/vcpkg.patch b/ci/vcpkg/vcpkg.patch
index a4c8d52097..2627f8c562 100644
--- a/ci/vcpkg/vcpkg.patch
+++ b/ci/vcpkg/vcpkg.patch
@@ -1,3 +1,18 @@
+diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake
+index 3cc90cc886..36af495687 100644
+--- a/scripts/toolchains/windows.cmake
++++ b/scripts/toolchains/windows.cmake
+@@ -86,8 +86,8 @@ if(NOT _VCPKG_WINDOWS_TOOLCHAIN)
+
+     set(CMAKE_CXX_FLAGS_DEBUG "${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "")
+     set(CMAKE_C_FLAGS_DEBUG "${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "")
+-    set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "")
+-    set(CMAKE_C_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "")
++    set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "")
++    set(CMAKE_C_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "")
+
+     string(APPEND CMAKE_STATIC_LINKER_FLAGS_RELEASE_INIT " /nologo ")
+     set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_RELEASE}" CACHE STRING "")
 diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake
 index 60fd5b587a..c8dc021af8 100644
 --- a/scripts/cmake/vcpkg_execute_build_process.cmake

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@kou that's a really good one. Let me push a commit to try it

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Revision: 79da88c

Submitted crossbow builds: ursacomputing/crossbow @ actions-8c0fd92f01

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Revision: 96931be

Submitted crossbow builds: ursacomputing/crossbow @ actions-5806a993b9

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Revision: a033258

Submitted crossbow builds: ursacomputing/crossbow @ actions-8d2d071202

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@github-actions crossbow submit wheel-windows-cp313-cp313t-amd64

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Revision: 14f1b27

Submitted crossbow builds: ursacomputing/crossbow @ actions-733eebe387

Task Status
wheel-windows-cp313-cp313t-amd64 GitHub Actions

@raulcd
Copy link
Copy Markdown
Member Author

raulcd commented Apr 8, 2026

@kou @amoeba both this PR and #49693 seem to successfully fix the wheels. I don't think the fixes are exclusive and we could push both on a single PR? I'll try to push this PR tomorrow and would like to merge to unblock the release. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting committer review Awaiting committer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants