Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST PR] #28569

Closed
wants to merge 11 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/actions/gradle-command-action
1 change: 1 addition & 0 deletions .github/workflows/beam_PreCommit_Python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
arguments: |
-Pposargs="--ignore=apache_beam/dataframe/ --ignore=apache_beam/examples/ --ignore=apache_beam/runners/ --ignore=apache_beam/transforms/" \
-PpythonVersion=${{ matrix.python_version }} \
-PuseWheelDistribution
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/beam_PreCommit_Python_Coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
uses: ./.github/actions/gradle-command-self-hosted-action
with:
gradle-command: :sdks:python:test-suites:tox:py38:preCommitPyCoverage
arguments: |
-PuseWheelDistribution
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/beam_PreCommit_Python_Dataframes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
arguments: |
-Pposargs=apache_beam/dataframe/ \
-PpythonVersion=${{ matrix.python_version }} \
-PuseWheelDistribution
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/beam_PreCommit_Python_Examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
arguments: |
-Pposargs=apache_beam/examples/ \
-PpythonVersion=${{ matrix.python_version }} \
-PuseWheelDistribution
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/beam_PreCommit_Python_Integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ jobs:
with:
gradle-command: :sdks:python:test-suites:dataflow:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:preCommitIT_streaming
arguments: |
-PuseWheelDistribution \
-PpythonVersion=${{ matrix.python_version }} \
-PuseWheelDistribution
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/beam_PreCommit_Python_Runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
arguments: |
-Pposargs=apache_beam/runners/ \
-PpythonVersion=${{ matrix.python_version }} \
-PuseWheelDistribution
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/beam_PreCommit_Python_Transforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
arguments: |
-Pposargs=apache_beam/transforms/ \
-PpythonVersion=${{ matrix.python_version }} \
-PuseWheelDistribution
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_release_candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ jobs:
pip install -U pip
pip install tox
# TODO(https://github.com/apache/beam/issues/20209): Don't hardcode py version in this file.
pip install -r build-requirements.txt && tox -e py38-docs
tox -e py38-docs
rm -rf target/docs/_build/.doctrees
- name: Build Typescript Docs
working-directory: beam/sdks/typescript
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Get build dependencies
working-directory: ./sdks/python
run: python -m pip install -r build-requirements.txt
- name: Install wheels
run: python -m pip install wheel
- name: Get tag
id: get_tag
run: |
Expand All @@ -117,15 +112,15 @@ jobs:
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
- name: Build source
working-directory: ./sdks/python
run: python setup.py sdist --formats=zip
run: pip install -U build && python -m build --sdist
- name: Add checksums
working-directory: ./sdks/python/dist
run: |
file=$(ls | grep .zip | head -n 1)
file=$(ls | grep .tar.gz | head -n 1)
sha512sum $file > ${file}.sha512
- name: Unzip source
working-directory: ./sdks/python
run: unzip dist/$(ls dist | grep .zip | head -n 1)
run: tar -xzvf dist/$(ls dist | grep .tar.gz | head -n 1)
- name: Rename source directory
working-directory: ./sdks/python
run: mv $(ls | grep apache-beam) apache-beam-source
Expand Down Expand Up @@ -155,17 +150,17 @@ jobs:
- name: Build RC source
if: steps.is_rc.outputs.is_rc == 1
working-directory: ./sdks/python
run: python setup.py sdist --formats=zip
run: pip install -U build && pythom -m build --sdist
- name: Add RC checksums
if: steps.is_rc.outputs.is_rc == 1
working-directory: ./sdks/python/dist
run: |
file=$(ls | grep .zip | head -n 1)
file=$(ls | grep .tar.gz | head -n 1)
sha512sum $file > ${file}.sha512
- name: Unzip RC source
if: steps.is_rc.outputs.is_rc == 1
working-directory: ./sdks/python
run: unzip dist/$(ls dist | grep .zip | head -n 1)
run: tar -xzvf dist/$(ls dist | grep .tar.gz | head -n 1)
- name: Rename RC source directory
if: steps.is_rc.outputs.is_rc == 1
working-directory: ./sdks/python
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/dask_runner_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Get build dependencies
working-directory: ./sdks/python
run: pip install pip setuptools --upgrade && pip install -r build-requirements.txt
- name: Build source
working-directory: ./sdks/python
run: python setup.py sdist
run: pip install -U build && python -m build --sdist
- name: Rename source file
working-directory: ./sdks/python/dist
run: mv $(ls | grep "apache-beam.*tar\.gz") apache-beam-source.tar.gz
Expand Down Expand Up @@ -78,9 +75,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.params.py_ver }}
- name: Get build dependencies
working-directory: ./sdks/python
run: pip install -r build-requirements.txt
- name: Install tox
run: pip install tox
- name: Install SDK with dask
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/python_dependency_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: ['master', 'release-*']
tags: 'v*'
# paths where Beam Python's dependencies are configured.
paths: ['sdks/python/setup.py', 'sdks/python/build-requirements.txt', 'sdks/python/container/base_image_requirements_manual.txt']
paths: ['sdks/python/setup.py', 'sdks/python/pyproject.toml', 'sdks/python/container/base_image_requirements_manual.txt']

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
Expand Down Expand Up @@ -38,12 +38,15 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.params.py_ver }}
- name: Install Build dependencies
working-directory: ./sdks/python
run: pip install -r build-requirements.txt
- name: Install base_image_requirements.txt
working-directory: ./sdks/python
run: pip install --no-deps -r container/${{ matrix.params.py_env }}/base_image_requirements.txt
# prior to PEP 517, wheel and setuptools were downloaded by default by pip. Now they are installed
# in isolated envs during build process and will not be present in the users virtual envs. To
# satisy projects that has wheel as a dependency, we need to install it here.
- name: Install wheel
working-directory: ./sdks/python
run: pip install wheel
- name: Install Apache Beam
working-directory: ./sdks/python
run: pip install --no-deps -v -e .[test,gcp,interactive,dataframe,aws,azure]
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Get build dependencies
working-directory: ./sdks/python
run: pip install pip setuptools --upgrade && pip install -r build-requirements.txt
- name: Build source
working-directory: ./sdks/python
run: python setup.py sdist
run: pip install -U build && python -m build --sdist
- name: Rename source file
working-directory: ./sdks/python/dist
run: mv $(ls | grep "apache-beam.*tar\.gz") apache-beam-source.tar.gz
Expand Down Expand Up @@ -113,9 +110,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.params.py_ver }}
- name: Get build dependencies
working-directory: ./sdks/python
run: pip install -r build-requirements.txt --use-pep517
- name: Install tox
run: pip install tox
- name: Run tests basic unix
Expand Down Expand Up @@ -148,9 +142,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Get build dependencies
working-directory: ./sdks/python
run: pip install -r build-requirements.txt
- name: Install requirements
working-directory: ./sdks/python
run: pip install setuptools --upgrade && pip install -e .
Expand Down Expand Up @@ -192,9 +183,6 @@ jobs:
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Get build dependencies
working-directory: ./sdks/python
run: pip install -r build-requirements.txt
- name: Install requirements
working-directory: ./sdks/python
run: pip install setuptools --upgrade && pip install -e ".[gcp]"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/run_perf_alert_tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ jobs:
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Get Apache Beam Build dependencies
working-directory: ./sdks/python
run: pip install pip setuptools --upgrade && pip install -r build-requirements.txt
- name: Install Apache Beam
working-directory: ./sdks/python
run: pip install -e .[gcp,test]
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/typescript_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ jobs:
- name: Setup Beam Python
working-directory: ./sdks/python
run: |
pip install pip setuptools --upgrade
pip install -r build-requirements.txt
pip install 'pandas>=1.0,<1.5'
python setup.py develop
pip install -e .
- run: npm ci
working-directory: ./sdks/typescript
- run: npm run build
Expand Down Expand Up @@ -146,10 +144,7 @@ jobs:
- name: Setup Beam Python
working-directory: ./sdks/python
run: |
pip install pip setuptools --upgrade
pip install -r build-requirements.txt
pip install 'pandas>=1.0,<1.5'
python setup.py develop
pip install -e ".[gcp]"
- name: Authenticate on GCP
uses: google-github-actions/setup-gcloud@v0
Expand Down
1 change: 1 addition & 0 deletions .test-infra/jenkins/job_PreCommit_Python.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
'^release/.*$',
],
gradleSwitches: [
'-PuseWheelDistribution',
'-Pposargs=\"--ignore=apache_beam/dataframe/ --ignore=apache_beam/examples/ --ignore=apache_beam/runners/ --ignore=apache_beam/transforms/\"' // All these tests are covered by different jobs.
],
numBuildsToRetain: 40
Expand Down
3 changes: 3 additions & 0 deletions .test-infra/jenkins/job_PreCommit_Python_Coverage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
scope: this,
nameBase: 'Python_Coverage',
gradleTask: ':sdks:python:test-suites:tox:py38:preCommitPyCoverage',
gradleSwitches: [
'-PuseWheelDistribution'
],
timeoutMins: 180,
triggerPathPatterns: [
'^model/.*$',
Expand Down
3 changes: 2 additions & 1 deletion .test-infra/jenkins/job_PreCommit_Python_Dataframes.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
nameBase: 'Python_Dataframes',
gradleTask: ':pythonPreCommit',
gradleSwitches: [
'-Pposargs=apache_beam/dataframe/'
'-Pposargs=apache_beam/dataframe/',
'-PuseWheelDistribution'
],
timeoutMins: 180,
triggerPathPatterns: [
Expand Down
3 changes: 2 additions & 1 deletion .test-infra/jenkins/job_PreCommit_Python_Examples.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
nameBase: 'Python_Examples',
gradleTask: ':pythonPreCommit',
gradleSwitches: [
'-Pposargs=apache_beam/examples/'
'-Pposargs=apache_beam/examples/',
'-PuseWheelDistribution'
],
timeoutMins: 180,
triggerPathPatterns: [
Expand Down
3 changes: 2 additions & 1 deletion .test-infra/jenkins/job_PreCommit_Python_Runners.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
nameBase: 'Python_Runners',
gradleTask: ':pythonPreCommit',
gradleSwitches: [
'-Pposargs=apache_beam/runners/'
'-Pposargs=apache_beam/runners/',
'-PuseWheelDistribution'
],
timeoutMins: 180,
triggerPathPatterns: [
Expand Down
3 changes: 2 additions & 1 deletion .test-infra/jenkins/job_PreCommit_Python_Transforms.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
nameBase: 'Python_Transforms',
gradleTask: ':pythonPreCommit',
gradleSwitches: [
'-Pposargs=apache_beam/transforms/'
'-Pposargs=apache_beam/transforms/',
'-PuseWheelDistribution'
],
timeoutMins: 180,
triggerPathPatterns: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2949,7 +2949,7 @@ class BeamModulePlugin implements Plugin<Project> {
executable 'sh'
args '-c', ". ${project.ext.envdir}/bin/activate && " +
"pip install --pre --retries 10 --upgrade pip && " +
"pip install --pre --retries 10 --upgrade tox -r ${project.rootDir}/sdks/python/build-requirements.txt"
"pip install --pre --retries 10 --upgrade tox"
}
}
// Gradle will delete outputs whenever it thinks they are stale. Putting a
Expand Down Expand Up @@ -3032,30 +3032,40 @@ class BeamModulePlugin implements Plugin<Project> {
}
return argList.join(' ')
}

project.ext.toxTask = { name, tox_env, posargs='' ->
project.tasks.register(name) {
dependsOn setupVirtualenv
dependsOn ':sdks:python:sdist'

doLast {
// Python source directory is also tox execution workspace, We want
// to isolate them per tox suite to avoid conflict when running
// multiple tox suites in parallel.
project.copy { from project.pythonSdkDeps; into copiedSrcRoot }

def copiedPyRoot = "${copiedSrcRoot}/sdks/python"
def distTarBall = "${pythonRootDir}/build/apache-beam.tar.gz"
project.exec {
executable 'sh'
args '-c', ". ${project.ext.envdir}/bin/activate && cd ${copiedPyRoot} && scripts/run_tox.sh $tox_env $distTarBall '$posargs'"
if (!project.hasProperty('useWheelDistribution')) {
def pythonVersionNumber = project.ext.pythonVersion.replace('.', '')
dependsOn ":sdks:python:bdistPy${pythonVersionNumber}linux"
doLast {
project.copy { from project.pythonSdkDeps; into copiedSrcRoot }
def copiedPyRoot = "${copiedSrcRoot}/sdks/python"
def collection = project.fileTree(project.project(':sdks:python').buildDir){
include "**/apache_beam-*cp${pythonVersionNumber}*manylinux*.whl"
}
String packageFilename = collection.singleFile.toString()
project.exec {
executable 'sh'
args '-c', ". ${project.ext.envdir}/bin/activate && cd ${copiedPyRoot} && scripts/run_tox.sh $tox_env ${packageFilename} '$posargs' "
}
}
} else {
// tox task will run in editable mode, which is configured in the tox.ini file.
doLast {
project.copy { from project.pythonSdkDeps; into copiedSrcRoot }
def copiedPyRoot = "${copiedSrcRoot}/sdks/python"
project.exec {
executable 'sh'
args '-c', ". ${project.ext.envdir}/bin/activate && cd ${copiedPyRoot} && scripts/run_tox.sh $tox_env '$posargs'"
}
}
}
inputs.files project.pythonSdkDeps
outputs.files project.fileTree(dir: "${pythonRootDir}/target/.tox/${tox_env}/log/")
}
}

// Run single or a set of integration tests with provided test options and pipeline options.
project.ext.enablePythonPerformanceTest = {

Expand Down
2 changes: 1 addition & 1 deletion release/src/main/scripts/build_release_candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ if [[ $confirmation = "y" ]]; then
cd ${BEAM_ROOT_DIR}
RELEASE_COMMIT=$(git rev-list -n 1 "tags/${RC_TAG}")
# TODO(https://github.com/apache/beam/issues/20209): Don't hardcode py version in this file.
cd sdks/python && pip install -r build-requirements.txt && tox -e py38-docs
cd sdks/python && tox -e py38-docs
GENERATED_PYDOC=~/${LOCAL_WEBSITE_UPDATE_DIR}/${LOCAL_PYTHON_DOC}/${BEAM_ROOT_DIR}/sdks/python/target/docs/_build
rm -rf ${GENERATED_PYDOC}/.doctrees

Expand Down
Loading
Loading