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/29 05:23:22 UTC

[flink-statefun] branch master updated (0051f3f -> bdcaecb)

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

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


    from 0051f3f  [hofix] [docs] Fix image name and version tag in walkthrough.md
     new e5ce83e  [FLINK-16730] [docs] Move walkthrough dist script to tools/
     new bdcaecb  [FLINK-16730] [docs] Make create_python_walkthrough.sh return to user dir

The 2 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:
 docs/downloads/Dockerfile                          | 31 -------------------
 .../docs/create_python_walkthrough.sh              | 35 +++++++++++++++++++---
 {docs/downloads => tools/docs}/greeter.py          |  0
 3 files changed, 31 insertions(+), 35 deletions(-)
 delete mode 100644 docs/downloads/Dockerfile
 rename docs/downloads/build-walkthrough-dist.sh => tools/docs/create_python_walkthrough.sh (51%)
 rename {docs/downloads => tools/docs}/greeter.py (100%)


[flink-statefun] 01/02: [FLINK-16730] [docs] Move walkthrough dist script to tools/

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

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

commit e5ce83e6ad96deb826ab6f613779536e89e42963
Author: Seth Wiesman <sj...@gmail.com>
AuthorDate: Sat Mar 28 12:23:03 2020 -0500

    [FLINK-16730] [docs] Move walkthrough dist script to tools/
---
 docs/downloads/Dockerfile                          | 31 ----------------------
 .../docs/create_python_walkthrough.sh              | 15 ++++++++---
 {docs/downloads => tools/docs}/greeter.py          |  0
 3 files changed, 12 insertions(+), 34 deletions(-)

diff --git a/docs/downloads/Dockerfile b/docs/downloads/Dockerfile
deleted file mode 100644
index 23b62c5..0000000
--- a/docs/downloads/Dockerfile
+++ /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.
-
-FROM python:3.7-alpine
-
-RUN mkdir -p /app
-WORKDIR /app
-
-COPY requirements.txt /app
-RUN pip install -r requirements.txt
-
-COPY greeter.py /app
-COPY messages_pb2.py /app
-
-EXPOSE 8000
-
-CMD ["gunicorn", "-b", "0.0.0.0:8000", "-w 4", "greeter:app"]
-
diff --git a/docs/downloads/build-walkthrough-dist.sh b/tools/docs/create_python_walkthrough.sh
similarity index 73%
rename from docs/downloads/build-walkthrough-dist.sh
rename to tools/docs/create_python_walkthrough.sh
index 0fe14d8..284ac99 100755
--- a/docs/downloads/build-walkthrough-dist.sh
+++ b/tools/docs/create_python_walkthrough.sh
@@ -15,16 +15,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-rm -f walkthrough.zip
+cd $(dirname $0)
+
+rm -rf ../../docs/downloads/walkthrough.zip
+
+rm -rf statefun-walkthrough
 cp -r ../../statefun-examples/statefun-python-greeter statefun-walkthrough
 
 rm statefun-walkthrough/build-example.sh
+rm statefun-walkthrough/pom.xml
+rm -rf statefun-walkthrough/target
 
 rm statefun-walkthrough/greeter/greeter.py
 cp greeter.py statefun-walkthrough/greeter/greeter.py
 
-rm statefun-walkthrough/greeter/Dockerfile
-cp Dockerfile statefun-walkthrough/greeter/Dockerfile
+rm statefun-walkthrough/README.md
+
+sed '/apache_flink_statefun/d' statefun-walkthrough/greeter/Dockerfile > Dockerfile
+mv Dockerfile statefun-walkthrough/greeter/Dockerfile
 
 zip -r walkthrough.zip statefun-walkthrough
 rm -rf statefun-walkthrough
+mv walkthrough.zip ../../docs/downloads/walkthrough.zip
diff --git a/docs/downloads/greeter.py b/tools/docs/greeter.py
similarity index 100%
rename from docs/downloads/greeter.py
rename to tools/docs/greeter.py


[flink-statefun] 02/02: [FLINK-16730] [docs] Make create_python_walkthrough.sh return to user dir

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

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

commit bdcaecb5066c843a04d77cc55e86a9b6a2cda806
Author: Tzu-Li (Gordon) Tai <tz...@apache.org>
AuthorDate: Sun Mar 29 12:15:01 2020 +0800

    [FLINK-16730] [docs] Make create_python_walkthrough.sh return to user dir
    
    This closes #79.
---
 tools/docs/create_python_walkthrough.sh | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/tools/docs/create_python_walkthrough.sh b/tools/docs/create_python_walkthrough.sh
index 284ac99..f9c9274 100755
--- a/tools/docs/create_python_walkthrough.sh
+++ b/tools/docs/create_python_walkthrough.sh
@@ -15,16 +15,30 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cd $(dirname $0)
+# fail immediately
+set -o errexit
+set -o nounset
 
-rm -rf ../../docs/downloads/walkthrough.zip
+CURR_DIR=`pwd`
+BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+PROJECT_ROOT="${BASE_DIR}/../../"
+
+# Sanity check to ensure that resolved paths are valid; a LICENSE file should aways exist in project root
+if [ ! -f ${PROJECT_ROOT}/LICENSE ]; then
+    echo "Project root path ${PROJECT_ROOT} is not valid; script may be in the wrong directory."
+    exit 1
+fi
+
+###########################
+
+rm -rf ${PROJECT_ROOT}/docs/downloads/walkthrough.zip
+
+cd ${BASE_DIR}
 
 rm -rf statefun-walkthrough
-cp -r ../../statefun-examples/statefun-python-greeter statefun-walkthrough
+cp -r ${PROJECT_ROOT}/statefun-examples/statefun-python-greeter statefun-walkthrough
 
 rm statefun-walkthrough/build-example.sh
-rm statefun-walkthrough/pom.xml
-rm -rf statefun-walkthrough/target
 
 rm statefun-walkthrough/greeter/greeter.py
 cp greeter.py statefun-walkthrough/greeter/greeter.py
@@ -36,4 +50,8 @@ mv Dockerfile statefun-walkthrough/greeter/Dockerfile
 
 zip -r walkthrough.zip statefun-walkthrough
 rm -rf statefun-walkthrough
-mv walkthrough.zip ../../docs/downloads/walkthrough.zip
+
+mkdir -p ${PROJECT_ROOT}/docs/downloads/
+mv walkthrough.zip ${PROJECT_ROOT}/docs/downloads/walkthrough.zip
+
+cd ${CURR_DIR}