Skip to content

Conversation

@roger-mike
Copy link
Contributor

@roger-mike roger-mike commented Sep 30, 2022

As part of the migration of Precommit and Postcommit Jobs from Jenkins to GA in self-hosted runners, this PR contains:

The migrated workflows were added to CI.md

DO NOT MERGE until the effort to use self-hosted runners is completed #22703
These workflows use base actions listed in #23109 (Dependency)


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@github-actions github-actions bot added the build label Sep 30, 2022
@benEng benEng mentioned this pull request Sep 30, 2022
4 tasks
@roger-mike roger-mike force-pushed the sharding-precommit-python branch from f787160 to b336558 Compare September 30, 2022 20:18
@roger-mike
Copy link
Contributor Author

R: @damccorm

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2022

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@roger-mike roger-mike force-pushed the sharding-precommit-python branch from b336558 to 2bed71b Compare October 4, 2022 17:23
- 'sdks/python/apache_beam/runners/portability/local_job_service_test.py'
- 'sdks/python/apache_beam/runners/portability/portable_runner_test.py'
- 'sdks/python/apache_beam/runners/portability/sdk_container_builder_test.py'
- 'sdks/python/apache_beam/io/hadoopfilesystem_test.py'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please sort these paths alphabetically? It will make it much easier to read/edit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

@roger-mike roger-mike requested a review from damccorm November 7, 2022 16:43
uses: ./.github/actions/gradle-command-self-hosted-action
with:
gradle-command: :sdks:python:test-suites:tox:py${{env.PYTHON_VERSION}}:testPy${{env.PYTHON_VERSION}}${{matrix.tox-env}}
arguments: "-Pposargs=apache_beam/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was revisiting this and realized I don't think its actually working the way we expect it to. A couple notes:

  1. This runs the tests for all of the apache_beam directory. This means that subsequent steps are just trying to retest things tested here. Since that gets cached, subsequent steps will do nothing. See https://github.com/roger-mike/beam/actions/runs/3161439176/jobs/5147285589 which takes 10 minutes for this step and 10 seconds for each subsequent step.
  2. As best I can tell gradlew :sdks:python:test-suites:tox:py${{env.PYTHON_VERSION}}:testPy${{env.PYTHON_VERSION}}${{matrix.tox-env}} <path/to/tests> doesn't actually limit runs to tests in that directory. So I don't think this approach is generally valid.
  3. (least important, but still matters) Sharding is most helpful when things are split into different jobs, not just different steps. This kind of sharding doesn't really buy us much. Sharding into jobs would also make some of these problems more obvious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for the feedback Danny. I just have a question, do you think is a good idea to split this tests into different workflows for each module? For example, a workflow for each one of these:
apache_beam/
apache_beam/coders
apache_beam/internal
apache_beam/io
apache_beam/metrics
apache_beam/options
apache_beam/runners
...etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that's a good idea

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As best I can tell gradlew :sdks:python:test-suites:tox:py${{env.PYTHON_VERSION}}:testPy${{env.PYTHON_VERSION}}${{matrix.tox-env}} <path/to/tests> doesn't actually limit runs to tests in that directory. So I don't think this approach is generally valid.

I still don't think the current approach actually works in limiting the tests being run - I've been doing something similar for the Jenkins tests here and had to add some custom logic (which still isn't quite working) - #24204

@roger-mike roger-mike force-pushed the sharding-precommit-python branch 3 times, most recently from 1de3954 to 0315dec Compare November 30, 2022 16:57
@roger-mike roger-mike force-pushed the sharding-precommit-python branch from 0315dec to 48c4386 Compare November 30, 2022 17:18
@codecov
Copy link

codecov bot commented Nov 30, 2022

Codecov Report

Merging #23451 (5a3c7c5) into master (23676a9) will increase coverage by 1.16%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #23451      +/-   ##
==========================================
+ Coverage   73.46%   74.63%   +1.16%     
==========================================
  Files         709      714       +5     
  Lines       95983   103589    +7606     
==========================================
+ Hits        70514    77311    +6797     
- Misses      24152    24961     +809     
  Partials     1317     1317              
Flag Coverage Δ
python 83.83% <ø> (+0.62%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...thon/apache_beam/io/azure/blobstoragefilesystem.py 76.47% <0.00%> (-1.75%) ⬇️
...hon/apache_beam/runners/worker/worker_pool_main.py 57.81% <0.00%> (-1.45%) ⬇️
sdks/python/apache_beam/typehints/schemas.py 88.07% <0.00%> (-0.89%) ⬇️
...l/job_management/v1/beam_expansion_api_pb2_grpc.py 57.14% <0.00%> (-0.76%) ⬇️
...ks/python/apache_beam/runners/worker/sdk_worker.py 89.08% <0.00%> (-0.17%) ⬇️
...apache_beam/examples/cookbook/custom_ptransform.py 52.27% <0.00%> (-0.11%) ⬇️
...s/python/apache_beam/runners/portability/stager.py 86.21% <0.00%> (-0.07%) ⬇️
sdks/python/apache_beam/typehints/row_type.py 100.00% <0.00%> (ø)
sdks/python/apache_beam/ml/inference/__init__.py 100.00% <0.00%> (ø)
sdks/python/apache_beam/portability/common_urns.py 100.00% <0.00%> (ø)
... and 43 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@roger-mike roger-mike force-pushed the sharding-precommit-python branch 5 times, most recently from e0c33c9 to 430bcd7 Compare December 6, 2022 16:46
@roger-mike roger-mike force-pushed the sharding-precommit-python branch 2 times, most recently from 852f193 to 79195a5 Compare December 6, 2022 20:10
@roger-mike roger-mike force-pushed the sharding-precommit-python branch 2 times, most recently from aa5515c to 722b2dd Compare December 16, 2022 18:07
@roger-mike roger-mike requested a review from damccorm December 19, 2022 17:50
@roger-mike roger-mike force-pushed the sharding-precommit-python branch from 722b2dd to 5a3c7c5 Compare December 19, 2022 18:04
branches: [ 'master', 'release-*']
tags: 'v*'
paths:
- 'sdks/python/apache_beam/coders/**'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, lets run all of these workflows on sdks/python/apache_beam. Some folders have dependencies on other folders and we want to make sure we catch issues with tests

@github-actions
Copy link
Contributor

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@beam.apache.org list. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants