This is an automated email from the ASF dual-hosted git repository.
sjwiesman pushed a commit to branch release-2.0
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git
The following commit(s) were added to refs/heads/release-2.0 by this push:
new d660668 [FLINK-17193] [python-k8s-example] Abort script on failure.
Build SDK distribution if was not previously built
d660668 is described below
commit d660668ff45312f7c3b10529b29b478efe220e57
Author: Rafi Aroch <[email protected]>
AuthorDate: Thu Apr 16 21:37:48 2020 +0300
[FLINK-17193] [python-k8s-example] Abort script on failure. Build SDK
distribution if was not previously built
This closes #99
---
.../statefun-python-k8s-example/build-example.sh | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/statefun-examples/statefun-python-k8s-example/build-example.sh
b/statefun-examples/statefun-python-k8s-example/build-example.sh
index 399b0f2..bbcc1d9 100755
--- a/statefun-examples/statefun-python-k8s-example/build-example.sh
+++ b/statefun-examples/statefun-python-k8s-example/build-example.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+
+set -e
+
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@@ -20,19 +23,21 @@ PYTHON_SERVICE_NAME="python-worker"
STATEFUN_IMAGE_NAME="k8s-demo-statefun"
PARALLELISM=3
K8S_RESOURCES_YAML="k8s-demo.yaml"
+SDK_DISTRIBUTION_WHL_PATH="../../statefun-python-sdk/dist/apache_flink_statefun-*-py3-none-any.whl"
# clean
rm -f apache_flink_statefun-*-py3-none-any.whl
rm -rf __pycache__
-# copy the whl distribution, it must be first built by calling
build-distribution.sh
-cp ../../statefun-python-sdk/dist/apache_flink_statefun-*-py3-none-any.whl
apache_flink_statefun-snapshot-py3-none-any.whl 2>/dev/null
-rc=$?
-if [[ ${rc} -ne 0 ]]; then
- echo "Failed copying the whl distribution, please build the distribution
first by calling ./build-distribution.sh"
- exit 1;
+if [ ! -f ${SDK_DISTRIBUTION_WHL_PATH} ]; then
+ echo "SDK distribution has to be built first. Building it"
+ pushd ../../statefun-python-sdk
+ ./build-distribution.sh
+ popd
fi
+cp ${SDK_DISTRIBUTION_WHL_PATH}
apache_flink_statefun-snapshot-py3-none-any.whl 2>/dev/null
+
# build the flask container
docker build -f Dockerfile.python-worker . -t ${PYTHON_IMAGE_NAME}