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

[BEAM-6908] Refactor Python performance test groovy file for easy configuration #8518

Merged
merged 4 commits into from May 17, 2019

Conversation

markflyhigh
Copy link
Contributor

@markflyhigh markflyhigh commented May 7, 2019

Combine Python performance test groovy files into one with structured configuration block. Adding a new python performance test job can be simply as adding a PerformanceTestConfigurations into testConfigurations list.


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).
  • 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.

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
Build Status --- --- ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@markflyhigh markflyhigh changed the title Refactor Python performance test groovy file for easy configuration [BEAM-6908] Refactor Python performance test groovy file for easy configuration May 7, 2019
@markflyhigh
Copy link
Contributor Author

Run Seed Job

@markflyhigh
Copy link
Contributor Author

Run Python Performance Test

@markflyhigh
Copy link
Contributor Author

Run Python35 Performance Test

@markflyhigh
Copy link
Contributor Author

markflyhigh commented May 7, 2019

+R: @tvalentyn @yifanzou

Copy link
Contributor

@yifanzou yifanzou left a comment

Choose a reason for hiding this comment

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

LGTM

.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
@markflyhigh
Copy link
Contributor Author

Run Seed Job

@markflyhigh
Copy link
Contributor Author

Run Python35 Performance Test

@markflyhigh
Copy link
Contributor Author

PTAL @yifanzou

.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
String sdk = 'python'
String bigqueryTable
String itClass
String itModule
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the meaning of this? I am confused by how this is actually used.

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 a benchmark flag defined in here. Basically it's the path of Gradle module.

Copy link
Contributor

Choose a reason for hiding this comment

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

How do we know how to set this correctly? It seems not intuitive...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can rename it something like itGradleModule if helps.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, but how do we know which gradle module to select? I see that you used a different value for Py2 and Py3 benchmark, how did you pick those specific ones? How does a person writing an new benchmark decides how to fill this value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think people should know how Perfkit beam_integration_benchmark works before configuring in Jenkins. Probably we need better document for that, and also happy to sync with you offline for more details.

For you question, beam_integration_benchmark uses Gradle task integrationTest which can be enabled through enablePythonPerformanceTest. So beam_it_module is the Gradle project where integrationTest located.

Copy link
Contributor

Choose a reason for hiding this comment

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

Per offline discussion, let's add a comment here:
Gradle project that defines 'runIntegrationTest' task. This task is executed by Perfkit Beam benchmark launcher.
This task can be added by enablePythonPerformanceTest() defined in BeamModulePlugin.

.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
bigqueryTable : 'beam_performance.wordcount_py35_pkb_results',
skipPrebuild : true,
pythonSdkLocation : 'test-suites/dataflow/py35/build/apache-beam.tar.gz',
itClass : 'apache_beam.examples.wordcount_it_test:WordCountIT.test_wordcount_it',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is my understanding right that each performance test configuration can run only one IT? We might want to always include 'wordcount' in configuration flags or always omit if the suite will later include other benchmarks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it can run multiple ITs if you want. itClass will be passed to classname of this function and eventually to -Dtests of the Gradle invocation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, but we will not get one test reading per each test, instead we will run both tests, and get a total runtime, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. This flag defines what tests run in a Gradle execution, and the benchmark will evaluate whole Gradle execution.

Copy link
Contributor

Choose a reason for hiding this comment

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

So in this case it's one test per configuration, so we may want to call it "WordCount" benchmark, instead of generic 'Performance test'.
Also, where do we specify the input for the WC pipeline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sg. done

jobTriggerPhrase : 'Run Python35 Performance Test',
bigqueryTable : 'beam_performance.wordcount_py35_pkb_results',
skipPrebuild : true,
pythonSdkLocation : 'test-suites/dataflow/py35/build/apache-beam.tar.gz',
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can always use the same location here. As I mentioned before, there is no difference which interpreter version to use to create tarball.
If we must specify location per suite, perhaps we could have one parameter, such as testRoot and evaluate sdkLocation and itModule value from that parameter. As mentioned above I also am not sure what itModule is for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, tar file is generated in build directory of the Gradle module where IT is located. We need to specify location per test. We can populate sdkLocation from itModule directly and in the future we could refactor Gradle build to generate tar file only once. markflyhigh#6 is a draft.

.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
@tvalentyn
Copy link
Contributor

Thanks, @markflyhigh !

@markflyhigh markflyhigh force-pushed the py-perf-combine-groovy branch 2 times, most recently from 1a38f42 to 798ca0a Compare May 8, 2019 20:29
@markflyhigh
Copy link
Contributor Author

markflyhigh commented May 8, 2019

Updated comments to parameters in PerformanceTestConfigurations and addressed few questions.
PTAL @tvalentyn

@markflyhigh
Copy link
Contributor Author

Run Seed Job

@markflyhigh
Copy link
Contributor Author

Run Python35 Performance Test

@markflyhigh
Copy link
Contributor Author

Run Seed Job

@markflyhigh
Copy link
Contributor Author

Run Python35 Performance Test

String sdk = 'python'
String bigqueryTable
String itClass
String itModule
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we know how to set this correctly? It seems not intuitive...

.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
bigqueryTable : 'beam_performance.wordcount_py35_pkb_results',
skipPrebuild : true,
pythonSdkLocation : 'test-suites/dataflow/py35/build/apache-beam.tar.gz',
itClass : 'apache_beam.examples.wordcount_it_test:WordCountIT.test_wordcount_it',
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, but we will not get one test reading per each test, instead we will run both tests, and get a total runtime, right?

@markflyhigh
Copy link
Contributor Author

PTAL @tvalentyn

Copy link
Contributor

@tvalentyn tvalentyn left a comment

Choose a reason for hiding this comment

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

Thanks, a few more comments.

benchmarks : testConfig.benchmarkName,
bigquery_table : testConfig.resultTable,
beam_it_class : testConfig.itClass,
beam_it_module : testConfig.itModule,
beam_prebuilt : testConfig.prebuilt.toString(),
beam_prebuilt : 'true',
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a comment above why this value needs to be true?

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

Copy link
Contributor

Choose a reason for hiding this comment

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

The comment says // always true for Python tests but does not explain why this needs to be true, so this configuration bit remains a little cryptic... Could we add a simple explanation?

bigqueryTable : 'beam_performance.wordcount_py35_pkb_results',
skipPrebuild : true,
pythonSdkLocation : 'test-suites/dataflow/py35/build/apache-beam.tar.gz',
itClass : 'apache_beam.examples.wordcount_it_test:WordCountIT.test_wordcount_it',
Copy link
Contributor

Choose a reason for hiding this comment

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

So in this case it's one test per configuration, so we may want to call it "WordCount" benchmark, instead of generic 'Performance test'.
Also, where do we specify the input for the WC pipeline?

String sdk = 'python'
String bigqueryTable
String itClass
String itModule
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, but how do we know which gradle module to select? I see that you used a different value for Py2 and Py3 benchmark, how did you pick those specific ones? How does a person writing an new benchmark decides how to fill this value?

.test-infra/jenkins/job_PerformanceTests_Python.groovy Outdated Show resolved Hide resolved
@markflyhigh
Copy link
Contributor Author

PTAL @tvalentyn

Copy link
Contributor

@tvalentyn tvalentyn left a comment

Choose a reason for hiding this comment

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

Thanks, @markflyhigh, overall LGTM.

Left one comment inline, also, is there a link on somewhere on Beam website that points to results produced by these benchmarks?

If not, could we add it please?

@tvalentyn
Copy link
Contributor

tvalentyn commented May 15, 2019

CC: @manisha252 who is working on performance test infrastructure and may have additional input here.

@markflyhigh
Copy link
Contributor Author

markflyhigh commented May 15, 2019

Thank you @tvalentyn.

To your question, results are stored in Bigquery table which should be accessible from UI or gcloud commandline. Different job is likely to use own table and configured in testConfigurations so it's not possible to provide a static link in groovy file. I'll write up a document for Python performance test and I can include this info.

@tvalentyn
Copy link
Contributor

I meant that we should have some pointers in Beam documentation that can point to existence of these benchmarks and dashboards they produce.

@markflyhigh
Copy link
Contributor Author

Run Seed Job

@markflyhigh
Copy link
Contributor Author

Run Python35 WordCountIT Performance Test

@markflyhigh
Copy link
Contributor Author

@tvalentyn I can add link of Bigquery table and dashboard in Beam doc. Also fixed the comment for beam_prebuilt.

Synced with @manisha252 offline and got approved for this change.

@markflyhigh markflyhigh merged commit d77474d into apache:master May 17, 2019
ajamato pushed a commit to ajamato/beam that referenced this pull request May 18, 2019
…figuration (apache#8518)

Refactor Python performance test groovy file for easy configuration.
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.

None yet

3 participants