Skip to content

Commit 0b64865

Browse files
authored
Add logic for generating ml requirements (#35484)
* Add logic for generating ml requirements * Add some requirements and loosen torch bounds * Widen bounds and generate 3.12 containers * posargs * Tox config fixes
1 parent 3def519 commit 0b64865

16 files changed

Lines changed: 1069 additions & 21 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run",
3-
"modification": 0
3+
"modification": 1
44
}

.github/workflows/beam_PostCommit_Python_Dependency.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
matrix:
6060
job_name: [beam_PostCommit_Python_Dependency]
6161
job_phrase: [Run Python PostCommit Dependency]
62+
python_version: ['39','312']
6263
timeout-minutes: 120
6364
if: |
6465
github.event_name == 'workflow_dispatch' ||
@@ -70,9 +71,9 @@ jobs:
7071
- name: Setup repository
7172
uses: ./.github/actions/setup-action
7273
with:
73-
comment_phrase: ${{ matrix.job_phrase }}
74+
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
7475
github_token: ${{ secrets.GITHUB_TOKEN }}
75-
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
76+
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
7677
- name: Setup environment
7778
uses: ./.github/actions/setup-environment-action
7879
with:
@@ -81,7 +82,7 @@ jobs:
8182
- name: Run postCommitPyDep
8283
uses: ./.github/actions/gradle-command-self-hosted-action
8384
with:
84-
gradle-command: :sdks:python:test-suites:tox:py39:postCommitPyDep
85+
gradle-command: :sdks:python:test-suites:tox:py${{ matrix.python_version }}:postCommitPyDep
8586
arguments: -PuseWheelDistribution
8687
- name: Archive Python Test Results
8788
uses: actions/upload-artifact@v4

sdks/python/container/common.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,20 @@ def generatePythonRequirements = tasks.register("generatePythonRequirements") {
3939
executable 'sh'
4040
args '-c', "cd ${rootDir} && ${runScriptsPath} " +
4141
"${project.ext.pythonVersion} " +
42-
"${files(configurations.sdkSourceTarball.files).singleFile} " + "${pipExtraOptions}"
42+
"${files(configurations.sdkSourceTarball.files).singleFile} " +
43+
"base_image_requirements.txt " +
44+
"[gcp,dataframe,test] " +
45+
"${pipExtraOptions}"
46+
}
47+
// Generate versions for ML dependencies
48+
exec {
49+
executable 'sh'
50+
args '-c', "cd ${rootDir} && ${runScriptsPath} " +
51+
"${project.ext.pythonVersion} " +
52+
"${files(configurations.sdkSourceTarball.files).singleFile} " +
53+
"ml_image_requirements.txt " +
54+
"[gcp,dataframe,test,tensorflow,torch,transformers] " +
55+
"${pipExtraOptions}"
4356
}
4457
}
4558
}

sdks/python/container/py310/base_image_requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ hdfs==2.7.3
9292
httpcore==1.0.9
9393
httplib2==0.22.0
9494
httpx==0.28.1
95-
hypothesis==6.135.17
95+
hypothesis==6.135.19
9696
idna==3.10
9797
importlib_metadata==8.7.0
9898
iniconfig==2.1.0
@@ -112,7 +112,7 @@ milvus-lite==2.5.1
112112
mmh3==5.1.0
113113
mock==5.2.0
114114
more-itertools==10.7.0
115-
multidict==6.6.2
115+
multidict==6.6.3
116116
mysql-connector-python==9.3.0
117117
nltk==3.9.1
118118
numpy==2.2.6
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
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+
# Autogenerated requirements file for Apache Beam py310 container image.
17+
# Run ./gradlew :sdks:python:container:generatePythonRequirementsAll to update.
18+
# Do not edit manually, adjust ../base_image_requirements_manual.txt or
19+
# Apache Beam's setup.py instead, and regenerate the list.
20+
# You will need Python interpreters for all versions supported by Beam, see:
21+
# https://s.apache.org/beam-python-dev-wiki
22+
# Reach out to a committer if you need help.
23+
24+
absl-py==2.3.0
25+
aiofiles==24.1.0
26+
aiohappyeyeballs==2.6.1
27+
aiohttp==3.12.13
28+
aiosignal==1.3.2
29+
annotated-types==0.7.0
30+
anyio==4.9.0
31+
asn1crypto==1.5.1
32+
astunparse==1.6.3
33+
async-timeout==5.0.1
34+
attrs==25.3.0
35+
backports.tarfile==1.2.0
36+
beautifulsoup4==4.13.4
37+
bs4==0.0.2
38+
build==1.2.2.post1
39+
cachetools==5.5.2
40+
certifi==2025.6.15
41+
cffi==1.17.1
42+
charset-normalizer==3.4.2
43+
click==8.2.1
44+
cloud-sql-python-connector==1.18.2
45+
crcmod==1.7
46+
cryptography==45.0.4
47+
Cython==3.1.2
48+
dill==0.3.1.1
49+
dnspython==2.7.0
50+
docker==7.1.0
51+
docopt==0.6.2
52+
docstring_parser==0.16
53+
exceptiongroup==1.3.0
54+
execnet==2.1.1
55+
fastavro==1.11.1
56+
fasteners==0.19
57+
filelock==3.18.0
58+
flatbuffers==25.2.10
59+
freezegun==1.5.2
60+
frozenlist==1.7.0
61+
fsspec==2025.5.1
62+
future==1.0.0
63+
gast==0.6.0
64+
google-api-core==2.25.1
65+
google-api-python-client==2.174.0
66+
google-apitools==0.5.31
67+
google-auth==2.40.3
68+
google-auth-httplib2==0.2.0
69+
google-cloud-aiplatform==1.100.0
70+
google-cloud-bigquery==3.34.0
71+
google-cloud-bigquery-storage==2.32.0
72+
google-cloud-bigtable==2.31.0
73+
google-cloud-core==2.4.3
74+
google-cloud-datastore==2.21.0
75+
google-cloud-dlp==3.31.0
76+
google-cloud-language==2.17.2
77+
google-cloud-profiler==4.1.0
78+
google-cloud-pubsub==2.30.0
79+
google-cloud-pubsublite==1.12.0
80+
google-cloud-recommendations-ai==0.10.18
81+
google-cloud-resource-manager==1.14.2
82+
google-cloud-spanner==3.55.0
83+
google-cloud-storage==2.19.0
84+
google-cloud-videointelligence==2.16.2
85+
google-cloud-vision==3.10.2
86+
google-crc32c==1.7.1
87+
google-genai==1.23.0
88+
google-pasta==0.2.0
89+
google-resumable-media==2.7.2
90+
googleapis-common-protos==1.70.0
91+
greenlet==3.2.3
92+
grpc-google-iam-v1==0.14.2
93+
grpc-interceptor==0.15.4
94+
grpcio==1.65.5
95+
grpcio-status==1.63.0rc1
96+
guppy3==3.1.5
97+
h11==0.16.0
98+
h5py==3.14.0
99+
hdfs==2.7.3
100+
hf-xet==1.1.5
101+
httpcore==1.0.9
102+
httplib2==0.22.0
103+
httpx==0.28.1
104+
huggingface-hub==0.33.1
105+
hypothesis==6.135.19
106+
idna==3.10
107+
importlib_metadata==8.7.0
108+
iniconfig==2.1.0
109+
jaraco.classes==3.4.0
110+
jaraco.context==6.0.1
111+
jaraco.functools==4.2.1
112+
jeepney==0.9.0
113+
Jinja2==3.1.6
114+
joblib==1.5.1
115+
jsonpickle==3.4.2
116+
jsonschema==4.24.0
117+
jsonschema-specifications==2025.4.1
118+
keras==3.10.0
119+
keyring==25.6.0
120+
keyrings.google-artifactregistry-auth==1.1.2
121+
libclang==18.1.1
122+
Markdown==3.8.2
123+
markdown-it-py==3.0.0
124+
MarkupSafe==3.0.2
125+
mdurl==0.1.2
126+
milvus-lite==2.5.1
127+
ml-dtypes==0.3.2
128+
mmh3==5.1.0
129+
mock==5.2.0
130+
more-itertools==10.7.0
131+
mpmath==1.3.0
132+
multidict==6.6.3
133+
mysql-connector-python==9.3.0
134+
namex==0.1.0
135+
networkx==3.4.2
136+
nltk==3.9.1
137+
numpy==1.26.4
138+
nvidia-cublas-cu12==12.6.4.1
139+
nvidia-cuda-cupti-cu12==12.6.80
140+
nvidia-cuda-nvrtc-cu12==12.6.77
141+
nvidia-cuda-runtime-cu12==12.6.77
142+
nvidia-cudnn-cu12==9.5.1.17
143+
nvidia-cufft-cu12==11.3.0.4
144+
nvidia-cufile-cu12==1.11.1.6
145+
nvidia-curand-cu12==10.3.7.77
146+
nvidia-cusolver-cu12==11.7.1.2
147+
nvidia-cusparse-cu12==12.5.4.2
148+
nvidia-cusparselt-cu12==0.6.3
149+
nvidia-nccl-cu12==2.26.2
150+
nvidia-nvjitlink-cu12==12.6.85
151+
nvidia-nvtx-cu12==12.6.77
152+
oauth2client==4.1.3
153+
objsize==0.7.1
154+
opentelemetry-api==1.34.1
155+
opentelemetry-sdk==1.34.1
156+
opentelemetry-semantic-conventions==0.55b1
157+
opt_einsum==3.4.0
158+
optree==0.16.0
159+
oracledb==3.2.0
160+
orjson==3.10.18
161+
overrides==7.7.0
162+
packaging==25.0
163+
pandas==2.2.3
164+
parameterized==0.9.0
165+
pg8000==1.31.2
166+
pip==25.1.1
167+
pluggy==1.6.0
168+
propcache==0.3.2
169+
proto-plus==1.26.1
170+
protobuf==4.25.8
171+
psycopg2-binary==2.9.10
172+
pyarrow==18.1.0
173+
pyarrow-hotfix==0.7
174+
pyasn1==0.6.1
175+
pyasn1_modules==0.4.2
176+
pycparser==2.22
177+
pydantic==2.11.7
178+
pydantic_core==2.33.2
179+
pydot==1.4.2
180+
Pygments==2.19.2
181+
PyHamcrest==2.1.0
182+
PyJWT==2.9.0
183+
pymilvus==2.5.11
184+
pymongo==4.13.2
185+
PyMySQL==1.1.1
186+
pyparsing==3.2.3
187+
pyproject_hooks==1.2.0
188+
pytest==7.4.4
189+
pytest-timeout==2.4.0
190+
pytest-xdist==3.7.0
191+
python-dateutil==2.9.0.post0
192+
python-dotenv==1.1.1
193+
python-tds==1.16.1
194+
pytz==2025.2
195+
PyYAML==6.0.2
196+
redis==5.3.0
197+
referencing==0.36.2
198+
regex==2024.11.6
199+
requests==2.32.4
200+
requests-mock==1.12.1
201+
rich==14.0.0
202+
rpds-py==0.25.1
203+
rsa==4.9.1
204+
safetensors==0.5.3
205+
scikit-learn==1.7.0
206+
scipy==1.15.3
207+
scramp==1.4.5
208+
SecretStorage==3.3.3
209+
setuptools==80.9.0
210+
shapely==2.1.1
211+
six==1.17.0
212+
sniffio==1.3.1
213+
sortedcontainers==2.4.0
214+
soupsieve==2.7
215+
SQLAlchemy==2.0.41
216+
sqlalchemy_pytds==1.0.2
217+
sqlparse==0.5.3
218+
sympy==1.14.0
219+
tenacity==8.5.0
220+
tensorboard==2.16.2
221+
tensorboard-data-server==0.7.2
222+
tensorflow==2.16.2
223+
tensorflow-cpu-aws==2.16.2;platform_machine=="aarch64"
224+
tensorflow-io-gcs-filesystem==0.37.1
225+
termcolor==3.1.0
226+
testcontainers==4.10.0
227+
threadpoolctl==3.6.0
228+
tokenizers==0.21.2
229+
tomli==2.2.1
230+
torch==2.7.1
231+
tqdm==4.67.1
232+
transformers==4.48.3
233+
triton==3.3.1
234+
typing-inspection==0.4.1
235+
typing_extensions==4.14.0
236+
tzdata==2025.2
237+
ujson==5.10.0
238+
uritemplate==4.2.0
239+
urllib3==2.5.0
240+
virtualenv-clone==0.5.7
241+
websockets==15.0.1
242+
Werkzeug==3.1.3
243+
wheel==0.45.1
244+
wrapt==1.17.2
245+
yarl==1.20.1
246+
zipp==3.23.0
247+
zstandard==0.23.0

sdks/python/container/py311/base_image_requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ hdfs==2.7.3
9090
httpcore==1.0.9
9191
httplib2==0.22.0
9292
httpx==0.28.1
93-
hypothesis==6.135.17
93+
hypothesis==6.135.19
9494
idna==3.10
9595
importlib_metadata==8.7.0
9696
iniconfig==2.1.0
@@ -110,7 +110,7 @@ milvus-lite==2.5.1
110110
mmh3==5.1.0
111111
mock==5.2.0
112112
more-itertools==10.7.0
113-
multidict==6.6.2
113+
multidict==6.6.3
114114
mysql-connector-python==9.3.0
115115
nltk==3.9.1
116116
numpy==2.2.6

0 commit comments

Comments
 (0)