From 88f79835c6c1340754298dadd8d950632d296757 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Wed, 13 Jan 2021 13:32:13 -0800 Subject: [PATCH 1/5] Add Tour of Beam page --- .../content/en/get-started/beam-overview.md | 2 +- .../content/en/get-started/tour-of-beam.md | 73 +++++++++++++++++++ .../content/en/get-started/try-apache-beam.md | 2 +- website/www/site/i18n/home/en.yaml | 6 +- website/www/site/layouts/index.html | 3 +- .../partials/section-menu/en/get-started.html | 1 + .../site/layouts/shortcodes/row-colab.html | 29 ++++++++ 7 files changed, 110 insertions(+), 6 deletions(-) create mode 100644 website/www/site/content/en/get-started/tour-of-beam.md create mode 100644 website/www/site/layouts/shortcodes/row-colab.html diff --git a/website/www/site/content/en/get-started/beam-overview.md b/website/www/site/content/en/get-started/beam-overview.md index 73c05eb8f06d..7b15712a876f 100644 --- a/website/www/site/content/en/get-started/beam-overview.md +++ b/website/www/site/content/en/get-started/beam-overview.md @@ -59,7 +59,7 @@ Get started using Beam for your data processing tasks. > If you already know [Apache Spark](http://spark.apache.org/), > check our [Getting started from Apache Spark](/get-started/from-spark) page. -1. [Try Apache Beam](/get-started/try-apache-beam) in an online interactive environment. +1. Take the [Tour of Beam](/get-started/tour-of-beam) as an online interactive learning experience. 1. Follow the Quickstart for the [Java SDK](/get-started/quickstart-java), the [Python SDK](/get-started/quickstart-py), or the [Go SDK](/get-started/quickstart-go). diff --git a/website/www/site/content/en/get-started/tour-of-beam.md b/website/www/site/content/en/get-started/tour-of-beam.md new file mode 100644 index 000000000000..66101ddb0ab3 --- /dev/null +++ b/website/www/site/content/en/get-started/tour-of-beam.md @@ -0,0 +1,73 @@ +--- +title: "Tour of Beam" +--- + + + +# Tour of Beam + +Here you can find a collection of the interactive notebooks available for Apache Beam, which are hosted in +[Colab](https://colab.research.google.com). +The notebooks allow you to interactively play with the code and see how your changes affect the pipeline. +You don't need to install anything or modify your computer in any way to use these notebooks. + +You can also [try an Apache Beam pipeline](/get-started/try-apache-beam) using the Java, Python, and Go SDKs. + +## Get started + +{{< table >}} + + + + {{< row-colab + title="Learn the basics" + body="In this notebook we go through the basics of what is Apache Beam and how to get started." + button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/tour-of-beam/getting-started.ipynb" >}} +
+{{< /table >}} + +## Transforms + +Check the [Python transform catalog](/documentation/transforms/python/overview/) +for a complete list of the available transforms. + +### Element-wise transforms + +{{< table >}} + + + + {{< row-colab + title="Map" + body="Applies a simple one-to-one mapping function over each element in the collection." + button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/map-py.ipynb" >}} + {{< row-colab + title="FlatMap" + body="Applies a simple one-to-many mapping function over each element in the collection. The many elements are flattened into the resulting collection." + button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/flatmap-py.ipynb" >}} + {{< row-colab + title="Filter" + body="Given a predicate, filter out all elements that don’t satisfy that predicate." + button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/filter-py.ipynb" >}} + {{< row-colab + title="Partition" + body="Separates elements in a collection into multiple output collections." + button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/partition-py.ipynb" >}} + {{< row-colab + title="ParDo" + body="A transform for generic parallel processing. It's recommended to use Map, FlatMap, Filter or other more specific transforms when possible." + button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/pardo-py.ipynb" >}} +
+{{< /table >}} diff --git a/website/www/site/content/en/get-started/try-apache-beam.md b/website/www/site/content/en/get-started/try-apache-beam.md index dac27d4cf0c4..e7d05c71b912 100644 --- a/website/www/site/content/en/get-started/try-apache-beam.md +++ b/website/www/site/content/en/get-started/try-apache-beam.md @@ -17,7 +17,7 @@ limitations under the License. # Try Apache Beam -You can try Apache Beam using our interactive notebooks, which are hosted in [Colab](https://colab.research.google.com). The notebooks allow you to interactively play with the code and see how your changes affect the pipeline. You don't need to install anything or modify your computer in any way to use these notebooks. +You can try an Apache Beam pipeline using our interactive notebooks. {{< language-switcher java py go >}} diff --git a/website/www/site/i18n/home/en.yaml b/website/www/site/i18n/home/en.yaml index cbb3f23a78c3..359267305b4c 100644 --- a/website/www/site/i18n/home/en.yaml +++ b/website/www/site/i18n/home/en.yaml @@ -9,15 +9,15 @@ # 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. - + - id: home-hero-title translation: "Apache Beam: An advanced unified programming model" - id: home-hero-subtitle translation: "Implement batch and streaming data processing jobs that run on any execution engine." - id: home-learn-more translation: "Learn more" -- id: home-try-beam - translation: "Try Beam" +- id: home-tour-of-beam + translation: "Tour of Beam" - id: home-download-beam translation: "Download Beam SDK {{ .Site.Params.release_latest }}" - id: home-java-quickstart diff --git a/website/www/site/layouts/index.html b/website/www/site/layouts/index.html index e1f69be4c2f2..cb8a6b66418d 100644 --- a/website/www/site/layouts/index.html +++ b/website/www/site/layouts/index.html @@ -24,7 +24,7 @@
{{ T "home-learn-more" }} - {{ T "home-try-beam" }} + {{ T "home-tour-of-beam" }} {{ T "home-download-beam" . }}
@@ -139,6 +139,7 @@
{{ T "home-learn-more" }} + {{ T "home-tour-of-beam" }} {{ T "home-download-beam" . }}
diff --git a/website/www/site/layouts/partials/section-menu/en/get-started.html b/website/www/site/layouts/partials/section-menu/en/get-started.html index 2c6c850a307b..70e35d911abc 100644 --- a/website/www/site/layouts/partials/section-menu/en/get-started.html +++ b/website/www/site/layouts/partials/section-menu/en/get-started.html @@ -12,6 +12,7 @@
  • Get started
  • Beam Overview
  • +
  • Tour of Beam
  • Quickstarts diff --git a/website/www/site/layouts/shortcodes/row-colab.html b/website/www/site/layouts/shortcodes/row-colab.html new file mode 100644 index 000000000000..0f4fcc8e44c8 --- /dev/null +++ b/website/www/site/layouts/shortcodes/row-colab.html @@ -0,0 +1,29 @@ +{{/* +Licensed 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. See accompanying LICENSE file. +*/}} + + + +

    {{ .Get `title` }}

    +

    {{ .Get `body` }}

    + + + + +
    + + {{ .Get `button_text` }} + Run in Colab + +
    + + From ea4a47f111281c9661d5e30d62989c42d785173e Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Fri, 5 Feb 2021 14:27:49 -0800 Subject: [PATCH 2/5] Removed table layout --- .../content/en/get-started/tour-of-beam.md | 70 +++++++++---------- .../{row-colab.html => button-colab.html} | 24 +++---- 2 files changed, 43 insertions(+), 51 deletions(-) rename website/www/site/layouts/shortcodes/{row-colab.html => button-colab.html} (57%) diff --git a/website/www/site/content/en/get-started/tour-of-beam.md b/website/www/site/content/en/get-started/tour-of-beam.md index 66101ddb0ab3..2312e911f426 100644 --- a/website/www/site/content/en/get-started/tour-of-beam.md +++ b/website/www/site/content/en/get-started/tour-of-beam.md @@ -27,16 +27,11 @@ You can also [try an Apache Beam pipeline](/get-started/try-apache-beam) using t ## Get started -{{< table >}} - - - - {{< row-colab - title="Learn the basics" - body="In this notebook we go through the basics of what is Apache Beam and how to get started." - button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/tour-of-beam/getting-started.ipynb" >}} -
    -{{< /table >}} +### Learn the basics + +In this notebook we go through the basics of what is Apache Beam and how to get started. + +{{< button-colab url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/tour-of-beam/getting-started.ipynb" >}} ## Transforms @@ -45,29 +40,32 @@ for a complete list of the available transforms. ### Element-wise transforms -{{< table >}} - - - - {{< row-colab - title="Map" - body="Applies a simple one-to-one mapping function over each element in the collection." - button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/map-py.ipynb" >}} - {{< row-colab - title="FlatMap" - body="Applies a simple one-to-many mapping function over each element in the collection. The many elements are flattened into the resulting collection." - button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/flatmap-py.ipynb" >}} - {{< row-colab - title="Filter" - body="Given a predicate, filter out all elements that don’t satisfy that predicate." - button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/filter-py.ipynb" >}} - {{< row-colab - title="Partition" - body="Separates elements in a collection into multiple output collections." - button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/partition-py.ipynb" >}} - {{< row-colab - title="ParDo" - body="A transform for generic parallel processing. It's recommended to use Map, FlatMap, Filter or other more specific transforms when possible." - button_url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/pardo-py.ipynb" >}} -
    -{{< /table >}} +#### Map + +Applies a simple one-to-one mapping function over each element in the collection. + +{{< button-colab url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/map-py.ipynb" >}} + +#### FlatMap + +Applies a simple one-to-many mapping function over each element in the collection. The many elements are flattened into the resulting collection. + +{{< button-colab url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/flatmap-py.ipynb" >}} + +#### Filter + +Given a predicate, filter out all elements that don’t satisfy that predicate. + +{{< button-colab url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/filter-py.ipynb" >}} + +#### Partition + +Separates elements in a collection into multiple output collections. + +{{< button-colab url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/partition-py.ipynb" >}} + +#### ParDo + +A transform for generic parallel processing. It's recommended to use `Map`, `FlatMap`, `Filter` or other more specific transforms when possible. + +{{< button-colab url="https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/documentation/transforms/python/elementwise/pardo-py.ipynb" >}} diff --git a/website/www/site/layouts/shortcodes/row-colab.html b/website/www/site/layouts/shortcodes/button-colab.html similarity index 57% rename from website/www/site/layouts/shortcodes/row-colab.html rename to website/www/site/layouts/shortcodes/button-colab.html index 0f4fcc8e44c8..fec5abf89439 100644 --- a/website/www/site/layouts/shortcodes/row-colab.html +++ b/website/www/site/layouts/shortcodes/button-colab.html @@ -10,20 +10,14 @@ limitations under the License. See accompanying LICENSE file. */}} - + - - +
    -

    {{ .Get `title` }}

    -

    {{ .Get `body` }}

    + + Run in Colab + Run in Colab +
    - - -
    - - {{ .Get `button_text` }} - Run in Colab - -
    -
    + +





    From 3fc419b3055bc1b94980e4569f9dd63877ca1420 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Mon, 8 Feb 2021 10:50:43 -0800 Subject: [PATCH 3/5] Align buttons to left --- website/www/site/layouts/shortcodes/button-colab.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/www/site/layouts/shortcodes/button-colab.html b/website/www/site/layouts/shortcodes/button-colab.html index fec5abf89439..a79b311901ac 100644 --- a/website/www/site/layouts/shortcodes/button-colab.html +++ b/website/www/site/layouts/shortcodes/button-colab.html @@ -10,7 +10,7 @@ limitations under the License. See accompanying LICENSE file. */}} - +
    Run in Colab
    -





    +





    \ No newline at end of file From e322d25dd845bd30f4de37527468c494d44fc044 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Wed, 24 Feb 2021 08:47:18 -0800 Subject: [PATCH 4/5] Undo changes --- website/www/site/i18n/home/en.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/www/site/i18n/home/en.yaml b/website/www/site/i18n/home/en.yaml index 8c93052fa8a5..2d9157be2c1a 100644 --- a/website/www/site/i18n/home/en.yaml +++ b/website/www/site/i18n/home/en.yaml @@ -12,8 +12,8 @@ - id: home-learn-more translation: "Learn more" -- id: home-tour-of-beam - translation: "Tour of Beam" +- id: home-try-beam + translation: "Try Beam" - id: home-download-beam translation: "Download Beam SDK {{ .Site.Params.release_latest }}" - id: home-java-quickstart From 6580cc7217bcc5e549774d78309b05cf1a7b403b Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Wed, 24 Feb 2021 08:48:18 -0800 Subject: [PATCH 5/5] Add newline at EOF --- website/www/site/layouts/shortcodes/button-colab.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/www/site/layouts/shortcodes/button-colab.html b/website/www/site/layouts/shortcodes/button-colab.html index a79b311901ac..37f205dfa5a4 100644 --- a/website/www/site/layouts/shortcodes/button-colab.html +++ b/website/www/site/layouts/shortcodes/button-colab.html @@ -20,4 +20,4 @@ -





    \ No newline at end of file +