diff --git a/.test-infra/jenkins/job_beam_PerformanceTests_JDBC.groovy b/.test-infra/jenkins/job_beam_PerformanceTests_JDBC.groovy index ef73a261b0c4..1e5131f3ddf5 100644 --- a/.test-infra/jenkins/job_beam_PerformanceTests_JDBC.groovy +++ b/.test-infra/jenkins/job_beam_PerformanceTests_JDBC.groovy @@ -19,45 +19,63 @@ import common_job_properties // This job runs the Beam performance tests on PerfKit Benchmarker. -job('beam_PerformanceTests_JDBC'){ +job('beam_PerformanceTests_JDBC') { // Set default Beam job properties. common_job_properties.setTopLevelMainJobProperties(delegate) // Run job in postcommit every 6 hours, don't trigger every push, and // don't email individual committers. common_job_properties.setPostCommit( - delegate, - '0 */6 * * *', - false, - 'commits@beam.apache.org', - false) + delegate, + '0 */6 * * *', + false, + 'commits@beam.apache.org', + false) + + common_job_properties.enablePhraseTriggeringFromPullRequest( + delegate, + 'Java JdbcIO Performance Test', + 'Run Java JdbcIO Performance Test') def pipelineArgs = [ - tempRoot: 'gs://temp-storage-for-end-to-end-tests', - project: 'apache-beam-testing', - postgresServerName: '10.36.0.11', - postgresUsername: 'postgres', - postgresDatabaseName: 'postgres', - postgresPassword: 'uuinkks', - postgresSsl: 'false' + tempRoot : 'gs://temp-storage-for-perf-tests', + project : 'apache-beam-testing', + postgresPort : '5432', + numberOfRecords: '5000000' ] - def pipelineArgList = [] - pipelineArgs.each({ - key, value -> pipelineArgList.add("--$key=$value") - }) - def pipelineArgsJoined = pipelineArgList.join(',') - - def argMap = [ - benchmarks: 'beam_integration_benchmark', - beam_it_module: 'sdks/java/io/jdbc', - beam_it_args: pipelineArgsJoined, - beam_it_class: 'org.apache.beam.sdk.io.jdbc.JdbcIOIT', - // Profile is located in $BEAM_ROOT/sdks/java/io/pom.xml. - beam_it_profile: 'io-it' + + def testArgs = [ + kubeconfig : '"$HOME/.kube/config"', + beam_it_timeout : '1800', + benchmarks : 'beam_integration_benchmark', + beam_it_profile : 'io-it', + beam_prebuilt : 'true', + beam_sdk : 'java', + beam_it_module : 'sdks/java/io/jdbc', + beam_it_class : 'org.apache.beam.sdk.io.jdbc.JdbcIOIT', + beam_it_options : joinPipelineOptions(pipelineArgs), + beam_kubernetes_scripts : makePathAbsolute('src/.test-infra/kubernetes/postgres/postgres.yml') + + ',' + makePathAbsolute('src/.test-infra/kubernetes/postgres/postgres-service-for-local-dev.yml'), + beam_options_config_file: makePathAbsolute('src/.test-infra/kubernetes/postgres/pkb-config-local.yml'), + bigquery_table : 'beam_performance.jdbcioit_pkb_results' ] - common_job_properties.buildPerformanceTest(delegate, argMap) + steps { + // create .kube/config file for perfkit (if not exists) + shell('gcloud container clusters get-credentials io-datastores --zone=us-central1-a --verbosity=debug') + } - // [BEAM-2141] Perf tests do not pass. - disabled() + common_job_properties.buildPerformanceTest(delegate, testArgs) } + +static String joinPipelineOptions(Map pipelineArgs) { + List pipelineArgList = [] + pipelineArgs.each({ + key, value -> pipelineArgList.add("\"--$key=$value\"") + }) + return "[" + pipelineArgList.join(',') + "]" +} + +static String makePathAbsolute(String path) { + return '"$WORKSPACE/' + path + '"' +} \ No newline at end of file