Skip to content

Commit

Permalink
Merge branch 'master' into BEAM-11516
Browse files Browse the repository at this point in the history
  • Loading branch information
benWize committed Sep 30, 2021
2 parents c323d98 + 3c564f8 commit aafcd6c
Show file tree
Hide file tree
Showing 135 changed files with 3,284 additions and 736 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ apiVersion: 1
deleteDatasources:

datasources:
- name: Java Tests
- name: "Java Tests"
type: marcusolsson-json-datasource
access: proxy
orgId: 1
url: https://api.github.com/repos/apache/beam/actions/workflows/java_tests.yml/runs
jsonData:
httpHeaderName1: "accept"
customQueryParameters: "per_page=100"
secureJsonData:
httpHeaderValue1: "application/vnd.github.v3+json"
editable: false
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ apiVersion: 1
deleteDatasources:

datasources:
- name: Python Tests
- name: "Python Tests"
type: marcusolsson-json-datasource
access: proxy
orgId: 1
url: https://api.github.com/repos/apache/beam/actions/workflows/python_tests.yml/runs
jsonData:
httpHeaderName1: "accept"
customQueryParameters: "per_page=100"
secureJsonData:
httpHeaderValue1: "application/vnd.github.v3+json"
editable: false
3 changes: 3 additions & 0 deletions .test-infra/metrics/kubernetes/beamgrafana-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_NAME
value: Beam
- name: GF_INSTALL_PLUGINS
value: marcusolsson-json-datasource
- name: GF_SECURITY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -89,6 +91,7 @@ spec:
volumeMounts:
- mountPath: /var/lib/grafana
name: beam-grafana-libdata
readOnly: false
- mountPath: /etc/grafana
name: beam-grafana-etcdata
- mountPath: /var/log/grafana
Expand Down
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
## I/Os

* Support for X source added (Java/Python) ([BEAM-X](https://issues.apache.org/jira/browse/BEAM-X)).
* `ReadFromBigQuery` now runs queries with BATCH priority by default. The `query_priority` parameter is introduced to the same transform to allow configuring the query priority (Python) ([BEAM-12913](https://issues.apache.org/jira/browse/BEAM-12913)).
* `ReadFromBigQuery` and `ReadAllFromBigQuery` now run queries with BATCH priority by default. The `query_priority` parameter is introduced to the same transforms to allow configuring the query priority (Python) ([BEAM-12913](https://issues.apache.org/jira/browse/BEAM-12913)).

## New Features / Improvements

Expand Down Expand Up @@ -123,7 +123,7 @@
* Code depending on beam imports need to include v2 on the module path.
* Fix by'v2' to the import paths, turning `.../sdks/go/...` to `.../sdks/v2/go/...`
* No other code change should be required to use v2.33.0 of the Go SDK.

## Deprecations

* X behavior is deprecated and will be removed in X versions ([BEAM-X](https://issues.apache.org/jira/browse/BEAM-X)).
Expand Down
10 changes: 9 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ tasks.rat {
val exclusions = mutableListOf(
// Ignore files we track but do not distribute
"**/.github/**/*",
"**/.gitkeep",
"gradlew",
"gradlew.bat",
"gradle/wrapper/gradle-wrapper.properties",
Expand Down Expand Up @@ -117,7 +118,14 @@ tasks.rat {
"sdks/python/apache_beam/runners/interactive/extensions/apache-beam-jupyterlab-sidepanel/yarn.lock",

// Sample text file for Java quickstart
"sdks/java/maven-archetypes/examples/sample.txt"
"sdks/java/maven-archetypes/examples/sample.txt",

// Ignore Flutter autogenerated files for Playground
"playground/frontend/.metadata",
"playground/frontend/pubspec.lock",

// Ignore .gitkeep file
"**/.gitkeep"
)

// Add .gitignore excludes to the Apache Rat exclusion list. We re-create the behavior
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2337,7 +2337,7 @@ class BeamModulePlugin implements Plugin<Project> {
def distTarBall = "${pythonRootDir}/build/apache-beam.tar.gz"
project.exec {
executable 'sh'
args '-c', ". ${project.ext.envdir}/bin/activate && pip install --retries 10 ${distTarBall}[gcp,test,aws,azure]"
args '-c', ". ${project.ext.envdir}/bin/activate && pip install --retries 10 ${distTarBall}[gcp,test,aws,azure,dataframe]"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/notebooks/tour-of-beam/dataframes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"[Beam DataFrames overview](https://beam.apache.org/documentation/dsls/dataframes/overview) page.\n",
"\n",
"First, we need to install Apache Beam with the `interactive` extra for the Interactive runner.",
"We also need `pandas` for this notebook, but the Interactive runner already depends on it."
"We also need to install a version of `pandas` supported by the DataFrame API, which we can get with the `dataframe` extra in Beam 2.34.0 and newer."
],
"metadata": {
"id": "hDuXLLSZnI1D"
Expand All @@ -75,7 +75,7 @@
"cell_type": "code",
"execution_count": null,
"source": [
"%pip install --quiet apache-beam[interactive]"
"%pip install --quiet apache-beam[interactive,dataframe]"
],
"outputs": [],
"metadata": {
Expand Down Expand Up @@ -663,7 +663,7 @@
"\n",
"> ℹ️ It's recommended to **only** do this if you need to use a Pandas operation that is\n",
"> [not supported in Beam DataFrames](https://beam.apache.org/documentation/dsls/dataframes/differences-from-pandas/#classes-of-unsupported-operations).\n",
"> Converting a PCollection into a Pandas DataFrame consolidates elements from potentially multiple workers into a single worker, which could create a performance bottleneck.\n"
"> Converting a PCollection into a Pandas DataFrame consolidates elements from potentially multiple workers into a single worker, which could create a performance bottleneck.\n",
"\n",
"> ⚠️ Pandas DataFrames are in-memory data structures, so make sure all the elements in the PCollection fit into memory.\n",
"> If they don't fit into memory, consider yielding multiple DataFrame elements via\n",
Expand Down
7 changes: 7 additions & 0 deletions model/pipeline/src/main/proto/beam_runner_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,14 @@ message LabelledPayload {
string string_value = 2;
bool bool_value = 3;
double double_value = 4;
int64 int_value = 5;
}

// (Required) The key identifies the actual content of the metadata.
string key = 6;

// (Required) The namespace describes the context that specified the key.
string namespace = 7;
}

// Static display data associated with a pipeline component. Display data is
Expand Down
4 changes: 4 additions & 0 deletions model/pipeline/src/main/proto/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ message MonitoringInfo {
BIGTABLE_PROJECT_ID = 20 [(label_props) = { name: "BIGTABLE_PROJECT_ID"}];
INSTANCE_ID = 21 [(label_props) = { name: "INSTANCE_ID"}];
TABLE_ID = 22 [(label_props) = { name: "TABLE_ID"}];
SPANNER_PROJECT_ID = 23 [(label_props) = { name: "SPANNER_PROJECT_ID"}];
SPANNER_DATABASE_ID = 24 [(label_props) = { name: "SPANNER_DATABASE_ID"}];
SPANNER_INSTANCE_ID = 25 [(label_props) = { name: "SPANNER_INSTANCE_ID" }];
SPANNER_QUERY_NAME = 26 [(label_props) = { name: "SPANNER_QUERY_NAME" }];
}

// A set of key and value labels which define the scope of the metric. For
Expand Down
Empty file added playground/backend/.gitkeep
Empty file.
24 changes: 24 additions & 0 deletions playground/backend/cmd/server/server.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 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.

package main

import (
"beam.apache.org/playground/backend/pkg/executors"
)

func main() {
_ = executors.GoExecutor{}
}
19 changes: 19 additions & 0 deletions playground/backend/containers/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###############################################################################
# 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.
###############################################################################

#Dokerfile to set up the Beam Go SDK
19 changes: 19 additions & 0 deletions playground/backend/containers/java/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###############################################################################
# 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.
###############################################################################

#Dokerfile to set up the Beam Java SDK
18 changes: 18 additions & 0 deletions playground/backend/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// 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.

module beam.apache.org/playground/backend

go 1.16
Empty file.
31 changes: 31 additions & 0 deletions playground/backend/pkg/executors/executor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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.

// Interface for all executors (Java/Python/Go/SCIO)
package executors

type executor interface {
// Validate validates executable file.
// Return result of validation (true/false) and error if it occurs
Validate(filePath string) (bool, error)

// Compile compiles executable file.
// Return error if it occurs
Compile(filePath string) error

// Run runs executable file.
// Return logs and error if it occurs
Run(filePath string) (string, error)
}
31 changes: 31 additions & 0 deletions playground/backend/pkg/executors/goexecutor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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.

// Executor for Go
package executors

type GoExecutor struct{}

func (goExec GoExecutor) Validate(filePath string) (bool, error) {
return true, nil
}

func (goExec GoExecutor) Compile(filePath string) error {
return nil
}

func (goExec GoExecutor) Run(filePath string) (string, error) {
return "", nil
}
31 changes: 31 additions & 0 deletions playground/backend/pkg/executors/javaexecutor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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.

// Executor for Java
package executors

type JavaExecutor struct{}

func (javaExec JavaExecutor) Validate(filePath string) (bool, error) {
return true, nil
}

func (javaExec JavaExecutor) Compile(filePath string) error {
return nil
}

func (javaExec JavaExecutor) Run(filePath string) (string, error) {
return "", nil
}
Empty file.
10 changes: 10 additions & 0 deletions playground/frontend/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: ffb2ecea5223acdd139a5039be2f9c796962833d
channel: stable

project_type: app
47 changes: 47 additions & 0 deletions playground/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
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.
-->

# Apache Beam Playground

## About

Apache Beam is an open-source, unified model for defining parallel processing pipelines for batch and streaming data.
It provides a portable API layer for building sophisticated data-parallel processing pipelines that may be executed across a diversity of execution engines, or runners.

## Getting Started

Website development requires [Flutter](https://flutter.dev/docs/get-started/install) installed.

The following command is used to build and serve the website locally:

`$ flutter run`

Run the following command to generate a release build:

`flutter build web`

Playground tests may be run using this command:

`flutter test`

Dart code should follow next [code style](https://dart-lang.github.io/linter/lints/index.html). Code may be analyzed using this command:

`flutter analyze`

The full list of command can be found [here](https://flutter.dev/docs/reference/flutter-cli)
Loading

0 comments on commit aafcd6c

Please sign in to comment.