Skip to content

Move dependency tests from PreCommit Coverage to PostCommit - #30704

Merged
Abacn merged 2 commits into
masterfrom
splitcoverage
Mar 22, 2024
Merged

Move dependency tests from PreCommit Coverage to PostCommit#30704
Abacn merged 2 commits into
masterfrom
splitcoverage

Conversation

@Abacn

Copy link
Copy Markdown
Contributor

Please add a meaningful description for your change here

PreCommit Python Coverage costs ~2h30min to run outstandingly. Splitting the dependency compatibility unit tests from this test suite and put into a new PostCommit


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

  • 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 or the workflows README to see a list of phrases to trigger workflows.

@Abacn
Abacnforce-pushed the splitcoverage branch 2 times, most recently from c3851ab to 9a7a1d8CompareMarch 21, 2024 19:41
@Abacn
Abacn marked this pull request as ready for review March 21, 2024 20:47
@Abacn

Copy link
Copy Markdown
ContributorAuthor

btw code coverage report seems broken for a while:

[2024-03-21T20:24:10.281Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: There was an error fetching the storage URL during POST: 400 - Could not determine repo and owner

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @liferoad for label python.
R: @damccorm for label build.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Abacn

Copy link
Copy Markdown
ContributorAuthor

checked that these marked tests also run on Python PreCommit Coverage and the specific Precommits (e.g. Dataframe)

@pytest.mark.uses_pyarrow

toxTask "testPy38pyarrow-8", "py38-pyarrow-8", "${posargs}"
test.dependsOn "testPy38pyarrow-8"
preCommitPyCoverage.dependsOn "testPy38pyarrow-8"
postCommitPyDep.dependsOn "testPy38pyarrow-8"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Each of these categories are not strictly dependency tests, they also test some other functionality which is not necessarily tested elsewhere. I agree we don't need the full matrix of all versions in our precommits, but I think it would be good to keep at least 1 version per type that also runs in the precommit. So for example, we could change this line to 2 lines:

preCommitPyCoverage.dependsOn "testPy38pyarrow-8"
postCommitPyDep.dependsOn "testPy38pyarrow-8"

but leave the rest of the pyarrow versions for the dependency task

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I thought these tests are also running on usual precommit, with dependency version unrestricted (see comment above). Let me open a draft PR to double check

@AbacnAbacnMar 22, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

From test result of #30226 Only pyarrow and pandas tests were executed in other PreCommit (PreCommit dataframe), so these two tests can be fully moved to postcommit; other tests leave at least one version in PreCommit coverage

@Abacn

Copy link
Copy Markdown
ContributorAuthor

Still takes 2h 0min. The very slow part is to install certain dependency:

Fri, 22 Mar 2024 17:01:15 GMT
py38-embeddings: install_deps> target/.tox-py38-embeddings/py38-embeddings/bin/python /runner/_work/beam/beam/sdks/python/test-suites/tox/py38/build/srcs/sdks/python/target/.tox-py38-embeddings/py38-embeddings/bin/pip install --retries 10 --pre sentence-transformers==2.2.2
Fri, 22 Mar 2024 17:31:16 GMT
.pkg_external: pip==24.0,setuptools==69.1.0,wheel==0.42.0
Fri, 22 Mar 2024 17:32:47 GMT
py38-pytorch-200: install_deps> target/.tox-py38-pytorch-200/py38-pytorch-200/bin/python /runner/_work/beam/beam/sdks/python/test-suites/tox/py38/build/srcs/sdks/python/target/.tox-py38-pytorch-200/py38-pytorch-200/bin/pip install --retries 10 --pre mpmath==1.3.0 'torch<2.1.0,>=2.0.0'
Fri, 22 Mar 2024 17:55:20 GMT
.pkg_external: freeze> python -m pip freeze --all
Fri, 22 Mar 2024 18:12:39 GMT
py38-transformers-430: install_deps> target/.tox-py38-transformers-430/py38-transformers-430/bin/python /runner/_work/beam/beam/sdks/python/test-suites/tox/py38/build/srcs/sdks/python/target/.tox-py38-transformers-430/py38-transformers-430/bin/pip install --retries 10 --pre tensorflow==2.12.0 'torch<1.14.0,>=1.9.0' 'transformers<4.31.0,>=4.30.0'
Fri, 22 Mar 2024 18:28:15 GMT
.pkg_external: freeze> python -m pip freeze --all

took 30 min to install sentence-transformers; 20 min to install torch and mpmath; another 10 min to install tensorflow and torch

@Abacn

Copy link
Copy Markdown
ContributorAuthor

sentence-transformers has several very large dependencies:

  • torch is 700 MB+
  • nvidia-cudnn-cu12 are both 700MB+
  • other nvidia dependencies are also several hundreds MBs

@Abacn
Abacn merged commit 7ca1a5d into masterMar 22, 2024
@Abacn
Abacn deleted the splitcoverage branch March 22, 2024 18:41
hjtran pushed a commit to hjtran/beam that referenced this pull request Apr 4, 2024
…0704)
* Move dependency tests from PreCommit Coverage to PostCommit
* Move at least one version to precommit
fail-fast: false
matrix:
job_name: [beam_PostCommit_Python_Dependency]
job_phrase: [Run Python PostCommit Dependency]

@tvalentyntvalentynMay 6, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for making this change. Do we still need to explicitly mention new suites anywhere under release/src/main/scripts or this is no longer necessary?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

It's not necessary. job_phrase for postcommit currently is not effective (#28909). I just copy-paste from existing yml which had this structure.

Sign up for freeto 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.

4 participants

@Abacn@liferoad@tvalentyn@damccorm