Skip to content

Commit c114ce5

Browse files
dmiltr3tensorflower-gardener
authored andcommitted
Hosting builds for pull requests check on GitHub - Windows
PiperOrigin-RevId: 890778667
1 parent 4b4cbe9 commit c114ce5

20 files changed

Lines changed: 4662 additions & 6 deletions

.bazelrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,25 @@ common:rbe_windows_x86_cpu_2022 --host_platform="//tensorflow/tools/toolchains/w
696696
common:rbe_windows_x86_cpu_2022 --extra_execution_platforms="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang_new"
697697
common:rbe_windows_x86_cpu_2022 --platforms="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang_new"
698698

699+
# RBE configuration for ML Actions (hermetic toolchains, new pool)
700+
# Note: Using NCCL 2.28.9 to match the requirements of newer hermetic CUDA toolchains used in this environment.
701+
common:rbe_windows_x86_cpu_ml_actions --repo_env=HERMETIC_NCCL_VERSION="2.28.9"
702+
common:rbe_windows_x86_cpu_ml_actions --config=rbe_win_base
703+
common:rbe_windows_x86_cpu_ml_actions --config=win_clang_base
704+
common:rbe_windows_x86_cpu_ml_actions --copt=/D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH
705+
common:rbe_windows_x86_cpu_ml_actions --host_copt=/D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH
706+
common:rbe_windows_x86_cpu_ml_actions --jobs=200
707+
common:rbe_windows_x86_cpu_ml_actions --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
708+
common:rbe_windows_x86_cpu_ml_actions --incompatible_enable_cc_toolchain_resolution
709+
common:rbe_windows_x86_cpu_ml_actions --remote_instance_name=projects/ml-oss-rbe-general/instances/default_instance
710+
common:rbe_windows_x86_cpu_ml_actions --bes_instance_name="ml-oss-rbe-general"
711+
common:rbe_windows_x86_cpu_ml_actions --host_platform="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang_ml_actions"
712+
common:rbe_windows_x86_cpu_ml_actions --extra_execution_platforms="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang_ml_actions"
713+
common:rbe_windows_x86_cpu_ml_actions --platforms="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang_ml_actions"
714+
common:rbe_windows_x86_cpu_ml_actions --extra_toolchains=@org_tensorflow//tensorflow/tools/toolchains/win2022/20260322:cc-toolchain-x64_windows-clang-cl
715+
common:rbe_windows_x86_ml_actions --config=rbe_windows_x86_cpu_ml_actions
716+
test:rbe_windows_x86_cpu_ml_actions --flaky_test_attempts=3
717+
699718
# END TF REMOTE BUILD EXECUTION OPTIONS
700719

701720
# TFLite build configs for generic embedded Linux
@@ -949,6 +968,7 @@ common:windows_x86_cpu_2022_pycpp_test_filters --build_tag_filters=-no_windows,-
949968
test:windows_x86_cpu_2022_pycpp_test_filters --test_lang_filters=cc,py --test_size_filters=small,medium --test_timeout="300,450,1200,3600"
950969
test:windows_x86_cpu_2022_pycpp_test_opts --config=windows_x86_cpu_2022_pycpp_test_build_opts --build_tests_only
951970
test:windows_x86_cpu_2022_pycpp_test --config=windows_x86_cpu_2022_pycpp_test_opts --config=windows_x86_cpu_2022_pycpp_test_filters -- //tensorflow/... //tensorflow/tools/pip_package:import_api_packages_test_cpu -//tensorflow/java/... -//tensorflow/lite/... -//tensorflow/compiler/...
971+
test:windows_x86_ml_actions_pycpp_test --config=windows_x86_cpu_2022_pycpp_test
952972

953973
# END TF TEST SUITE OPTIONS
954974

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright 2026 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
name: Reusable Build
16+
on:
17+
workflow_call:
18+
inputs:
19+
runner:
20+
description: 'Which runner should the workflow run on?'
21+
required: true
22+
type: string
23+
tfci:
24+
description: 'TFCI environment variable'
25+
required: true
26+
type: string
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
build-and-test:
33+
runs-on: ${{ inputs.runner }}
34+
env:
35+
PIP_NO_CACHE_DIR: 1
36+
defaults:
37+
run:
38+
shell: bash
39+
container: ${{ (contains(inputs.runner, 'linux-x86') && 'us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build:latest') ||
40+
(contains(inputs.runner, 'linux-arm64') && 'us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build-arm64:latest') ||
41+
(contains(inputs.runner, 'windows-x86') && null) }}
42+
timeout-minutes: 300
43+
steps:
44+
45+
#- name: Enable Long Paths
46+
# if: contains(inputs.runner, 'windows-x86')
47+
# run: Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
48+
# shell: powershell
49+
50+
- name: Checkout
51+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
52+
env:
53+
GIT_CONFIG_PARAMETERS: "'checkout.workers=12' 'core.featureManyFiles=true'"
54+
with:
55+
ref: ${{ github.sha }}
56+
persist-credentials: false
57+
fetch-depth: 1
58+
59+
- name: Build and test
60+
env:
61+
TFCI: ${{ inputs.tfci }}
62+
TFCI_GITHUB_ACTIONS: true
63+
run: ./ci/official/pycpp.sh

.github/workflows/ci-build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2026 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
name: CI
16+
17+
on:
18+
pull_request:
19+
branches:
20+
- master
21+
- r2.**
22+
23+
permissions:
24+
contents: read
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
28+
# Don't cancel in-progress jobs for master branches.
29+
cancel-in-progress: ${{ github.ref != 'master' }}
30+
31+
jobs:
32+
#build-and-test-linux-x86-cpu:
33+
# uses: ./.github/workflows/build-reusable.yml
34+
# with:
35+
# runner: 'linux-x86-n2-16'
36+
# tfci: 'py313,linux_x86,rbe'
37+
38+
#build-and-test-linux-x86-cuda:
39+
# uses: ./.github/workflows/build-reusable.yml
40+
# with:
41+
# runner: 'linux-x86-n4-32'
42+
# tfci: 'py313,linux_x86_cuda'
43+
44+
#build-and-test-arm64:
45+
# uses: ./.github/workflows/build-reusable.yml
46+
# with:
47+
# runner: 'linux-arm64-c4a-16'
48+
# tfci: 'py313,linux_arm64,rbe'
49+
50+
build-and-test-windows-x86:
51+
uses: ./.github/workflows/build-reusable.yml
52+
with:
53+
runner: 'windows-x86-n2-16'
54+
tfci: 'py313,windows_x86_ml_actions,rbe'

ci/official/envs/rbe

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@ ERROR: RBE was enabled via the 'rbe' env in the 'TFCI' variable.
3131
EOF
3232
exit 1
3333
fi
34+
3435
TFCI_BAZEL_COMMON_ARGS="$TFCI_BAZEL_COMMON_ARGS --config rbe_$TFCI_BAZEL_TARGET_SELECTING_CONFIG_PREFIX"
3536

3637
if [[ `uname -s | grep -P '^MSYS_NT'` ]]; then
37-
# Docker on Windows doesn't support the `host` networking mode, and so
38-
# port-forwarding is required for the container to detect it's running on GCE.
39-
export IP_ADDR=$(powershell -command "(Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias 'vEthernet (nat)').IPAddress")
40-
netsh interface portproxy add v4tov4 listenaddress=$IP_ADDR listenport=80 connectaddress=169.254.169.254 connectport=80
41-
# A local firewall rule for the container is added in
42-
# ci/official/utilities/setup_docker.sh.
38+
if [[ "$TFCI_GITHUB_ACTIONS" != "true" ]]; then
39+
# Docker on Windows doesn't support the `host` networking mode, and so
40+
# port-forwarding is required for the container to detect it's running on GCE.
41+
export IP_ADDR=$(powershell -command "(Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias 'vEthernet (nat)').IPAddress")
42+
netsh interface portproxy add v4tov4 listenaddress=$IP_ADDR listenport=80 connectaddress=169.254.169.254 connectport=80
43+
# A local firewall rule for the container is added in
44+
# ci/official/utilities/setup_docker.sh.
45+
fi
4346
else
4447
# The volume mapping flag below shares the user's gcloud credentials, if any,
4548
# with the container, in case the user has credentials stored there.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2026 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
TFCI_DOCKER_ENABLE=1
16+
if [[ "$TFCI_GITHUB_ACTIONS" == "true" ]]; then
17+
TFCI_DOCKER_ENABLE=0
18+
fi
19+
TFCI_DOCKER_PULL_ENABLE=1
20+
TFCI_DOCKER_IMAGE="us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build-windows@sha256:023fa901fda70be8890b05689d0a667287692c1f59d0abe4add7208ec5a12707"
21+
TFCI_BAZEL_BAZELRC_ARGS="--output_user_root=C:/x"
22+
TFCI_BAZEL_COMMON_ARGS="--repo_env=HERMETIC_PYTHON_VERSION=$TFCI_PYTHON_VERSION --repo_env=USE_PYWRAP_RULES=True --config=windows_x86_cpu_2022"
23+
24+
# For RBE, we explicitly set invalid paths to force the auto-configuration to fail.
25+
TFCI_BAZEL_VC="C:/RBE_ISOLATED_INVALID_PATH"
26+
TFCI_BAZEL_LLVM="C:/RBE_ISOLATED_INVALID_PATH"
27+
TFCI_BAZEL_SH="C:/tools/msys64/usr/bin/bash.exe"
28+
TFCI_USE_CLANG_CL=0
29+
30+
# Map TFCI_BAZEL_* to BAZEL_* so cc_configure can find them in the environment.
31+
# We use the shell's default value substitution to ensure that if these are
32+
# already set (e.g. poisoned for RBE), we don't overwrite them with empty values
33+
# before setup.sh has a chance to restore the TFCI_ variables.
34+
export BAZEL_VC="${TFCI_BAZEL_VC:-$BAZEL_VC}"
35+
export BAZEL_LLVM="${TFCI_BAZEL_LLVM:-$BAZEL_LLVM}"
36+
export BAZEL_SH="${TFCI_BAZEL_SH:-$BAZEL_SH}"
37+
export USE_CLANG_CL="${TFCI_USE_CLANG_CL:-$USE_CLANG_CL}"
38+
TFCI_BAZEL_TARGET_SELECTING_CONFIG_PREFIX=windows_x86_ml_actions
39+
TFCI_BUILD_PIP_PACKAGE_WHEEL_NAME_ARG="--repo_env=WHEEL_NAME=tensorflow"
40+
TFCI_OUTPUT_DIR=build_output
41+
TFCI_FIND_BIN=C:/tools/msys64/usr/bin/find.exe
42+
TFCI_LIB_SUFFIX="-cpu-windows-x86_64"
43+
# auditwheel is not supported for Windows
44+
TFCI_WHL_AUDIT_ENABLE=0
45+
TFCI_WHL_AUDIT_PLAT=0
46+
# Tests are extremely slow at the moment
47+
TFCI_WHL_BAZEL_TEST_ENABLE=0
48+
TFCI_WHL_SIZE_LIMIT=450M
49+
TFCI_WHL_SIZE_LIMIT_ENABLE=1
50+
TFCI_WHL_IMPORT_TEST_ENABLE=1
51+
TFCI_PYTHON_VERIFY_PIP_INSTALL_ARGS=""
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2026 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
TFCI_DOCKER_ENABLE=1
16+
if [[ "$TFCI_GITHUB_ACTIONS" == "true" ]]; then
17+
TFCI_DOCKER_ENABLE=0
18+
fi
19+
TFCI_DOCKER_PULL_ENABLE=1
20+
TFCI_DOCKER_IMAGE="us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build-windows@sha256:023fa901fda70be8890b05689d0a667287692c1f59d0abe4add7208ec5a12707"
21+
TFCI_BAZEL_BAZELRC_ARGS="--output_user_root=C:/x"
22+
TFCI_BAZEL_COMMON_ARGS="--repo_env=HERMETIC_PYTHON_VERSION=$TFCI_PYTHON_VERSION --repo_env=USE_PYWRAP_RULES=True --config=windows_x86_cpu_2022"
23+
24+
# For RBE, we explicitly set invalid paths to force the auto-configuration to fail.
25+
TFCI_BAZEL_VC="C:/RBE_ISOLATED_INVALID_PATH"
26+
TFCI_BAZEL_LLVM="C:/RBE_ISOLATED_INVALID_PATH"
27+
TFCI_BAZEL_SH="C:/tools/msys64/usr/bin/bash.exe"
28+
TFCI_USE_CLANG_CL=0
29+
30+
# Map TFCI_BAZEL_* to BAZEL_* so cc_configure can find them in the environment.
31+
# We use the shell's default value substitution to ensure that if these are
32+
# already set (e.g. poisoned for RBE), we don't overwrite them with empty values
33+
# before setup.sh has a chance to restore the TFCI_ variables.
34+
export BAZEL_VC="${TFCI_BAZEL_VC:-$BAZEL_VC}"
35+
export BAZEL_LLVM="${TFCI_BAZEL_LLVM:-$BAZEL_LLVM}"
36+
export BAZEL_SH="${TFCI_BAZEL_SH:-$BAZEL_SH}"
37+
export USE_CLANG_CL="${TFCI_USE_CLANG_CL:-$USE_CLANG_CL}"
38+
TFCI_BAZEL_TARGET_SELECTING_CONFIG_PREFIX=windows_x86_ml_actions
39+
TFCI_BUILD_PIP_PACKAGE_WHEEL_NAME_ARG="--repo_env=WHEEL_NAME=tensorflow"
40+
TFCI_OUTPUT_DIR=build_output
41+
TFCI_FIND_BIN=C:/tools/msys64/usr/bin/find.exe
42+
TFCI_LIB_SUFFIX="-cpu-windows-x86_64"
43+
# auditwheel is not supported for Windows
44+
TFCI_WHL_AUDIT_ENABLE=0
45+
TFCI_WHL_AUDIT_PLAT=0
46+
# Tests are extremely slow at the moment
47+
TFCI_WHL_BAZEL_TEST_ENABLE=0
48+
TFCI_WHL_SIZE_LIMIT=450M
49+
TFCI_WHL_SIZE_LIMIT_ENABLE=1
50+
TFCI_WHL_IMPORT_TEST_ENABLE=1
51+
TFCI_PYTHON_VERIFY_PIP_INSTALL_ARGS=""

tensorflow/opensource_only.files

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ tf_staging/tensorflow/tools/toolchains/win/BUILD:
194194
tf_staging/tensorflow/tools/toolchains/win/bazel_211/BUILD:
195195
tf_staging/tensorflow/tools/toolchains/win/tf_win_05022023/BUILD:
196196
tf_staging/tensorflow/tools/toolchains/win2022/20241118/BUILD:
197+
tf_staging/tensorflow/tools/toolchains/win2022/20260322/BUILD:
197198
tf_staging/tensorflow/tools/toolchains/win2022/BUILD:
198199
tf_staging/tensorflow/tools/toolchains/win_1803/py38/BUILD:
199200
tf_staging/tensorflow/tools/toolchains/win_1803/py39/BUILD:

0 commit comments

Comments
 (0)