Skip to content

Conversation

@markflyhigh
Copy link
Contributor

@markflyhigh markflyhigh commented Feb 8, 2019

Otherwise :beam-sdks-python-precommit-dataflow-py3:precommitIT will use default distribution file that's generated by Python 2 tests in same Jenkins build.

This change fix Python PostCommit failure (example link), and also correct how we build source distribution through Gradle:

cd {pySdkRoot} && python setup.py sdist instead of python {pySdkRoot}/setup.py sdist


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

It will help us expedite review of your Pull Request if you tag someone (e.g. @username) to look at it.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
Build Status --- --- ---

@markflyhigh
Copy link
Contributor Author

Run Python PostCommit

@markflyhigh
Copy link
Contributor Author

def testOpts = [
"--tests=${tests.join(',')}",
"--nocapture", // Print stdout instantly
"--processes=1", // Number of tests running in parallel
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have to set this now, and didn't have to in the past?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not required for the fix. The main reason to have this and timeout flag is to fail fast if pipeline hangs. Otherwise the build will hit Gradle timeout which is over 100mins.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I undesrtand timeout part, but not sure why we need to add --processes - is this a tox flag? What would happen in --processes=2? Do we ever want to do that?

@markflyhigh
Copy link
Contributor Author

Precommit failure (link) hit same problem in #7675.

The problem is that when running sdist, a temp directory (apache-beam-2.11.0.dev0 in this case) is created and used during build and removed at last step of sdist (see this log).

@tvalentyn
Copy link
Contributor

Looking at pypa/setuptools#1222 it seems that setuptools + distutils don't support concurrent operations on the same setup.py. To work around we could copy Python SDK sources in a separate folder, or rearchitect our gradle build to sequentially build Python 2 and Python 3 SDK distributions and then run the test suites in parallel once we have 2 tarballs.

@tvalentyn
Copy link
Contributor

Separate folder approach may provide better isolation.

@markflyhigh
Copy link
Contributor Author

#7817 put python 3 tests in separate Jenkins job.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants