Skip to content

Commit

Permalink
Use VS2019 for windows wheel builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Newton committed Jan 21, 2024
1 parent 3e3bb83 commit 8ea60d1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ DEVTOOLSET_VERSION=
VCPKG="53bef8994c541b6561884a8395ea35715ece75db" # 2024.01.12 Release

# This must be updated when we update
# ci/docker/python-wheel-windows-vs2017.dockerfile.
# ci/docker/python-wheel-windows-vs2019.dockerfile.
# This is a workaround for our CI problem that "archery docker build" doesn't
# use pulled built images in dev/tasks/python-wheels/github.windows.yml.
PYTHON_WHEEL_WINDOWS_IMAGE_REVISION=2023-08-02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
# contains choco and vs2017 preinstalled
FROM abrarov/msvc-2017:2.11.0
# contains choco and vs2019 preinstalled
FROM abrarov/msvc-2019:2.11.0

# Add unix tools to path
RUN setx path "%path%;C:\Program Files\Git\usr\bin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
# contains choco and vs2017 preinstalled
FROM abrarov/msvc-2017:2.11.0
# contains choco and vs2019 preinstalled
FROM abrarov/msvc-2019:2.11.0

# Install CMake and Ninja
ARG cmake=3.21.4
Expand Down Expand Up @@ -59,36 +59,28 @@ COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/
# arm machines it hits ARROW-15141 where we would need to fall back to 1.8.186
# but we cannot patch those portfiles since vcpkg-tool handles the checkout of
# previous versions => use bundled S3 build
RUN vcpkg install \
--clean-after-build \
--x-install-root=%VCPKG_ROOT%\installed \
--x-manifest-root=arrow/ci/vcpkg \
--x-feature=flight \
--x-feature=gcs \
--x-feature=json \
--x-feature=parquet \
--x-feature=s3
RUN vcpkg install --clean-after-build --x-install-root=%VCPKG_ROOT%\installed --x-manifest-root=arrow/ci/vcpkg --x-feature=flight --x-feature=gcs --x-feature=json --x-feature=parquet --x-feature=s3

# Remove previous installations of python from the base image
# NOTE: a more recent base image (tried with 2.12.1) comes with python 3.9.7
# and the msi installers are failing to remove pip and tcl/tk "products" making
# the subsequent choco python installation step failing for installing python
# version 3.9.* due to existing python version
RUN wmic product where "name like 'python%%'" call uninstall /nointeractive && \
rm -rf Python*
# # Remove previous installations of python from the base image
# # NOTE: a more recent base image (tried with 2.12.1) comes with python 3.9.7
# # and the msi installers are failing to remove pip and tcl/tk "products" making
# # the subsequent choco python installation step failing for installing python
# # version 3.9.* due to existing python version
# RUN wmic product where "name like 'python%%'" call uninstall /nointeractive && \
# rm -rf Python*

# Define the full version number otherwise choco falls back to patch number 0 (3.8 => 3.8.0)
ARG python=3.8
RUN (if "%python%"=="3.8" setx PYTHON_VERSION "3.8.10" && setx PATH "%PATH%;C:\Python38;C:\Python38\Scripts") & \
(if "%python%"=="3.9" setx PYTHON_VERSION "3.9.13" && setx PATH "%PATH%;C:\Python39;C:\Python39\Scripts") & \
(if "%python%"=="3.10" setx PYTHON_VERSION "3.10.11" && setx PATH "%PATH%;C:\Python310;C:\Python310\Scripts") & \
(if "%python%"=="3.11" setx PYTHON_VERSION "3.11.5" && setx PATH "%PATH%;C:\Python311;C:\Python311\Scripts") & \
(if "%python%"=="3.12" setx PYTHON_VERSION "3.12.0" && setx PATH "%PATH%;C:\Python312;C:\Python312\Scripts")
RUN choco install -r -y --no-progress python --version=%PYTHON_VERSION%
RUN python -m pip install -U pip setuptools
# # Define the full version number otherwise choco falls back to patch number 0 (3.8 => 3.8.0)
# ARG python=3.8
# RUN (if "%python%"=="3.8" setx PYTHON_VERSION "3.8.10" && setx PATH "%PATH%;C:\Python38;C:\Python38\Scripts") & \
# (if "%python%"=="3.9" setx PYTHON_VERSION "3.9.13" && setx PATH "%PATH%;C:\Python39;C:\Python39\Scripts") & \
# (if "%python%"=="3.10" setx PYTHON_VERSION "3.10.11" && setx PATH "%PATH%;C:\Python310;C:\Python310\Scripts") & \
# (if "%python%"=="3.11" setx PYTHON_VERSION "3.11.5" && setx PATH "%PATH%;C:\Python311;C:\Python311\Scripts") & \
# (if "%python%"=="3.12" setx PYTHON_VERSION "3.12.0" && setx PATH "%PATH%;C:\Python312;C:\Python312\Scripts")
# RUN choco install -r -y --no-progress python --version=%PYTHON_VERSION%
# RUN python -m pip install -U pip setuptools

COPY python/requirements-wheel-build.txt arrow/python/
RUN python -m pip install -r arrow/python/requirements-wheel-build.txt
# COPY python/requirements-wheel-build.txt arrow/python/
# RUN python -m pip install -r arrow/python/requirements-wheel-build.txt

# ENV CLCACHE_DIR="C:\clcache"
# ENV CLCACHE_COMPRESS=1
Expand Down
12 changes: 6 additions & 6 deletions dev/tasks/python-wheels/github.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# this is a private repository at the moment (mostly because of licensing
# consideration of windows images with visual studio), but anyone can
# recreate the image by manually building it via:
# `archery build python-wheel-windows-vs2017`
# `archery build python-wheel-windows-vs2019`
# note that we don't run docker build since there wouldn't be a cache hit
# and rebuilding the dependencies takes a fair amount of time
REPO: ghcr.io/ursacomputing/arrow
Expand All @@ -46,17 +46,17 @@ jobs:
run: |
cd arrow
@rem We want to use only
@rem archery docker run -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-windows-vs2017
@rem archery docker run -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-windows-vs2019
@rem but it doesn't use pulled caches.
@rem It always build an image from scratch.
@rem We can remove this workaround once we find a way to use
@rem pulled caches when build an image.
echo on
archery docker pull --no-ignore-pull-failures python-wheel-windows-vs2017
archery docker pull --no-ignore-pull-failures python-wheel-windows-vs2019
if errorlevel 1 (
archery docker build --no-pull python-wheel-windows-vs2017 || exit /B 1
archery docker build --no-pull python-wheel-windows-vs2019 || exit /B 1
)
archery docker run --no-build -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-windows-vs2017
archery docker run --no-build -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-windows-vs2019
- uses: actions/upload-artifact@v3
with:
Expand All @@ -77,5 +77,5 @@ jobs:
shell: cmd
run: |
cd arrow
archery docker push python-wheel-windows-vs2017
archery docker push python-wheel-windows-vs2019
{% endif %}
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ x-hierarchy:
- python-wheel-manylinux-2-28
- python-wheel-manylinux-test-imports
- python-wheel-manylinux-test-unittests
- python-wheel-windows-vs2017
- python-wheel-windows-vs2019
- python-wheel-windows-test

volumes:
Expand Down Expand Up @@ -1098,19 +1098,19 @@ services:
CHECK_UNITTESTS: "ON"
command: /arrow/ci/scripts/python_wheel_unix_test.sh /arrow

python-wheel-windows-vs2017:
image: ${REPO}:python-${PYTHON}-wheel-windows-vs2017-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
python-wheel-windows-vs2019:
image: ${REPO}:python-${PYTHON}-wheel-windows-vs2019-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
build:
args:
vcpkg: ${VCPKG}
python: ${PYTHON}
context: .
dockerfile: ci/docker/python-wheel-windows-vs2017.dockerfile
dockerfile: ci/docker/python-wheel-windows-vs2019.dockerfile
# This should make the pushed images reusable, but the image gets rebuilt.
# Uncomment if no local cache is available.
# cache_from:
# - abrarov/msvc-2017:2.11.0
# - ${REPO}:python-${PYTHON}-wheel-windows-vs2017-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
# - abrarov/msvc-2019:2.11.0
# - ${REPO}:python-${PYTHON}-wheel-windows-vs2019-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
volumes:
- "${DOCKER_VOLUME_PREFIX}python-wheel-windows-clcache:C:/clcache"
- type: bind
Expand All @@ -1119,12 +1119,12 @@ services:
command: arrow\\ci\\scripts\\python_wheel_windows_build.bat

python-wheel-windows-test:
image: ${REPO}:python-${PYTHON}-wheel-windows-test-vs2017-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
image: ${REPO}:python-${PYTHON}-wheel-windows-test-vs2019-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
build:
args:
python: ${PYTHON}
context: .
dockerfile: ci/docker/python-wheel-windows-test-vs2017.dockerfile
dockerfile: ci/docker/python-wheel-windows-test-vs2019.dockerfile
volumes:
- "${DOCKER_VOLUME_PREFIX}python-wheel-windows-clcache:C:/clcache"
- type: bind
Expand Down

0 comments on commit 8ea60d1

Please sign in to comment.