You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2020/03/25 08:50:39 UTC

[flink-statefun] branch release-2.0 updated (61d6609 -> eeed11a)

This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a change to branch release-2.0
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git.


    from 61d6609  [FLINK-16752] Add a repackage goal to ridesharing example
     new ca733bd  [FLINK-16757] Add Helm charts under tools
     new 15b71b3  [FLINK-16757] Reuse Helm charts in examples
     new 290ee8f  [FLINK-16722] Exclude venv from the rat plugin
     new 2e7cdfb  [FLINK-16722] Add Python SDK walkthrough
     new eeed11a  [hotfix] Let update_branch_version.sh update version string in Helm charts

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |   2 +-
 .../statefun-greeter-example/k8s/config-map.yaml   |  45 ----
 .../k8s/create-resources.sh}                       |   9 +-
 .../k8s/master-deployment.yaml                     |  65 ------
 .../k8s/master-rest-service.yaml                   |  28 ---
 .../k8s/master-service.yaml                        |  31 ---
 .../k8s/worker-deployment.yaml                     |  60 ------
 statefun-examples/statefun-python-k8s/README.md    |   4 +-
 .../statefun-python-k8s/build-example.sh           |  13 +-
 .../templates => }/python-worker-deployment.yaml   |  10 +-
 .../templates => }/python-worker-service.yaml      |   4 +-
 .../statefun-python-walkthrough/README.md          |  44 ++++
 .../statefun-python-walkthrough/example_utils.py   |  27 +--
 .../requirements.txt                               |   6 +-
 .../statefun-python-walkthrough/run-example.py     | 176 ++++++++++++++++
 .../walkthrough.proto}                             |  22 +-
 .../statefun-python-walkthrough/walkthrough.py     | 157 ++++++++++++++
 .../statefun-python-walkthrough/walkthrough_pb2.py | 229 +++++++++++++++++++++
 .../resources => tools/k8s}/Chart.yaml             |   6 +-
 .../k8s}/templates/config-map.yaml                 |   0
 .../k8s}/templates/master-deployment.yaml          |   0
 .../k8s}/templates/master-rest-service.yaml        |   0
 .../k8s}/templates/master-service.yaml             |   0
 .../k8s}/templates/worker-deployment.yaml          |   0
 .../resources => tools/k8s}/values.yaml            |  10 +-
 tools/releasing/update_branch_version.sh           |   3 +
 26 files changed, 672 insertions(+), 279 deletions(-)
 delete mode 100644 statefun-examples/statefun-greeter-example/k8s/config-map.yaml
 copy statefun-examples/{statefun-python-k8s/Dockerfile.statefun => statefun-greeter-example/k8s/create-resources.sh} (83%)
 mode change 100644 => 100755
 delete mode 100644 statefun-examples/statefun-greeter-example/k8s/master-deployment.yaml
 delete mode 100644 statefun-examples/statefun-greeter-example/k8s/master-rest-service.yaml
 delete mode 100644 statefun-examples/statefun-greeter-example/k8s/master-service.yaml
 delete mode 100644 statefun-examples/statefun-greeter-example/k8s/worker-deployment.yaml
 rename statefun-examples/statefun-python-k8s/{resources/templates => }/python-worker-deployment.yaml (85%)
 rename statefun-examples/statefun-python-k8s/{resources/templates => }/python-worker-service.yaml (92%)
 create mode 100644 statefun-examples/statefun-python-walkthrough/README.md
 copy statefun-docs/src/main/python/Caller.py => statefun-examples/statefun-python-walkthrough/example_utils.py (65%)
 copy statefun-examples/{statefun-python-k8s => statefun-python-walkthrough}/requirements.txt (95%)
 create mode 100644 statefun-examples/statefun-python-walkthrough/run-example.py
 copy statefun-examples/{statefun-python-k8s/messages.proto => statefun-python-walkthrough/walkthrough.proto} (78%)
 create mode 100644 statefun-examples/statefun-python-walkthrough/walkthrough.py
 create mode 100644 statefun-examples/statefun-python-walkthrough/walkthrough_pb2.py
 rename {statefun-examples/statefun-python-k8s/resources => tools/k8s}/Chart.yaml (85%)
 rename {statefun-examples/statefun-python-k8s/resources => tools/k8s}/templates/config-map.yaml (100%)
 rename {statefun-examples/statefun-python-k8s/resources => tools/k8s}/templates/master-deployment.yaml (100%)
 rename {statefun-examples/statefun-python-k8s/resources => tools/k8s}/templates/master-rest-service.yaml (100%)
 rename {statefun-examples/statefun-python-k8s/resources => tools/k8s}/templates/master-service.yaml (100%)
 rename {statefun-examples/statefun-python-k8s/resources => tools/k8s}/templates/worker-deployment.yaml (100%)
 rename {statefun-examples/statefun-python-k8s/resources => tools/k8s}/values.yaml (88%)


[flink-statefun] 04/05: [FLINK-16722] Add Python SDK walkthrough

Posted by tz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch release-2.0
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit 2e7cdfbcc0af23f80a283885db9fc97545fd4124
Author: Igal Shilman <ig...@gmail.com>
AuthorDate: Mon Mar 23 12:34:11 2020 +0100

    [FLINK-16722] Add Python SDK walkthrough
    
    This closes #66.
---
 .../statefun-python-walkthrough/README.md          |  44 ++++
 .../statefun-python-walkthrough/example_utils.py   |  38 ++++
 .../statefun-python-walkthrough/requirements.txt   |  20 ++
 .../statefun-python-walkthrough/run-example.py     | 176 ++++++++++++++++
 .../statefun-python-walkthrough/walkthrough.proto  |  42 ++++
 .../statefun-python-walkthrough/walkthrough.py     | 157 ++++++++++++++
 .../statefun-python-walkthrough/walkthrough_pb2.py | 229 +++++++++++++++++++++
 7 files changed, 706 insertions(+)

diff --git a/statefun-examples/statefun-python-walkthrough/README.md b/statefun-examples/statefun-python-walkthrough/README.md
new file mode 100644
index 0000000..fd75f1c
--- /dev/null
+++ b/statefun-examples/statefun-python-walkthrough/README.md
@@ -0,0 +1,44 @@
+# Apache Stateful Functions - Python SDK Walkthrough
+
+## Setup
+
+* Create a virtual env
+
+```
+python3 -m venv venv
+source venv/bin/activate   
+```
+
+* Install the requirements 
+
+```
+pip3 install -r requirements.txt
+```
+
+If you are building from source, then first build the 
+distribution (via calling `statefun-python-sdk/build-distribution.sh`)
+then copy `statefun-python-sdk/dist/apache_flink_statefun-<version>-py3-none-any.whl` here and
+run 
+
+```
+pip3 install apache_flink_statefun-<version>-py3-none-any.whl
+```
+
+## Examples
+
+* Checkout the walkthrough examples at [walkthrough.py](walkthrough.py)
+* To invoke one of the example functions, and observe its result, run:
+```
+python3 walkthrough.py
+```
+
+And from another terminal run:
+```
+python3 run-example.py <example name>
+```
+
+e.g.
+
+```
+python3 run-example.py walkthrough/hello
+```
diff --git a/statefun-examples/statefun-python-walkthrough/example_utils.py b/statefun-examples/statefun-python-walkthrough/example_utils.py
new file mode 100644
index 0000000..9409350
--- /dev/null
+++ b/statefun-examples/statefun-python-walkthrough/example_utils.py
@@ -0,0 +1,38 @@
+################################################################################
+#  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.
+################################################################################
+
+from flask import request
+from flask import make_response
+from flask import Flask
+
+from statefun import RequestReplyHandler
+
+
+def flask_server(endpoint, functions):
+    app = Flask(__name__)
+
+    handler = RequestReplyHandler(functions)
+
+    @app.route(endpoint, methods=['POST'])
+    def handle():
+        response_data = handler(request.data)
+        response = make_response(response_data)
+        response.headers.set('Content-Type', 'application/octet-stream')
+        return response
+
+    app.run()
diff --git a/statefun-examples/statefun-python-walkthrough/requirements.txt b/statefun-examples/statefun-python-walkthrough/requirements.txt
new file mode 100644
index 0000000..580d40e
--- /dev/null
+++ b/statefun-examples/statefun-python-walkthrough/requirements.txt
@@ -0,0 +1,20 @@
+#
+# 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.
+
+flask
+protobuf>=3.11.3,<4.0.0
+requests
+
diff --git a/statefun-examples/statefun-python-walkthrough/run-example.py b/statefun-examples/statefun-python-walkthrough/run-example.py
new file mode 100644
index 0000000..7f25099
--- /dev/null
+++ b/statefun-examples/statefun-python-walkthrough/run-example.py
@@ -0,0 +1,176 @@
+################################################################################
+#  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 sys
+
+import pprint
+import requests
+from google.protobuf.json_format import MessageToDict
+from google.protobuf.any_pb2 import Any
+
+from statefun.request_reply_pb2 import ToFunction, FromFunction
+
+from walkthrough_pb2 import Hello, AnotherHello, Counter
+
+
+class InvocationBuilder(object):
+    """builder for the ToFunction message"""
+
+    def __init__(self):
+        self.to_function = ToFunction()
+
+    def with_target(self, ns, type, id):
+        InvocationBuilder.set_address(ns, type, id, self.to_function.invocation.target)
+        return self
+
+    def with_state(self, name, value=None):
+        state = self.to_function.invocation.state.add()
+        state.state_name = name
+        if value:
+            any = Any()
+            any.Pack(value)
+            state.state_value = any.SerializeToString()
+        return self
+
+    def with_invocation(self, arg, caller=None):
+        invocation = self.to_function.invocation.invocations.add()
+        if caller:
+            (ns, type, id) = caller
+            InvocationBuilder.set_address(ns, type, id, invocation.caller)
+        invocation.argument.Pack(arg)
+        return self
+
+    def SerializeToString(self):
+        return self.to_function.SerializeToString()
+
+    @staticmethod
+    def set_address(namespace, type, id, address):
+        address.namespace = namespace
+        address.type = type
+        address.id = id
+
+
+def post(data):
+    return requests.post(url='http://localhost:5000/statefun',
+                         data=data,
+                         headers={'Content-Type': 'application/octet-stream'})
+
+
+# --------------------------------------------------------------------------------------------------------------
+# example
+# ---------------------------------------------------------------------------------------------------------------
+
+class Examples(object):
+    def __init__(self):
+        self.examples = {}
+
+    def bind(self, typename):
+        def wrapper(fn):
+            self.examples[typename] = fn
+            return fn
+
+        return wrapper
+
+    def invoke(self, typename):
+        fn = self.examples[typename]
+        builder = InvocationBuilder()
+        type, name = typename.split("/")
+        builder.with_target(type, name, "some id")
+        fn(builder)
+        result = post(builder.SerializeToString())
+        from_fn = FromFunction()
+        from_fn.ParseFromString(result.content)
+        pprint.pprint(MessageToDict(from_fn, preserving_proto_field_name=True, including_default_value_fields=True))
+
+
+examples = Examples()
+
+
+@examples.bind("walkthrough/hello")
+def hello(builder):
+    msg = Hello()
+    msg.world = "Hello world!"
+    builder.with_invocation(msg)
+
+
+@examples.bind("walkthrough/any")
+def any_example(builder):
+    hello(builder)
+
+
+@examples.bind("walkthrough/type-hint")
+def typehint(builder):
+    hello(builder)
+
+
+@examples.bind("walkthrough/union-type-hint")
+def union_type_hint(builder):
+    hello = Hello()
+    builder.with_invocation(hello)
+
+    another_hello = AnotherHello()
+    builder.with_invocation(another_hello)
+
+
+@examples.bind("walkthrough/state_access")
+def state1(builder):
+    builder.with_state("counter")
+    builder.with_invocation(Hello())
+
+
+@examples.bind("walkthrough/state_access_unpack")
+def state2(builder):
+    counter = Counter()
+    counter.value = 1
+    builder.with_state("counter", counter)
+    builder.with_invocation(Hello())
+
+
+@examples.bind("walkthrough/state_access_del")
+def state3(builder):
+    counter = Counter()
+    counter.value = 1
+    builder.with_state("counter", counter)
+    builder.with_invocation(Hello())
+
+
+@examples.bind("walkthrough/send")
+def send(builder):
+    hello(builder)
+
+
+@examples.bind("walkthrough/reply")
+def reply(builder):
+    reply_to = ("example-runner", "reply", "0")
+    builder.with_invocation(Hello(), reply_to)
+
+
+@examples.bind("walkthrough/egress")
+def egress(builder):
+    hello(builder)
+
+
+def main():
+    if len(sys.argv) != 2:
+        print("usage: run-example.py <ns/name>")
+        sys.exit(1)
+    example = sys.argv[1]
+    examples.invoke(example)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/statefun-examples/statefun-python-walkthrough/walkthrough.proto b/statefun-examples/statefun-python-walkthrough/walkthrough.proto
new file mode 100644
index 0000000..8f2897f
--- /dev/null
+++ b/statefun-examples/statefun-python-walkthrough/walkthrough.proto
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+syntax = "proto3";
+
+// protoc *.proto --python_out=.
+
+package walkthrough;
+
+message Hello {
+    string world = 1;
+}
+
+message AnotherHello {
+}
+
+message Counter {
+    int64 value = 1;
+}
+
+message HelloReply {
+    string message = 1;
+}
+
+message Event {
+}
+
+
diff --git a/statefun-examples/statefun-python-walkthrough/walkthrough.py b/statefun-examples/statefun-python-walkthrough/walkthrough.py
new file mode 100644
index 0000000..61d8911
--- /dev/null
+++ b/statefun-examples/statefun-python-walkthrough/walkthrough.py
@@ -0,0 +1,157 @@
+################################################################################
+#  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 typing
+
+from statefun import StatefulFunctions, kafka_egress_record
+from google.protobuf.any_pb2 import Any
+
+#
+# @functions is the entry point, that allows us to register
+# stateful functions identified via a namespace and a name pair
+# of the form "<namespace>/<name>".
+#
+from walkthrough_pb2 import HelloReply, Hello, Counter, AnotherHello, Event
+
+functions = StatefulFunctions()
+
+
+#
+# The following statement binds the Python function instance hello to a namespaced name
+# "walkthrough/hello". This is also known as a function type, in stateful functions terms.
+# i.e. the function type of hello is FunctionType(namespace="walkthrough", type="hello")
+# messages that would be address to this function type, would be dispatched to this function instance.
+#
+@functions.bind("walkthrough/hello")
+def hello(context, message):
+    print(message)
+
+
+# -----------------------------------------------------------------------------------------------------------------
+# Message Types
+# -----------------------------------------------------------------------------------------------------------------
+
+
+@functions.bind("walkthrough/any")
+def any_example(context, any_message):
+    # messages sent to a Python function are always packed into a google.protobuf.Any
+    # (https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Any.html)
+    # Therefore the first thing we need to do is to unpack it.
+    if not any_message.Is(Hello.DESCRIPTOR):
+        raise TypeError('Unexpected message type')
+
+    hello = Hello()
+    any_message.Unpack(hello)
+    print(hello)
+
+
+@functions.bind("walkthrough/type-hint")
+def typehint(context, message: Hello):
+    # Although messages that are  sent to a Python function are always packed into a google.protobuf.Any
+    # StateFun can deduce type hints and can unpack the message for you automatically.
+    print(message.world)
+
+
+@functions.bind("walkthrough/union-type-hint")
+def union_type_hint(context, message: typing.Union[Hello, AnotherHello]):
+    # StateFun can deduce type hints and can unpack the message for you automatically, even
+    # when you are expecting more than one message type.
+    print(message)  # <-- would be either an instance of Hello or an instance of AnotherHello
+
+
+@functions.bind("walkthrough/state_access")
+def state1(context, message):
+    # state can be accessed directly by getting the state name (as registered in a module.yaml). remember that the
+    # state has to be a valid Protocol Buffers message, and has to be packed into a google.protobuf.Any
+    pb_any = context['counter']
+    if pb_any:
+        # state was previously stored for this address
+        counter = Counter()
+        pb_any.Unpack(counter)
+        counter.value += 1
+        pb_any.Pack(counter)
+        context['counter'] = pb_any
+    else:
+        # state was not stored for this address
+        counter = Counter()
+        counter.value = 1
+        pb_any = Any()
+        pb_any.Pack(counter)
+        context['counter'] = pb_any
+
+
+# -----------------------------------------------------------------------------------------------------------------
+# State management
+# -----------------------------------------------------------------------------------------------------------------
+
+@functions.bind("walkthrough/state_access_unpack")
+def state2(context, message):
+    # statefun can help you to unpack/pack the values directly, removing some of the boilerplate
+    # associated with google.protobuf.Any.
+    counter = context.state('counter').unpack(Counter)
+    if counter:
+        counter.value += 1
+    else:
+        counter = Counter()
+        counter.value = 1
+    context.state('counter').pack(counter)
+
+
+@functions.bind("walkthrough/state_access_del")
+def state3(context, message):
+    # state can be deleted easily by using the del keyword.
+    del context['counter']
+
+
+# -----------------------------------------------------------------------------------------------------------------
+# Sending Messages
+# -----------------------------------------------------------------------------------------------------------------
+
+@functions.bind("walkthrough/send")
+def send(context, message):
+    # context allows you to send messages to other functions, as long as you
+    # know their address. An address is composed of a function type and an id.
+    any = Any()
+    any.Pack(Hello())
+    context.send("walkthrough/reply", "some-id", any)  # see reply() below.
+
+    # you can also use the convenience alternative, that would pack the argument to a google.protobuf.Any
+    context.pack_and_send("walkthrough/reply", "some-id", Hello())
+
+
+@functions.bind("walkthrough/reply")
+def reply(context, message):
+    # directly reply to the sender!
+    reply = HelloReply()
+    reply.message = "This is a reply!"
+    context.pack_and_reply(reply)
+
+
+@functions.bind("walkthrough/egress")
+def egress(context, message):
+    # send a message to an external system via an egress. Egresses needs to be defined in a module.yaml
+    # and can be referenced by type.
+    # The following two lines prepare a message to send to the pre-built Kafka egress.
+    key = context.address.identity  # use the identity part of our own address as the target Kafka key.
+    record = kafka_egress_record(topic="events", key=key, value=Event())
+    context.pack_and_send_egress("walkthrough/events-egress", record)
+
+
+if __name__ == "__main__":
+    from example_utils import flask_server
+
+    flask_server("/statefun", functions)
diff --git a/statefun-examples/statefun-python-walkthrough/walkthrough_pb2.py b/statefun-examples/statefun-python-walkthrough/walkthrough_pb2.py
new file mode 100644
index 0000000..c974860
--- /dev/null
+++ b/statefun-examples/statefun-python-walkthrough/walkthrough_pb2.py
@@ -0,0 +1,229 @@
+################################################################################
+#  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.
+################################################################################
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: walkthrough.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='walkthrough.proto',
+  package='walkthrough',
+  syntax='proto3',
+  serialized_options=None,
+  serialized_pb=_b('\n\x11walkthrough.proto\x12\x0bwalkthrough\"\x16\n\x05Hello\x12\r\n\x05world\x18\x01 \x01(\t\"\x0e\n\x0c\x41notherHello\"\x18\n\x07\x43ounter\x12\r\n\x05value\x18\x01 \x01(\x03\"\x1d\n\nHelloReply\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x07\n\x05\x45ventb\x06proto3')
+)
+
+
+
+
+_HELLO = _descriptor.Descriptor(
+  name='Hello',
+  full_name='walkthrough.Hello',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='world', full_name='walkthrough.Hello.world', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=34,
+  serialized_end=56,
+)
+
+
+_ANOTHERHELLO = _descriptor.Descriptor(
+  name='AnotherHello',
+  full_name='walkthrough.AnotherHello',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=58,
+  serialized_end=72,
+)
+
+
+_COUNTER = _descriptor.Descriptor(
+  name='Counter',
+  full_name='walkthrough.Counter',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='value', full_name='walkthrough.Counter.value', index=0,
+      number=1, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=74,
+  serialized_end=98,
+)
+
+
+_HELLOREPLY = _descriptor.Descriptor(
+  name='HelloReply',
+  full_name='walkthrough.HelloReply',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='message', full_name='walkthrough.HelloReply.message', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=100,
+  serialized_end=129,
+)
+
+
+_EVENT = _descriptor.Descriptor(
+  name='Event',
+  full_name='walkthrough.Event',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=131,
+  serialized_end=138,
+)
+
+DESCRIPTOR.message_types_by_name['Hello'] = _HELLO
+DESCRIPTOR.message_types_by_name['AnotherHello'] = _ANOTHERHELLO
+DESCRIPTOR.message_types_by_name['Counter'] = _COUNTER
+DESCRIPTOR.message_types_by_name['HelloReply'] = _HELLOREPLY
+DESCRIPTOR.message_types_by_name['Event'] = _EVENT
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+Hello = _reflection.GeneratedProtocolMessageType('Hello', (_message.Message,), dict(
+  DESCRIPTOR = _HELLO,
+  __module__ = 'walkthrough_pb2'
+  # @@protoc_insertion_point(class_scope:walkthrough.Hello)
+  ))
+_sym_db.RegisterMessage(Hello)
+
+AnotherHello = _reflection.GeneratedProtocolMessageType('AnotherHello', (_message.Message,), dict(
+  DESCRIPTOR = _ANOTHERHELLO,
+  __module__ = 'walkthrough_pb2'
+  # @@protoc_insertion_point(class_scope:walkthrough.AnotherHello)
+  ))
+_sym_db.RegisterMessage(AnotherHello)
+
+Counter = _reflection.GeneratedProtocolMessageType('Counter', (_message.Message,), dict(
+  DESCRIPTOR = _COUNTER,
+  __module__ = 'walkthrough_pb2'
+  # @@protoc_insertion_point(class_scope:walkthrough.Counter)
+  ))
+_sym_db.RegisterMessage(Counter)
+
+HelloReply = _reflection.GeneratedProtocolMessageType('HelloReply', (_message.Message,), dict(
+  DESCRIPTOR = _HELLOREPLY,
+  __module__ = 'walkthrough_pb2'
+  # @@protoc_insertion_point(class_scope:walkthrough.HelloReply)
+  ))
+_sym_db.RegisterMessage(HelloReply)
+
+Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), dict(
+  DESCRIPTOR = _EVENT,
+  __module__ = 'walkthrough_pb2'
+  # @@protoc_insertion_point(class_scope:walkthrough.Event)
+  ))
+_sym_db.RegisterMessage(Event)
+
+
+# @@protoc_insertion_point(module_scope)


[flink-statefun] 02/05: [FLINK-16757] Reuse Helm charts in examples

Posted by tz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch release-2.0
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit 15b71b3c473b1536f60f6b38c83d32eee0d81867
Author: Igal Shilman <ig...@gmail.com>
AuthorDate: Tue Mar 24 22:36:06 2020 +0100

    [FLINK-16757] Reuse Helm charts in examples
    
    This closes #72.
---
 .../statefun-greeter-example/k8s/config-map.yaml   | 45 ---------------
 .../k8s/create-resources.sh}                       | 16 +++---
 .../k8s/master-deployment.yaml                     | 65 ---------------------
 .../k8s/master-rest-service.yaml                   | 28 ---------
 .../k8s/master-service.yaml                        | 31 ----------
 .../k8s/worker-deployment.yaml                     | 60 --------------------
 statefun-examples/statefun-python-k8s/README.md    |  4 +-
 .../statefun-python-k8s/build-example.sh           | 13 +++--
 .../templates => }/python-worker-deployment.yaml   | 10 ++--
 .../templates => }/python-worker-service.yaml      |  4 +-
 .../resources/templates/config-map.yaml            | 47 ---------------
 .../resources/templates/master-deployment.yaml     | 63 ---------------------
 .../resources/templates/master-rest-service.yaml   | 28 ---------
 .../resources/templates/master-service.yaml        | 31 ----------
 .../resources/templates/worker-deployment.yaml     | 66 ----------------------
 .../statefun-python-k8s/resources/values.yaml      | 35 ------------
 16 files changed, 27 insertions(+), 519 deletions(-)

diff --git a/statefun-examples/statefun-greeter-example/k8s/config-map.yaml b/statefun-examples/statefun-greeter-example/k8s/config-map.yaml
deleted file mode 100644
index e4372cf..0000000
--- a/statefun-examples/statefun-greeter-example/k8s/config-map.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
-# 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.
-#
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: flink-config
-  labels:
-    app: statefun
-data:
-  flink-conf.yaml: |+
-    jobmanager.rpc.address: statefun-master 
-    taskmanager.numberOfTaskSlots: 1
-    blob.server.port: 6124
-    jobmanager.rpc.port: 6123
-    taskmanager.rpc.port: 6122
-    classloader.parent-first-patterns.additional: org.apache.flink.statefun;org.apache.kafka;com.google.protobuf
-    state.checkpoints.dir: file:///checkpoint-dir
-    state.backend: rocksdb
-    state.backend.rocksdb.timer-service.factory: ROCKSDB
-    state.backend.incremental: true
-    taskmanager.memory.total-process.size: 1g
-
-  log4j-console.properties: |+
-    log4j.rootLogger=INFO, console
-    log4j.appender.console=org.apache.log4j.ConsoleAppender
-    log4j.appender.console.layout=org.apache.log4j.PatternLayout
-    log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n
-    log4j.logger.akka=INFO
-    log4j.logger.org.apache.kafka=INFO
-    log4j.logger.org.apache.hadoop=INFO
-    log4j.logger.org.apache.zookeeper=INFO
-    log4j.logger.org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline=ERROR
diff --git a/statefun-examples/statefun-python-k8s/resources/Chart.yaml b/statefun-examples/statefun-greeter-example/k8s/create-resources.sh
old mode 100644
new mode 100755
similarity index 81%
rename from statefun-examples/statefun-python-k8s/resources/Chart.yaml
rename to statefun-examples/statefun-greeter-example/k8s/create-resources.sh
index f9a582f..6fde8a3
--- a/statefun-examples/statefun-python-k8s/resources/Chart.yaml
+++ b/statefun-examples/statefun-greeter-example/k8s/create-resources.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+#
 # 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.
@@ -12,10 +14,10 @@
 # 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.
-#
-apiVersion: v2
-name: statefun-demo
-description: A Helm chart for a multi-lang StateFun application deployed on Kubernetes
-type: application
-version: 1.0.0
-appVersion: 1.16.0
\ No newline at end of file
+
+helm template ../../../tools/k8s \
+  --set worker.replicas=1 \
+  --set worker.image=greeter-example \
+  --set master.image=greeter-example 
+
+
diff --git a/statefun-examples/statefun-greeter-example/k8s/master-deployment.yaml b/statefun-examples/statefun-greeter-example/k8s/master-deployment.yaml
deleted file mode 100644
index 073f684..0000000
--- a/statefun-examples/statefun-greeter-example/k8s/master-deployment.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
-# 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.
-
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  name: statefun-master
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      app: statefun
-      component: master
-  template:
-    metadata:
-      labels:
-        app: statefun
-        component: master
-    spec:
-      containers:
-        - name: master
-          image: greeter-example:latest
-          imagePullPolicy: IfNotPresent
-          args: ["--kafka-address=awsome-kafka-broker:9092"]
-          env:
-            - name: ROLE
-              value: master
-            - name: MASTER_HOST
-              value: statefun-master
-          ports:
-            - containerPort: 6123
-              name: rpc
-            - containerPort: 6124
-              name: blob
-            - containerPort: 8081
-              name: ui
-          livenessProbe:
-            tcpSocket:
-              port: 6123
-            initialDelaySeconds: 30
-            periodSeconds: 60
-          volumeMounts:
-            - name: flink-config-volume
-              mountPath: /opt/flink/conf
-      volumes:
-        - name: flink-config-volume
-          configMap:
-            name: flink-config
-            items:
-              - key: flink-conf.yaml
-                path: flink-conf.yaml
-              - key: log4j-console.properties
-                path: log4j-console.properties
diff --git a/statefun-examples/statefun-greeter-example/k8s/master-rest-service.yaml b/statefun-examples/statefun-greeter-example/k8s/master-rest-service.yaml
deleted file mode 100644
index abef1e0..0000000
--- a/statefun-examples/statefun-greeter-example/k8s/master-rest-service.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-#
-apiVersion: v1
-kind: Service
-metadata:
-  name: statefun-master-rest
-spec:
-  type: NodePort
-  ports:
-    - name: rest
-      port: 8081
-      targetPort: 8081
-  selector:
-    app: statefun
-    component: master
diff --git a/statefun-examples/statefun-greeter-example/k8s/master-service.yaml b/statefun-examples/statefun-greeter-example/k8s/master-service.yaml
deleted file mode 100644
index a4e9d84..0000000
--- a/statefun-examples/statefun-greeter-example/k8s/master-service.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-#
-apiVersion: v1
-kind: Service
-metadata:
-  name: statefun-master 
-spec:
-  type: ClusterIP
-  ports:
-    - name: rpc
-      port: 6123
-    - name: blob
-      port: 6124
-    - name: ui
-      port: 8081
-  selector:
-    app: statefun
-    component: master
diff --git a/statefun-examples/statefun-greeter-example/k8s/worker-deployment.yaml b/statefun-examples/statefun-greeter-example/k8s/worker-deployment.yaml
deleted file mode 100644
index 8937e7c..0000000
--- a/statefun-examples/statefun-greeter-example/k8s/worker-deployment.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
-# 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.
-#
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  name: statefun-worker
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      app: statefun
-      component: worker
-  template:
-    metadata:
-      labels:
-        app: statefun
-        component: worker
-    spec:
-      containers:
-        - name: worker
-          image: greeter-example:latest
-          imagePullPolicy: IfNotPresent
-          env:
-            - name: ROLE
-              value: worker
-            - name: MASTER_HOST
-              value: statefun-master
-          ports:
-            - containerPort: 6122
-              name: rpc
-          livenessProbe:
-            tcpSocket:
-              port: 6122
-            initialDelaySeconds: 30
-            periodSeconds: 60
-          volumeMounts:
-            - name: flink-config-volume
-              mountPath: /opt/flink/conf
-      volumes:
-        - name: flink-config-volume
-          configMap:
-            name: flink-config
-            items:
-              - key: flink-conf.yaml
-                path: flink-conf.yaml
-              - key: log4j-console.properties
-                path: log4j-console.properties
diff --git a/statefun-examples/statefun-python-k8s/README.md b/statefun-examples/statefun-python-k8s/README.md
index bb78b7d..e0536a8 100644
--- a/statefun-examples/statefun-python-k8s/README.md
+++ b/statefun-examples/statefun-python-k8s/README.md
@@ -78,7 +78,9 @@ This should create the Docker images and generate a `k8s-demo.yaml` file.
 
 ## Deploy
 
-`kubectl create -f k8s-demo.yaml`
+* `kubectl create -f k8s-demo.yaml`
+* `kubectl create -f python-worker-deployment.yaml`
+* `kubectl create -f python-worker-service.yaml`
  
 ## Generate events
 
diff --git a/statefun-examples/statefun-python-k8s/build-example.sh b/statefun-examples/statefun-python-k8s/build-example.sh
index 0ba540d..399b0f2 100755
--- a/statefun-examples/statefun-python-k8s/build-example.sh
+++ b/statefun-examples/statefun-python-k8s/build-example.sh
@@ -41,14 +41,17 @@ rm -f apache_flink_statefun-*-py3-none-any.whl
 # build the statefun Flink image
 docker build -f Dockerfile.statefun . -t ${STATEFUN_IMAGE_NAME}
 
-helm template resources \
+helm template ../../tools/k8s \
   --set worker.replicas=${PARALLELISM} \
   --set worker.image=${STATEFUN_IMAGE_NAME} \
-  --set python.image=${PYTHON_IMAGE_NAME} \
-  --set python.name=${PYTHON_SERVICE_NAME} > ${K8S_RESOURCES_YAML}
+  --set master.image=${STATEFUN_IMAGE_NAME} 
 
 
-echo "Successfully created ${STATEFUN_IMAGE_NAME}, ${PYTHON_IMAGE_NAME} Docker images and ${K8S_RESOURCES_YAML}"
-echo "Upload these Docker images to your docker registry that is accssible from K8S, and"
+echo "Successfully created ${STATEFUN_IMAGE_NAME}, ${PYTHON_IMAGE_NAME} Docker images."
+echo "Upload these Docker images to your docker registry that is accessible from K8S, and"
+echo "" 
 echo "Use: kubectl create -f ${K8S_RESOURCES_YAML}"
+echo "Use: kubectl create -f python-worker-deployment.yaml"
+echo "Use: kubectl create -f python-worker-service.yaml"
+
 
diff --git a/statefun-examples/statefun-python-k8s/resources/templates/python-worker-deployment.yaml b/statefun-examples/statefun-python-k8s/python-worker-deployment.yaml
similarity index 85%
rename from statefun-examples/statefun-python-k8s/resources/templates/python-worker-deployment.yaml
rename to statefun-examples/statefun-python-k8s/python-worker-deployment.yaml
index 8ff3f49..05b9301 100644
--- a/statefun-examples/statefun-python-k8s/resources/templates/python-worker-deployment.yaml
+++ b/statefun-examples/statefun-python-k8s/python-worker-deployment.yaml
@@ -16,22 +16,22 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ .Values.python.name }}
+  name: statefun-python 
 spec:
-  replicas: {{ .Values.python.replicas }}
+  replicas: 1
   selector:
     matchLabels:
       app: statefun
-      component: {{ .Values.python.name }}
+      component: statefun-python 
   template:
     metadata:
       labels:
         app: statefun
-        component: {{ .Values.python.name }}
+        component: statefun-python 
     spec:
       containers:
         - name: worker
-          image: {{ .Values.python.image }}
+          image: k8s-demo-python-worker 
           ports:
             - containerPort: 8000
               name: endpoint
diff --git a/statefun-examples/statefun-python-k8s/resources/templates/python-worker-service.yaml b/statefun-examples/statefun-python-k8s/python-worker-service.yaml
similarity index 92%
rename from statefun-examples/statefun-python-k8s/resources/templates/python-worker-service.yaml
rename to statefun-examples/statefun-python-k8s/python-worker-service.yaml
index bfa0fdc..534d70c 100644
--- a/statefun-examples/statefun-python-k8s/resources/templates/python-worker-service.yaml
+++ b/statefun-examples/statefun-python-k8s/python-worker-service.yaml
@@ -16,7 +16,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ .Values.python.name }}
+  name: statefun-python 
 spec:
   type: ClusterIP
   ports:
@@ -24,4 +24,4 @@ spec:
       port: 8000
   selector:
     app: statefun
-    component: {{ .Values.python.name }}
+    component: statefun-python 
diff --git a/statefun-examples/statefun-python-k8s/resources/templates/config-map.yaml b/statefun-examples/statefun-python-k8s/resources/templates/config-map.yaml
deleted file mode 100644
index a57e7ff..0000000
--- a/statefun-examples/statefun-python-k8s/resources/templates/config-map.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-# 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.
-#
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: flink-config
-  labels:
-    app: statefun
-data:
-  flink-conf.yaml: |+
-    jobmanager.rpc.address: {{ .Values.master.name }}
-    taskmanager.numberOfTaskSlots: 1
-    blob.server.port: 6124
-    jobmanager.rpc.port: 6123
-    taskmanager.rpc.port: 6122
-    classloader.parent-first-patterns.additional: org.apache.flink.statefun;org.apache.kafka;com.google.protobuf
-    state.checkpoints.dir: {{ .Values.checkpoint.dir }}
-    state.backend: rocksdb
-    state.backend.rocksdb.timer-service.factory: ROCKSDB
-    state.backend.incremental: true
-    execution.checkpointing.interval: {{ .Values.checkpoint.interval }}
-    taskmanager.memory.process.size: {{ .Values.worker.jvm_mem }}
-    parallelism.default: {{ .Values.worker.replicas }}
-
-  log4j-console.properties: |+
-    log4j.rootLogger=INFO, console
-    log4j.appender.console=org.apache.log4j.ConsoleAppender
-    log4j.appender.console.layout=org.apache.log4j.PatternLayout
-    log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n
-    log4j.logger.akka=INFO
-    log4j.logger.org.apache.kafka=INFO
-    log4j.logger.org.apache.hadoop=INFO
-    log4j.logger.org.apache.zookeeper=INFO
-    log4j.logger.org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline=ERROR
diff --git a/statefun-examples/statefun-python-k8s/resources/templates/master-deployment.yaml b/statefun-examples/statefun-python-k8s/resources/templates/master-deployment.yaml
deleted file mode 100644
index e46e988..0000000
--- a/statefun-examples/statefun-python-k8s/resources/templates/master-deployment.yaml
+++ /dev/null
@@ -1,63 +0,0 @@
-# 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.
-
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  name: {{ .Values.master.name }}
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      app: statefun
-      component: master
-  template:
-    metadata:
-      labels:
-        app: statefun
-        component: master
-    spec:
-      containers:
-        - name: master
-          image: {{ .Values.statefun_image }}
-          env:
-            - name: ROLE
-              value: master
-            - name: MASTER_HOST
-              value: {{ .Values.master.name }}
-          ports:
-            - containerPort: 6123
-              name: rpc
-            - containerPort: 6124
-              name: blob
-            - containerPort: 8081
-              name: ui
-          livenessProbe:
-            tcpSocket:
-              port: 6123
-            initialDelaySeconds: 30
-            periodSeconds: 60
-          volumeMounts:
-            - name: flink-config-volume
-              mountPath: /opt/flink/conf
-      volumes:
-        - name: flink-config-volume
-          configMap:
-            name: flink-config
-            items:
-              - key: flink-conf.yaml
-                path: flink-conf.yaml
-              - key: log4j-console.properties
-                path: log4j-console.properties
diff --git a/statefun-examples/statefun-python-k8s/resources/templates/master-rest-service.yaml b/statefun-examples/statefun-python-k8s/resources/templates/master-rest-service.yaml
deleted file mode 100644
index d09861d..0000000
--- a/statefun-examples/statefun-python-k8s/resources/templates/master-rest-service.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-#
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{.Values.master.name}}-rest
-spec:
-  type: NodePort
-  ports:
-    - name: rest
-      port: 8081
-      targetPort: 8081
-  selector:
-    app: statefun
-    component: master
diff --git a/statefun-examples/statefun-python-k8s/resources/templates/master-service.yaml b/statefun-examples/statefun-python-k8s/resources/templates/master-service.yaml
deleted file mode 100644
index 116180a..0000000
--- a/statefun-examples/statefun-python-k8s/resources/templates/master-service.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-#
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{ .Values.master.name }}
-spec:
-  type: ClusterIP
-  ports:
-    - name: rpc
-      port: 6123
-    - name: blob
-      port: 6124
-    - name: ui
-      port: 8081
-  selector:
-    app: statefun
-    component: master
diff --git a/statefun-examples/statefun-python-k8s/resources/templates/worker-deployment.yaml b/statefun-examples/statefun-python-k8s/resources/templates/worker-deployment.yaml
deleted file mode 100644
index 2d1100a..0000000
--- a/statefun-examples/statefun-python-k8s/resources/templates/worker-deployment.yaml
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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.
-
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  name: {{ .Values.worker.name }}
-spec:
-  replicas: {{ .Values.worker.replicas }}
-  selector:
-    matchLabels:
-      app: statefun
-      component: worker
-  template:
-    metadata:
-      labels:
-        app: statefun
-        component: worker
-    spec:
-      containers:
-        - name: worker
-          image: {{ .Values.statefun_image }}
-          env:
-            - name: ROLE
-              value: worker
-            - name: MASTER_HOST
-              value: {{ .Values.master.name }}
-          resources:
-            requests:
-              memory: "{{ .Values.worker.container_mem }}"
-          ports:
-            - containerPort: 6123
-              name: rpc
-            - containerPort: 6124
-              name: blob
-            - containerPort: 8081
-              name: ui
-          livenessProbe:
-            tcpSocket:
-              port: 6123
-            initialDelaySeconds: 30
-            periodSeconds: 60
-          volumeMounts:
-            - name: flink-config-volume
-              mountPath: /opt/flink/conf
-      volumes:
-        - name: flink-config-volume
-          configMap:
-            name: flink-config
-            items:
-              - key: flink-conf.yaml
-                path: flink-conf.yaml
-              - key: log4j-console.properties
-                path: log4j-console.properties
diff --git a/statefun-examples/statefun-python-k8s/resources/values.yaml b/statefun-examples/statefun-python-k8s/resources/values.yaml
deleted file mode 100644
index cd07790..0000000
--- a/statefun-examples/statefun-python-k8s/resources/values.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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.
-#
-checkpoint:
-  dir: file:///checkpoint-dir
-  interval: 10sec
-
-master:
-  name: statefun-master
-  image: statefun-demo
-
-worker:
-  name: statefun-worker
-  image: statefun-demo
-  jvm_mem: 1g
-  container_mem: 1.5Gi
-  replicas: 3
-
-python:
-  name: statefun-python
-  image: k8s-demo-python-worker
-  replicas: 1
-


[flink-statefun] 03/05: [FLINK-16722] Exclude venv from the rat plugin

Posted by tz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch release-2.0
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit 290ee8f6bb5a76949cceb37a216ff04af7b2b4d4
Author: Igal Shilman <ig...@gmail.com>
AuthorDate: Mon Mar 23 12:33:45 2020 +0100

    [FLINK-16722] Exclude venv from the rat plugin
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index cc4cd73..25478f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -227,7 +227,7 @@ under the License.
                         <!-- Bundled license files -->
                         <exclude>**/LICENSE*</exclude>
                         <!-- Python venv -->
-                        <exclude>statefun-python-sdk/venv/**</exclude>
+                        <exclude>**/venv/**</exclude>
                     </excludes>
                 </configuration>
             </plugin>


[flink-statefun] 01/05: [FLINK-16757] Add Helm charts under tools

Posted by tz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch release-2.0
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit ca733bdefecca82f4a0b769b15458ce2afb360b7
Author: Igal Shilman <ig...@gmail.com>
AuthorDate: Tue Mar 24 22:34:35 2020 +0100

    [FLINK-16757] Add Helm charts under tools
---
 tools/k8s/Chart.yaml                         | 21 +++++++++
 tools/k8s/templates/config-map.yaml          | 47 ++++++++++++++++++++
 tools/k8s/templates/master-deployment.yaml   | 63 ++++++++++++++++++++++++++
 tools/k8s/templates/master-rest-service.yaml | 28 ++++++++++++
 tools/k8s/templates/master-service.yaml      | 31 +++++++++++++
 tools/k8s/templates/worker-deployment.yaml   | 66 ++++++++++++++++++++++++++++
 tools/k8s/values.yaml                        | 31 +++++++++++++
 7 files changed, 287 insertions(+)

diff --git a/tools/k8s/Chart.yaml b/tools/k8s/Chart.yaml
new file mode 100644
index 0000000..032d7ce
--- /dev/null
+++ b/tools/k8s/Chart.yaml
@@ -0,0 +1,21 @@
+# 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.
+#
+apiVersion: v2
+name: statefun-k8s
+description: A Helm chart for a Stateful function pplication deployed on Kubernetes
+type: application
+version: 2.0-SNAPSHOT
+appVersion: 1.16.0
\ No newline at end of file
diff --git a/tools/k8s/templates/config-map.yaml b/tools/k8s/templates/config-map.yaml
new file mode 100644
index 0000000..a57e7ff
--- /dev/null
+++ b/tools/k8s/templates/config-map.yaml
@@ -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.
+#
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: flink-config
+  labels:
+    app: statefun
+data:
+  flink-conf.yaml: |+
+    jobmanager.rpc.address: {{ .Values.master.name }}
+    taskmanager.numberOfTaskSlots: 1
+    blob.server.port: 6124
+    jobmanager.rpc.port: 6123
+    taskmanager.rpc.port: 6122
+    classloader.parent-first-patterns.additional: org.apache.flink.statefun;org.apache.kafka;com.google.protobuf
+    state.checkpoints.dir: {{ .Values.checkpoint.dir }}
+    state.backend: rocksdb
+    state.backend.rocksdb.timer-service.factory: ROCKSDB
+    state.backend.incremental: true
+    execution.checkpointing.interval: {{ .Values.checkpoint.interval }}
+    taskmanager.memory.process.size: {{ .Values.worker.jvm_mem }}
+    parallelism.default: {{ .Values.worker.replicas }}
+
+  log4j-console.properties: |+
+    log4j.rootLogger=INFO, console
+    log4j.appender.console=org.apache.log4j.ConsoleAppender
+    log4j.appender.console.layout=org.apache.log4j.PatternLayout
+    log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n
+    log4j.logger.akka=INFO
+    log4j.logger.org.apache.kafka=INFO
+    log4j.logger.org.apache.hadoop=INFO
+    log4j.logger.org.apache.zookeeper=INFO
+    log4j.logger.org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline=ERROR
diff --git a/tools/k8s/templates/master-deployment.yaml b/tools/k8s/templates/master-deployment.yaml
new file mode 100644
index 0000000..e46e988
--- /dev/null
+++ b/tools/k8s/templates/master-deployment.yaml
@@ -0,0 +1,63 @@
+# 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.
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ .Values.master.name }}
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: statefun
+      component: master
+  template:
+    metadata:
+      labels:
+        app: statefun
+        component: master
+    spec:
+      containers:
+        - name: master
+          image: {{ .Values.statefun_image }}
+          env:
+            - name: ROLE
+              value: master
+            - name: MASTER_HOST
+              value: {{ .Values.master.name }}
+          ports:
+            - containerPort: 6123
+              name: rpc
+            - containerPort: 6124
+              name: blob
+            - containerPort: 8081
+              name: ui
+          livenessProbe:
+            tcpSocket:
+              port: 6123
+            initialDelaySeconds: 30
+            periodSeconds: 60
+          volumeMounts:
+            - name: flink-config-volume
+              mountPath: /opt/flink/conf
+      volumes:
+        - name: flink-config-volume
+          configMap:
+            name: flink-config
+            items:
+              - key: flink-conf.yaml
+                path: flink-conf.yaml
+              - key: log4j-console.properties
+                path: log4j-console.properties
diff --git a/tools/k8s/templates/master-rest-service.yaml b/tools/k8s/templates/master-rest-service.yaml
new file mode 100644
index 0000000..d09861d
--- /dev/null
+++ b/tools/k8s/templates/master-rest-service.yaml
@@ -0,0 +1,28 @@
+# 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.
+#
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{.Values.master.name}}-rest
+spec:
+  type: NodePort
+  ports:
+    - name: rest
+      port: 8081
+      targetPort: 8081
+  selector:
+    app: statefun
+    component: master
diff --git a/tools/k8s/templates/master-service.yaml b/tools/k8s/templates/master-service.yaml
new file mode 100644
index 0000000..116180a
--- /dev/null
+++ b/tools/k8s/templates/master-service.yaml
@@ -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.
+#
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ .Values.master.name }}
+spec:
+  type: ClusterIP
+  ports:
+    - name: rpc
+      port: 6123
+    - name: blob
+      port: 6124
+    - name: ui
+      port: 8081
+  selector:
+    app: statefun
+    component: master
diff --git a/tools/k8s/templates/worker-deployment.yaml b/tools/k8s/templates/worker-deployment.yaml
new file mode 100644
index 0000000..2d1100a
--- /dev/null
+++ b/tools/k8s/templates/worker-deployment.yaml
@@ -0,0 +1,66 @@
+# 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.
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ .Values.worker.name }}
+spec:
+  replicas: {{ .Values.worker.replicas }}
+  selector:
+    matchLabels:
+      app: statefun
+      component: worker
+  template:
+    metadata:
+      labels:
+        app: statefun
+        component: worker
+    spec:
+      containers:
+        - name: worker
+          image: {{ .Values.statefun_image }}
+          env:
+            - name: ROLE
+              value: worker
+            - name: MASTER_HOST
+              value: {{ .Values.master.name }}
+          resources:
+            requests:
+              memory: "{{ .Values.worker.container_mem }}"
+          ports:
+            - containerPort: 6123
+              name: rpc
+            - containerPort: 6124
+              name: blob
+            - containerPort: 8081
+              name: ui
+          livenessProbe:
+            tcpSocket:
+              port: 6123
+            initialDelaySeconds: 30
+            periodSeconds: 60
+          volumeMounts:
+            - name: flink-config-volume
+              mountPath: /opt/flink/conf
+      volumes:
+        - name: flink-config-volume
+          configMap:
+            name: flink-config
+            items:
+              - key: flink-conf.yaml
+                path: flink-conf.yaml
+              - key: log4j-console.properties
+                path: log4j-console.properties
diff --git a/tools/k8s/values.yaml b/tools/k8s/values.yaml
new file mode 100644
index 0000000..624fa75
--- /dev/null
+++ b/tools/k8s/values.yaml
@@ -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.
+#
+
+checkpoint:
+  dir: file:///checkpoint-dir
+  interval: 10sec
+
+master:
+  name: statefun-master
+  image: statefun-application # replace with your image
+
+worker:
+  name: statefun-worker
+  image: statefun-application # replace with your image
+  jvm_mem: 1g
+  container_mem: 1.5Gi
+  replicas: 3
+


[flink-statefun] 05/05: [hotfix] Let update_branch_version.sh update version string in Helm charts

Posted by tz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch release-2.0
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit eeed11aa62303f317a1c417f0d031b01211dff1c
Author: Tzu-Li (Gordon) Tai <tz...@apache.org>
AuthorDate: Wed Mar 25 16:40:41 2020 +0800

    [hotfix] Let update_branch_version.sh update version string in Helm charts
---
 tools/releasing/update_branch_version.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/releasing/update_branch_version.sh b/tools/releasing/update_branch_version.sh
index 0958e6b..5dc98b8 100755
--- a/tools/releasing/update_branch_version.sh
+++ b/tools/releasing/update_branch_version.sh
@@ -66,6 +66,9 @@ perl -pi -e "s#version=\'$OLD_VERSION\'#version=\'$NEW_VERSION\'#" statefun-pyth
 perl -pi -e "s#<version>(.*)$OLD_VERSION(.*)</version>#<version>$NEW_VERSION</version>#" README.md
 perl -pi -e "s#-DarchetypeVersion=$OLD_VERSION#-DarchetypeVersion=$NEW_VERSION#" README.md
 
+# change version strings in tools directory
+perl -pi -e "s#version: $OLD_VERSION#version: $NEW_VERSION#" tools/k8s/Chart.yaml
+
 git commit -am "[release] Update version to ${NEW_VERSION}"
 
 NEW_VERSION_COMMIT_HASH=`git rev-parse HEAD`