Skip to content

Commit

Permalink
Merge branch 'master' into issue23692_auth
Browse files Browse the repository at this point in the history
  • Loading branch information
darkhan.nausharipov committed Jan 9, 2023
2 parents fddeaee + 95e5391 commit dc4e142
Show file tree
Hide file tree
Showing 510 changed files with 37,979 additions and 3,807 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/go_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,9 @@ jobs:
- name: Run vet
run: |
cd sdks/go/pkg/beam
VOUT=$(go vet --copylocks=false --unsafeptr=false ./...)
if [ -n "$VOUT" ]; then
echo -e "Run go vet and fix warnings before checking in changes\n"
echo -e "Vet Warnings:\n"
echo -e "$VOUT" && exit 1
fi
go vet --copylocks=false --unsafeptr=false ./...
- name: Run Staticcheck
run: |
go install "honnef.co/go/tools/cmd/staticcheck@2022.1"
cd sdks/go/pkg/beam
RESULTS=$($(go env GOPATH)/bin/staticcheck ./...)
if [ -n "$RESULTS" ]; then
echo -e "Please address Staticcheck warnings before checking in changes\n"
echo -e "Staticcheck Warnings:\n"
echo -e "$RESULTS" && exit 1
fi
$(go env GOPATH)/bin/staticcheck ./...
1 change: 1 addition & 0 deletions .github/workflows/playground_examples_ci_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
working-directory: playground/infrastructure
env:
BEAM_ROOT_DIR: "../.."
BEAM_EXAMPLE_CATEGORIES: "../categories.yaml"

ci_cd:
name: ${{ inputs.step }} ${{ inputs.sdk }} ${{ inputs.origin }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/typescript_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
typescript_xlang_tests:
name: 'TypeScript xlang Tests'
runs-on: [self-hosted, ubuntu-20.04]
timeout-minutes: 10
strategy:
fail-fast: false
steps:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ website/www/yarn-error.log
**/.packages
**/generated_plugin_registrant.dart
playground/frontend/playground_components/pubspec.lock
playground/frontend/playground_components/test/tools/extract_symbols_java/dependencies
playground/frontend/playground_components_dev/pubspec.lock

# Ignore Beam Playground Terraform
**/.terraform
Expand All @@ -136,4 +138,4 @@ playground/frontend/playground_components/pubspec.lock
**/*.tfvars

# Ignore Katas auto-generated files
**/*-remote-info.yaml
**/*-remote-info.yaml
18 changes: 11 additions & 7 deletions .test-infra/jenkins/README.md

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions .test-infra/jenkins/job_CloudMLBenchmarkTests_Python.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import CommonJobProperties as commonJobProperties
import PhraseTriggeringPostCommitBuilder
import CronJobBuilder

def cloudMLJob = { scope ->
scope.description('Runs the TFT Criteo Examples on the Dataflow runner.')

// Set common parameters.
commonJobProperties.setTopLevelMainJobProperties(scope, 'master', 360)

// Gradle goals for this job.
scope.steps {
gradle {
rootBuildScriptDir(commonJobProperties.checkoutDir)
commonJobProperties.setGradleSwitches(delegate)
tasks(':sdks:python:test-suites:dataflow:tftTests')
}
}
}

PhraseTriggeringPostCommitBuilder.postCommitJob(
'beam_CloudML_Benchmarks_Dataflow',
'Run TFT Criteo Benchmarks',
'TFT Criteo benchmarks on Dataflow(\"Run TFT Criteo Benchmarks"\"")',
this
) {
cloudMLJob(delegate)
}

CronJobBuilder.cronJob(
'beam_CloudML_Benchmarks_Dataflow',
'H 14 * * *',
this
) {
cloudMLJob(delegate)
}
3 changes: 1 addition & 2 deletions .test-infra/jenkins/job_LoadTests_Combine_Python.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ def loadTestConfigurations = { datasetName, mode ->

def addStreamingOptions(test){
test.pipelineOptions << [streaming: null,
// TODO(https://github.com/apache/beam/issues/20806) remove shuffle_mode=appliance with runner v2 once issue is resolved.
experiments: "use_runner_v2,shuffle_mode=appliance"
experiments: "use_runner_v2"
]
}

Expand Down
3 changes: 1 addition & 2 deletions .test-infra/jenkins/job_LoadTests_GBK_Python.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ def addStreamingOptions(test) {
// Use the new Dataflow runner, which offers improved efficiency of Dataflow jobs.
// See https://cloud.google.com/dataflow/docs/guides/deploying-a-pipeline#dataflow-runner-v2
// for more details.
// TODO(https://github.com/apache/beam/issues/20806) remove shuffle_mode=appliance with runner v2 once issue is resolved.
experiments: 'use_runner_v2,shuffle_mode=appliance',
experiments: 'use_runner_v2',
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ def addStreamingOptions(test) {
// Use the new Dataflow runner, which offers improved efficiency of Dataflow jobs.
// See https://cloud.google.com/dataflow/docs/guides/deploying-a-pipeline#dataflow-runner-v2
// for more details.
// TODO(https://github.com/apache/beam/issues/20806) remove shuffle_mode=appliance with runner v2 once issue is resolved.
experiments: 'use_runner_v2,shuffle_mode=appliance',
experiments: 'use_runner_v2',
]
}

Expand Down
3 changes: 1 addition & 2 deletions .test-infra/jenkins/job_LoadTests_ParDo_Python.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ def addStreamingOptions(test) {
// Use the new Dataflow runner, which offers improved efficiency of Dataflow jobs.
// See https://cloud.google.com/dataflow/docs/guides/deploying-a-pipeline#dataflow-runner-v2
// for more details.
// TODO(https://github.com/apache/beam/issues/20806) remove shuffle_mode=appliance with runner v2 once issue is resolved.
experiments: 'use_runner_v2,shuffle_mode=appliance',
experiments: 'use_runner_v2',
]
}

Expand Down
3 changes: 1 addition & 2 deletions .test-infra/jenkins/job_LoadTests_SideInput_Python.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def fromTemplate = { mode, name, id, datasetName, testSpecificOptions ->
influx_measurement : "python_${mode}_sideinput_${id}",
num_workers : 10,
autoscaling_algorithm: 'NONE',
// TODO(https://github.com/apache/beam/issues/20806) remove shuffle_mode=appliance with runner v2 once issue is resolved.
experiments : 'use_runner_v2,shuffle_mode=appliance',
experiments : 'use_runner_v2',
] << testSpecificOptions
]
}
Expand Down
11 changes: 5 additions & 6 deletions .test-infra/jenkins/job_PerformanceTests_KafkaIO_IT.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ String HIGH_RANGE_PORT = "32767"
*/
job(jobName) {
common.setTopLevelMainJobProperties(delegate, 'master', 120)
common.setAutoJob(delegate, 'H H/6 * * *')
common.setAutoJob(delegate, 'H H/12 * * *')
common.enablePhraseTriggeringFromPullRequest(
delegate,
'Java KafkaIO Performance Test',
Expand Down Expand Up @@ -97,17 +97,16 @@ job(jobName) {
Map dataflowRunnerV2SdfPipelineOptions = pipelineOptions + [
sourceOptions : """
{
"numRecords": "100000",
"keySizeBytes": "1",
"numRecords": "100000000",
"keySizeBytes": "10",
"valueSizeBytes": "90"
}
""".trim().replaceAll("\\s", ""),
kafkaTopic : 'beam-sdf',
readTimeout : '900',
readTimeout : '1500',
bigQueryTable : 'kafkaioit_results_runner_v2',
influxMeasurement : 'kafkaioit_results_runner_v2',
// TODO(https://github.com/apache/beam/issues/20806) remove shuffle_mode=appliance with runner v2 once issue is resolved.
experiments : 'use_runner_v2,shuffle_mode=appliance,use_unified_worker',
experiments : 'use_runner_v2,use_unified_worker',
]

steps {
Expand Down
8 changes: 6 additions & 2 deletions .test-infra/jenkins/job_PerformanceTests_SQLIO_Java.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def jobConfigs = [
[
title : 'SQL BigQueryIO with push-down Batch Performance Test Java',
triggerPhrase: 'Run SQLBigQueryIO Batch Performance Test Java',
name : 'beam_SQLBigQueryIO_Batch_Performance_Test_Java',
name : 'beam_PerformanceTests_SQLBigQueryIO_Batch_Java',
previousName : 'beam_SQLBigQueryIO_Batch_Performance_Test_Java/',
itClass : 'org.apache.beam.sdk.extensions.sql.meta.provider.bigquery.BigQueryIOPushDownIT',
properties: [
project : 'apache-beam-testing',
Expand All @@ -44,7 +45,10 @@ private void createPostCommitJob(jobConfig) {
description(jobConfig.description)
common.setTopLevelMainJobProperties(delegate)
common.enablePhraseTriggeringFromPullRequest(delegate, jobConfig.title, jobConfig.triggerPhrase)
common.setAutoJob(delegate, 'H H/6 * * *')
common.setAutoJob(delegate, 'H H/12 * * *')
if (jobConfig.containsKey('previousName')) {
previousNames(jobConfig.previousName)
}
publishers {
archiveJunit('**/build/test-results/**/*.xml')
}
Expand Down
123 changes: 123 additions & 0 deletions .test-infra/jenkins/job_PerformanceTests_xlang_KafkaIO_Python.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import CommonJobProperties as common
import Kubernetes
import LoadTestsBuilder as loadTestsBuilder
import InfluxDBCredentialsHelper

def jobs = [
[
name : 'beam_PerformanceTests_xlang_KafkaIO_Python',
description : 'Runs performance tests for xlang Python KafkaIO',
test : 'apache_beam.io.external.xlang_kafkaio_perf_test',
githubTitle : 'Python xlang KafkaIO Performance Test',
githubTriggerPhrase: 'Run Python xlang KafkaIO Performance Test',
pipelineOptions : [
publish_to_big_query : true,
metrics_dataset : 'beam_performance',
metrics_table : 'python_kafkaio_results',
influx_measurement : 'python_kafkaio_results',
test_class : 'KafkaIOPerfTest',
input_options : """'{
"num_records": 100000000,
"key_size": 10,
"value_size": 90
}'""".trim().replaceAll("\\s", ""),
kafka_topic : 'beam',
read_timeout : '1500',
num_workers : '5',
autoscaling_algorithm: 'NONE'
]
]
]

jobs.findAll {
it.name in [
// all tests that enabled
'beam_PerformanceTests_xlang_KafkaIO_Python',
]
}.forEach { testJob -> createKafkaIOTestJob(testJob) }

private void createKafkaIOTestJob(testJob) {
job(testJob.name) {
description(testJob.description)
common.setTopLevelMainJobProperties(delegate)
common.enablePhraseTriggeringFromPullRequest(delegate, testJob.githubTitle, testJob.githubTriggerPhrase)
common.setAutoJob(delegate, 'H H * * *')
InfluxDBCredentialsHelper.useCredentials(delegate)

// Setup kafka k8s pods
String namespace = common.getKubernetesNamespace(testJob.name)
String kubeconfig = common.getKubeconfigLocationForNamespace(namespace)
Kubernetes k8s = Kubernetes.create(delegate, kubeconfig, namespace)
String kafkaDir = common.makePathAbsolute("src/.test-infra/kubernetes/kafka-cluster")
String kafkaTopicJob = "job.batch/kafka-config-eff079ec"

/**
* Specifies steps to avoid port collisions when the Kafka outside services (1,2,3) are created.
Function k8s.availablePort finds unused ports in the Kubernetes cluster in a range from 32400
to 32767 by querying used ports, those ports are stored in env vars like KAFKA_SERVICE_PORT_${service},
which are used to replace default ports for outside-${service}.yml files, before the apply command.
*/
steps {
String[] configuredPorts = ["32400", "32401", "32402"]
String HIGH_RANGE_PORT = "32767"
(0..2).each { service ->
k8s.availablePort(service == 0 ? configuredPorts[service] : "\$KAFKA_SERVICE_PORT_${service-1}",
HIGH_RANGE_PORT, "KAFKA_SERVICE_PORT_$service")
shell("sed -i -e s/${configuredPorts[service]}/\$KAFKA_SERVICE_PORT_$service/ \
${kafkaDir}/04-outside-services/outside-${service}.yml")
}
gradle {
rootBuildScriptDir(common.checkoutDir)
tasks(':sdks:java:io:expansion-service:shadowJar')
}
}
k8s.apply(kafkaDir)
(0..2).each { k8s.loadBalancerIP("outside-$it", "KAFKA_BROKER_$it") }
k8s.waitForJob(kafkaTopicJob,"40m")

additionalPipelineArgs = [
influx_db_name: InfluxDBCredentialsHelper.InfluxDBDatabaseName,
influx_hostname: InfluxDBCredentialsHelper.InfluxDBHostUrl,
bootstrap_servers: "\$KAFKA_BROKER_0:\$KAFKA_SERVICE_PORT_0,\$KAFKA_BROKER_1:\$KAFKA_SERVICE_PORT_1," +
"\$KAFKA_BROKER_2:\$KAFKA_SERVICE_PORT_2", //KAFKA_BROKER_ represents IP and KAFKA_SERVICE_ port of outside services
]
testJob.pipelineOptions.putAll(additionalPipelineArgs)

def dataflowSpecificOptions = [
runner : 'DataflowRunner',
project : 'apache-beam-testing',
region : 'us-central1',
temp_location : 'gs://temp-storage-for-perf-tests/',
filename_prefix : "gs://temp-storage-for-perf-tests/${testJob.name}/\${BUILD_ID}/",
sdk_harness_container_image_overrides: '.*java.*,gcr.io/apache-beam-testing/beam-sdk/beam_java8_sdk:latest'
]

Map allPipelineOptions = dataflowSpecificOptions << testJob.pipelineOptions

loadTestsBuilder.loadTest(
delegate,
testJob.name,
CommonTestProperties.Runner.DATAFLOW,
CommonTestProperties.SDK.PYTHON,
allPipelineOptions,
testJob.test)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@
* limitations under the License.
*/
import CommonJobProperties as common
import PostcommitJobBuilder
import Kubernetes

String jobName = "beam_PerformanceTests_InfluxDbIO_IT"
String jobName = "beam_PostCommit_Java_InfluxDbIO_IT"

job(jobName) {
PostcommitJobBuilder.postCommitJob(jobName, 'Run Java InfluxDbIO_IT', 'Java InfluxDbIO Integration Test', this) {
description('Runs the Java InfluxDbIO Integration Test.')
previousNames(/beam_PerformanceTests_InfluxDbIO_IT/)
// Set common parameters.
common.setTopLevelMainJobProperties(delegate, 'master', 240, true, 'beam-perf')
common.setAutoJob(delegate,'H H/6 * * *')
common.enablePhraseTriggeringFromPullRequest(
delegate,
'Java InfluxDbIO Performance Test',
'Run Java InfluxDbIO Performance Test')
common.setTopLevelMainJobProperties(delegate)

// Deploy InfluxDb cluster
String namespace = common.getKubernetesNamespace(jobName)
String kubeconfigPath = common.getKubeconfigLocationForNamespace(namespace)
Kubernetes k8s = Kubernetes.create(delegate, kubeconfigPath, namespace)
Expand Down
4 changes: 3 additions & 1 deletion .test-infra/jenkins/job_sonarqube_report.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ job('beam_sonarqube_report') {
}
}

commonJobProperties.setAutoJob delegate

// TODO(https://github.com/apache/beam/issues/24768) remove or fix this job.
// commonJobProperties.setAutoJob delegate

publishers {
archiveJunit('**/build/test-results/**/*.xml')
Expand Down
Loading

0 comments on commit dc4e142

Please sign in to comment.