Skip to content

Commit 8fc2b6b

Browse files
authored
Move Python PreCommit middle versions to PostCommit (#38347)
1 parent a4cb676 commit 8fc2b6b

7 files changed

Lines changed: 155 additions & 15 deletions

.github/workflows/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ PostCommit Jobs run in a schedule against master branch and generally do not get
396396
| [ PostCommit Python Xlang Gcp Dataflow ](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Dataflow.yml) | N/A |`beam_PostCommit_Python_Xlang_Gcp_Dataflow.json`| [![.github/workflows/beam_PostCommit_Python_Xlang_Gcp_Dataflow.yml](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Dataflow.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Dataflow.yml?query=event%3Aschedule) |
397397
| [ PostCommit Python Xlang Gcp Direct ](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Direct.yml) | N/A |`beam_PostCommit_Python_Xlang_Gcp_Direct.json`| [![.github/workflows/beam_PostCommit_Python_Xlang_Gcp_Direct.yml](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Direct.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Direct.yml?query=event%3Aschedule) |
398398
| [ PostCommit Python Xlang IO Dataflow ](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_IO_Dataflow.yml) | N/A |`beam_PostCommit_Python_Xlang_IO_Dataflow.json`| [![.github/workflows/beam_PostCommit_Python_Xlang_IO_Dataflow.yml](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_IO_Dataflow.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_IO_Dataflow.yml?query=event%3Aschedule) |
399+
| [ PostCommit Python Versions ](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Versions.yml) | N/A |`beam_PostCommit_Python_Versions.json`| [![.github/workflows/beam_PostCommit_Python_Versions.yml](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Versions.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Versions.yml?query=event%3Aschedule) |
399400
| [ PostCommit SQL ](https://github.com/apache/beam/actions/workflows/beam_PostCommit_SQL.yml) | N/A |`beam_PostCommit_SQL.json`| [![.github/workflows/beam_PostCommit_SQL.yml](https://github.com/apache/beam/actions/workflows/beam_PostCommit_SQL.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PostCommit_SQL.yml?query=event%3Aschedule) |
400401
| [ PostCommit TransformService Direct ](https://github.com/apache/beam/actions/workflows/beam_PostCommit_TransformService_Direct.yml) | N/A |`beam_PostCommit_TransformService_Direct.json`| [![.github/workflows/beam_PostCommit_TransformService_Direct.yml](https://github.com/apache/beam/actions/workflows/beam_PostCommit_TransformService_Direct.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PostCommit_TransformService_Direct.yml?query=event%3Aschedule)
401402
| [ PostCommit Website Test](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Website_Test.yml) | N/A |`beam_PostCommit_Website_Test.json`| [![.github/workflows/beam_PostCommit_Website_Test.yml](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Website_Test.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PostCommit_Website_Test.yml?query=event%3Aschedule) |
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: PostCommit Python Versions
17+
on:
18+
pull_request_target:
19+
branches: [ "master", "release-*" ]
20+
paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Python_Versions.json']
21+
push:
22+
tags: ['v*']
23+
branches: ['master', 'release-*']
24+
paths: [ "model/**","sdks/python/**",".github/workflows/beam_PostCommit_Python_Versions.yml"]
25+
schedule:
26+
- cron: '0 3/6 * * *'
27+
workflow_dispatch:
28+
29+
#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
30+
permissions:
31+
actions: write
32+
pull-requests: write
33+
checks: write
34+
contents: read
35+
deployments: read
36+
id-token: none
37+
issues: write
38+
discussions: read
39+
packages: read
40+
pages: read
41+
repository-projects: read
42+
security-events: read
43+
statuses: read
44+
45+
# This allows a subsequently queued workflow run to interrupt previous runs
46+
concurrency:
47+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
48+
cancel-in-progress: true
49+
50+
env:
51+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
52+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
53+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
54+
# Aggressive stability settings for flaky CI environment
55+
PYTHONHASHSEED: "0"
56+
OMP_NUM_THREADS: "1"
57+
OPENBLAS_NUM_THREADS: "1"
58+
# TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed.
59+
GRPC_ENABLE_FORK_SUPPORT: "0"
60+
# gRPC stability - more conservative for unstable networks
61+
GRPC_ARG_KEEPALIVE_TIME_MS: "10000"
62+
GRPC_ARG_KEEPALIVE_TIMEOUT_MS: "15000"
63+
GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS: "1"
64+
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA: "0"
65+
GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: "30000"
66+
# Beam-specific - very generous timeouts
67+
BEAM_RETRY_MAX_ATTEMPTS: "5"
68+
BEAM_RETRY_INITIAL_DELAY_MS: "5000"
69+
BEAM_RETRY_MAX_DELAY_MS: "120000"
70+
# Force stable execution
71+
BEAM_TESTING_FORCE_SINGLE_BUNDLE: "true"
72+
BEAM_TESTING_DETERMINISTIC_ORDER: "true"
73+
74+
jobs:
75+
beam_PostCommit_Python_Versions:
76+
name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
77+
runs-on: [self-hosted, ubuntu-24.04, main]
78+
timeout-minutes: 180
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
job_name: ['beam_PostCommit_Python_Versions']
83+
job_phrase: ['Run Python Version PostCommit']
84+
python_version: ['3.11','3.12','3.13'] # Run Python PreCommit tests on "middle" versions
85+
if: |
86+
github.event_name == 'push' ||
87+
github.event_name == 'pull_request_target' ||
88+
(github.event_name == 'schedule' && github.repository == 'apache/beam') ||
89+
github.event_name == 'workflow_dispatch'
90+
steps:
91+
- uses: actions/checkout@v4
92+
- name: Setup repository
93+
uses: ./.github/actions/setup-action
94+
with:
95+
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
96+
github_token: ${{ secrets.GITHUB_TOKEN }}
97+
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
98+
- name: Setup environment
99+
uses: ./.github/actions/setup-environment-action
100+
with:
101+
java-version: default
102+
python-version: ${{ matrix.python_version }}
103+
- name: Set PY_VER_CLEAN
104+
id: set_py_ver_clean
105+
run: |
106+
PY_VER=${{ matrix.python_version }}
107+
PY_VER_CLEAN=${PY_VER//.}
108+
echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT
109+
- name: Run pythonPreCommit
110+
env:
111+
TOX_TESTENV_PASSENV: "DOCKER_*,TESTCONTAINERS_*,TC_*,BEAM_*,GRPC_*,OMP_*,OPENBLAS_*,PYTHONHASHSEED,PYTEST_*"
112+
# Aggressive retry and timeout settings for flaky CI
113+
PYTEST_ADDOPTS: "-v --tb=short --maxfail=5 --durations=30 --reruns=5 --reruns-delay=15 --timeout=600 --disable-warnings"
114+
# Container stability - much more generous timeouts
115+
TC_TIMEOUT: "300"
116+
TC_MAX_TRIES: "15"
117+
TC_SLEEP_TIME: "5"
118+
# Additional gRPC stability for flaky environment
119+
GRPC_ARG_KEEPALIVE_TIME_MS: "60000"
120+
GRPC_ARG_KEEPALIVE_TIMEOUT_MS: "60000"
121+
GRPC_ARG_MAX_CONNECTION_IDLE_MS: "60000"
122+
GRPC_ARG_HTTP2_BDP_PROBE: "1"
123+
GRPC_ARG_SO_REUSEPORT: "1"
124+
# Force sequential execution to reduce load
125+
PYTEST_XDIST_WORKER_COUNT: "1"
126+
# Additional gRPC settings
127+
GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: "120000"
128+
GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS: "2000"
129+
BEAM_RUNNER_BUNDLE_TIMEOUT_MS: "600000"
130+
uses: ./.github/actions/gradle-command-self-hosted-action
131+
with:
132+
gradle-command: :sdks:python:test-suites:tox:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:preCommitPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}
133+
arguments: |
134+
-PpythonVersion=${{ matrix.python_version }} \
135+
-Pposargs="--ignore=apache_beam/ml/" \
136+
- name: Archive Python Test Results
137+
uses: actions/upload-artifact@v4
138+
if: failure()
139+
with:
140+
name: Python ${{ matrix.python_version }} Test Results
141+
path: '**/pytest*.xml'
142+
- name: Publish Python Test Results
143+
uses: EnricoMi/publish-unit-test-result-action@v2
144+
if: always()
145+
with:
146+
commit: '${{ env.prsha || env.GITHUB_SHA }}'
147+
comment_mode: ${{ github.event_name == 'issue_comment' && 'always' || 'off' }}
148+
files: '**/pytest*.xml'
149+
large_files: true

.github/workflows/beam_PreCommit_Python.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
matrix:
8484
job_name: ['beam_PreCommit_Python']
8585
job_phrase: ['Run Python PreCommit']
86-
python_version: ['3.10','3.11','3.12','3.13','3.14']
86+
python_version: ['3.10','3.14']
8787
if: |
8888
github.event_name == 'push' ||
8989
github.event_name == 'pull_request_target' ||
@@ -150,13 +150,3 @@ jobs:
150150
comment_mode: ${{ github.event_name == 'issue_comment' && 'always' || 'off' }}
151151
files: '**/pytest*.xml'
152152
large_files: true
153-
- name: Cleanup
154-
if: always()
155-
run: |
156-
# Kill any remaining processes
157-
sudo pkill -f "gradle" || true
158-
sudo pkill -f "java" || true
159-
sudo pkill -f "python.*pytest" || true
160-
# Clean up temp files
161-
sudo rm -rf /tmp/beam-* || true
162-
sudo rm -rf /tmp/gradle-* || true

.github/workflows/beam_PreCommit_Python_Dataframes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
matrix:
6565
job_name: ['beam_PreCommit_Python_Dataframes']
6666
job_phrase: ['Run Python_Dataframes PreCommit']
67-
python_version: ['3.10','3.11','3.12','3.13','3.14']
67+
python_version: ['3.10','3.14']
6868
if: |
6969
github.event_name == 'push' ||
7070
github.event_name == 'pull_request_target' ||

.github/workflows/beam_PreCommit_Python_Examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
matrix:
6666
job_name: ['beam_PreCommit_Python_Examples']
6767
job_phrase: ['Run Python_Examples PreCommit']
68-
python_version: ['3.10','3.11','3.12','3.13','3.14']
68+
python_version: ['3.10','3.14']
6969
if: |
7070
github.event_name == 'push' ||
7171
github.event_name == 'pull_request_target' ||

.github/workflows/beam_PreCommit_Python_Runners.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
matrix:
6565
job_name: ['beam_PreCommit_Python_Runners']
6666
job_phrase: ['Run Python_Runners PreCommit']
67-
python_version: ['3.10','3.11','3.12','3.13','3.14']
67+
python_version: ['3.10','3.14']
6868
if: |
6969
github.event_name == 'push' ||
7070
github.event_name == 'pull_request_target' ||

.github/workflows/beam_PreCommit_Python_Transforms.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
matrix:
6666
job_name: ['beam_PreCommit_Python_Transforms']
6767
job_phrase: ['Run Python_Transforms PreCommit']
68-
python_version: ['3.10','3.11','3.12','3.13','3.14']
68+
python_version: ['3.10','3.14']
6969
if: |
7070
github.event_name == 'push' ||
7171
github.event_name == 'pull_request_target' ||

0 commit comments

Comments
 (0)