Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .buildkite/windows.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ steps:
--operating-system windows
--except-tags no_windows
--test-env=CI="1"
--test-env=USERPROFILE
--test-env=USERPROFILE || true
- sleep 28800
depends_on: windowsbuild

# block full test suite on premerge and microcheck
Expand Down
12 changes: 12 additions & 0 deletions ci/docker/windows.build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,17 @@ ENV PYTHON=3.10
ENV PYTHON_FULL_VERSION=3.10.19
ENV RAY_BUILD_ENV=win_py$PYTHON_FULL_VERSION

# build_base.sh builds the test interpreter in a dedicated conda env ("ray")
# rather than swapping the base env's python in place.
ENV RAY_CONDA_ENV=ray

COPY . .
RUN bash ci/ray_ci/windows/build_base.sh

# Make the dedicated env the default interpreter for build_ray.sh and for bazel
# at test time. On this base image the effective PATH lives in the Windows
# registry (machine scope), NOT in a Docker ENV -- so we prepend the env there.
# Using `ENV PATH=...;${PATH}` would expand ${PATH} to nothing and wipe
# conda/git/bash off the PATH (CreateProcess: file not found). `$env:Path` below
# is expanded by powershell at build time (Docker does not substitute in RUN).
RUN powershell -Command "[Environment]::SetEnvironmentVariable('Path', 'C:\Miniconda3\envs\ray;C:\Miniconda3\envs\ray\Library\mingw-w64\bin;C:\Miniconda3\envs\ray\Library\usr\bin;C:\Miniconda3\envs\ray\Library\bin;C:\Miniconda3\envs\ray\Scripts;C:\Miniconda3\envs\ray\bin;' + $env:Path, 'Machine')"
30 changes: 24 additions & 6 deletions ci/ray_ci/windows/build_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,31 @@ powershell ci/ray_ci/windows/install_bazelisk.ps1
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/0.9.22/install.ps1 | iex"

conda init
# TODO(ci): Remove once conda fixes the splitext bug in delete.py (conda/conda#15760).
# Conda 26.3.1 crashes on Windows when it tries to clean up a locked exe during
# a build-variant swap. Preventing self-update avoids that code path.
conda config --set auto_update_conda false
conda install -q -y python="${PYTHON_FULL_VERSION}" requests=2.32.3

# Build the test interpreter in a dedicated conda env instead of swapping the
# base env's python in place. The base image ships Python 3.8 in `base`, and an
# in-place `conda install python=${PYTHON_FULL_VERSION}` either crashes
# (conda#15760) or -- with auto_update_conda disabled -- silently no-ops and
# leaves `base` on 3.8, which then mismatches the py310 bazel deps and blows up
# at test time. A fresh env sidesteps both failure modes. We put it first on
# PATH below for this build; windows.build.Dockerfile does the same on the
# image's machine PATH so bazel resolves to it at test time.
conda create -y -n "${RAY_CONDA_ENV}" python="${PYTHON_FULL_VERSION}" requests=2.32.3
# Force CA trust stack to the newest versions available at build time.
conda update -c conda-forge -q -y ca-certificates certifi
conda update -n "${RAY_CONDA_ENV}" -c conda-forge -y ca-certificates certifi

# Put the env first on PATH for the rest of this build so `python`/`pip` below
# resolve to it. (Test-time PATH is set on the image's machine PATH by
# windows.build.Dockerfile, because on Windows the base PATH lives in the
# registry, not in Docker ENV.)
env_root="/c/Miniconda3/envs/${RAY_CONDA_ENV}"
export PATH="${env_root}:${env_root}/Library/mingw-w64/bin:${env_root}/Library/usr/bin:${env_root}/Library/bin:${env_root}/Scripts:${env_root}/bin:${PATH}"

# Fail the build loudly here if the interpreter on PATH is not the expected
# version, rather than letting the mismatch surface as a confusing import error
# (e.g. `module 'typing' has no attribute '_SpecialGenericAlias'`) at test time.
python --version
python -c "import sys; v = '%d.%d' % sys.version_info[:2]; exp = '${PYTHON}'; assert v == exp, f'expected python {exp} on PATH, got {sys.version}'"

# Install torch first, as some dependencies (e.g. torch-spline-conv) need torch to be
# installed for their own install.
Expand Down
Loading