You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ga...@apache.org on 2021/12/23 15:00:13 UTC

[flink-ml] branch master updated: Prepares Flink ML for 2.0.0 release

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

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


The following commit(s) were added to refs/heads/master by this push:
     new cf4db69  Prepares Flink ML for 2.0.0 release
cf4db69 is described below

commit cf4db694c2119302c0b8477d7e358c6e2f58f23e
Author: Dong Lin <li...@gmail.com>
AuthorDate: Thu Dec 23 16:48:35 2021 +0800

    Prepares Flink ML for 2.0.0 release
    
    This commit makes the following changes:
    - Adds scripts under tools/releasing
    - Updates Flink ML version to 2.0-SNAPSHOT
    - Includes flink-ml-uber in the pom.xml
    - Updates flink-ml-uber/pom.xml to include the core module and the iteration module
    - Updates the release profile in pom.xml to follow flink-statefun's practice
    - Removes flink-ml-examples
---
 flink-ml-core/pom.xml                    |   2 +-
 flink-ml-examples/examples-batch/pom.xml | 126 -------------------------------
 flink-ml-iteration/pom.xml               |   2 +-
 flink-ml-lib/pom.xml                     |   2 +-
 flink-ml-python/pyflink/ml/version.py    |   2 +-
 flink-ml-tests/pom.xml                   |   2 +-
 flink-ml-uber/pom.xml                    |  11 +--
 pom.xml                                  |  84 ++++++---------------
 tools/releasing/create_release_branch.sh |  62 +++++++++++++++
 tools/releasing/create_source_release.sh |  89 ++++++++++++++++++++++
 tools/releasing/deploy_staging_jars.sh   |  47 ++++++++++++
 tools/releasing/update_branch_version.sh |  74 ++++++++++++++++++
 12 files changed, 305 insertions(+), 198 deletions(-)

diff --git a/flink-ml-core/pom.xml b/flink-ml-core/pom.xml
index a16089f..3d8a045 100644
--- a/flink-ml-core/pom.xml
+++ b/flink-ml-core/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.flink</groupId>
     <artifactId>flink-ml-parent</artifactId>
-    <version>0.1-SNAPSHOT</version>
+    <version>2.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>flink-ml-core</artifactId>
diff --git a/flink-ml-examples/examples-batch/pom.xml b/flink-ml-examples/examples-batch/pom.xml
deleted file mode 100644
index 599f839..0000000
--- a/flink-ml-examples/examples-batch/pom.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.flink</groupId>
-    <artifactId>flink-ml-examples</artifactId>
-    <version>0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>flink-ml-examples-batch_${scala.binary.version}</artifactId>
-  <name>Flink ML : Examples : Batch</name>
-
-  <packaging>jar</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.flink</groupId>
-      <artifactId>flink-java</artifactId>
-      <version>${flink.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.flink</groupId>
-      <artifactId>flink-scala_${scala.binary.version}</artifactId>
-      <version>${flink.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.flink</groupId>
-      <artifactId>flink-clients_${scala.binary.version}</artifactId>
-      <version>${flink.version}</version>
-    </dependency>
-  </dependencies>
-  
-  
-  <build>
-    <plugins>
-      <!-- Scala Compiler -->
-      <plugin>
-        <groupId>net.alchim31.maven</groupId>
-        <artifactId>scala-maven-plugin</artifactId>
-        <executions>
-          <!-- Run scala compiler in the process-resources phase, so that dependencies on
-            scala classes can be resolved later in the (Java) compile phase -->
-          <execution>
-            <id>scala-compile-first</id>
-            <phase>process-resources</phase>
-            <goals>
-              <goal>compile</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <jvmArgs>
-            <jvmArg>-Xms128m</jvmArg>
-            <jvmArg>-Xmx512m</jvmArg>
-          </jvmArgs>
-        </configuration>
-      </plugin>
-
-      <!-- Adding scala source directories to build path -->
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <!-- Add src/main/scala to eclipse build path -->
-          <execution>
-            <id>add-source</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-            <configuration>
-              <sources>
-                <source>src/main/scala</source>
-              </sources>
-            </configuration>
-          </execution>
-          <!-- Add src/test/scala to eclipse build path -->
-          <execution>
-            <id>add-test-source</id>
-            <phase>generate-test-sources</phase>
-            <goals>
-              <goal>add-test-source</goal>
-            </goals>
-            <configuration>
-              <sources>
-                <source>src/test/scala</source>
-              </sources>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
-      <!-- Scala Code Style, most of the configuration done via plugin management -->
-      <plugin>
-        <groupId>org.scalastyle</groupId>
-        <artifactId>scalastyle-maven-plugin</artifactId>
-        <configuration>
-          <configLocation>${project.basedir}/../../tools/maven/scalastyle-config.xml</configLocation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
diff --git a/flink-ml-iteration/pom.xml b/flink-ml-iteration/pom.xml
index 41be342..03b049d 100644
--- a/flink-ml-iteration/pom.xml
+++ b/flink-ml-iteration/pom.xml
@@ -25,7 +25,7 @@ under the License.
     <parent>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-ml-parent</artifactId>
-        <version>0.1-SNAPSHOT</version>
+        <version>2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>flink-ml-iteration</artifactId>
diff --git a/flink-ml-lib/pom.xml b/flink-ml-lib/pom.xml
index 7262cb9..8f22a3d 100644
--- a/flink-ml-lib/pom.xml
+++ b/flink-ml-lib/pom.xml
@@ -23,7 +23,7 @@ under the License.
   <parent>
     <groupId>org.apache.flink</groupId>
     <artifactId>flink-ml-parent</artifactId>
-    <version>0.1-SNAPSHOT</version>
+    <version>2.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>flink-ml-lib_${scala.binary.version}</artifactId>
diff --git a/flink-ml-python/pyflink/ml/version.py b/flink-ml-python/pyflink/ml/version.py
index 4d91394..a48cb35 100644
--- a/flink-ml-python/pyflink/ml/version.py
+++ b/flink-ml-python/pyflink/ml/version.py
@@ -20,4 +20,4 @@
 The version will be consistent with the flink ml version and follow the PEP440.
 .. seealso:: https://www.python.org/dev/peps/pep-0440
 """
-__version__ = "0.1.dev0"
+__version__ = "2.0.dev0"
diff --git a/flink-ml-tests/pom.xml b/flink-ml-tests/pom.xml
index c5b8411..78d5e94 100644
--- a/flink-ml-tests/pom.xml
+++ b/flink-ml-tests/pom.xml
@@ -25,7 +25,7 @@ under the License.
     <parent>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-ml-parent</artifactId>
-        <version>0.1-SNAPSHOT</version>
+        <version>2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>flink-ml-tests</artifactId>
diff --git a/flink-ml-uber/pom.xml b/flink-ml-uber/pom.xml
index 03897c0..c76d8a1 100644
--- a/flink-ml-uber/pom.xml
+++ b/flink-ml-uber/pom.xml
@@ -23,13 +23,13 @@ under the License.
   <parent>
     <groupId>org.apache.flink</groupId>
     <artifactId>flink-ml-parent</artifactId>
-    <version>0.1-SNAPSHOT</version>
+    <version>2.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>flink-ml-uber_${scala.binary.version}</artifactId>
   <name>Flink ML : Uber</name>
   <description>
-    This module contains both the api and libraries for writing Flink ML programs.
+    This module contains the basic modules for writing Flink ML programs.
   </description>
 
   <packaging>jar</packaging>
@@ -40,9 +40,10 @@ under the License.
       <artifactId>flink-ml-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.flink</groupId>
-      <artifactId>flink-ml-lib_${scala.binary.version}</artifactId>
+      <artifactId>flink-ml-iteration</artifactId>
       <version>${project.version}</version>
     </dependency>
   </dependencies>
@@ -63,8 +64,8 @@ under the License.
               <artifactSet>
                 <includes combine.children="append">
                   <include>org.apache.flink:flink-ml-core</include>
-                  <include>org.apache.flink:flink-ml-lib_${scala.binary.version}</include>
-                  <include>com.github.fommil.netlib:core</include>
+                  <include>org.apache.flink:flink-ml-iteration</include>
+                  <include>dev.ludovic.netlib:blas</include>
                 </includes>
               </artifactSet>
             </configuration>
diff --git a/pom.xml b/pom.xml
index 63c013e..26807b4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@ under the License.
   <artifactId>flink-ml-parent</artifactId>
   <groupId>org.apache.flink</groupId>
   <name>Flink ML</name>
-  <version>0.1-SNAPSHOT</version>
+  <version>2.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <url>http://flink.apache.org</url>
@@ -56,6 +56,7 @@ under the License.
     <module>flink-ml-iteration</module>
     <module>flink-ml-lib</module>
     <module>flink-ml-tests</module>
+    <module>flink-ml-uber</module>
   </modules>
 
   <properties>
@@ -209,80 +210,37 @@ under the License.
     </dependencies>
   </dependencyManagement>
 
-
   <profiles>
+    <!--
+      We're reusing the apache-release build profile defined in the Apache Parent POM,
+      with one exclusion: do not run the source-release-assembly execution goal.
+      We have our own scripts to create the source release, which correctly excludes
+      binaries from distribution tarball.
+      The script can be found under tools/releasing/create_source_release.sh.
+    -->
     <profile>
       <id>release</id>
-      <activation>
-        <property>
-          <name>release</name>
-        </property>
-      </activation>
-      <properties>
-        <target.java.version>1.8</target.java.version>
-      </properties>
       <build>
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-gpg-plugin</artifactId>
-            <version>1.4</version>
-            <executions>
-              <execution>
-                <id>sign-artifacts</id>
-                <phase>verify</phase>
-                <goals>
-                  <goal>sign</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-enforcer-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>enforce-maven</id>
-                <goals>
-                  <goal>enforce</goal>
-                </goals>
-                <configuration>
-                  <rules>
-                    <requireJavaVersion>
-                      <version>1.8.0</version>
-                    </requireJavaVersion>
-                  </rules>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-javadoc-plugin</artifactId>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.apache.resources</groupId>
+                <artifactId>apache-source-release-assembly-descriptor</artifactId>
+                <version>1.0.6</version>
+              </dependency>
+            </dependencies>
             <executions>
               <execution>
-                <id>attach-javadocs</id>
-                <goals>
-                  <goal>jar</goal>
-                </goals>
+                <id>source-release-assembly</id>
+                <!-- disable the execution -->
+                <phase>none</phase>
               </execution>
             </executions>
           </plugin>
         </plugins>
-        <pluginManagement>
-          <plugins>
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-release-plugin</artifactId>
-              <version>2.1</version>
-              <configuration>
-                <mavenExecutorId>forked-path</mavenExecutorId>
-                <useReleaseProfile>false</useReleaseProfile>
-                <arguments>${arguments} -Psonatype-oss-release</arguments>
-              </configuration>
-            </plugin>
-          </plugins>
-        </pluginManagement>
       </build>
     </profile>
   </profiles>
@@ -377,6 +335,8 @@ under the License.
             <exclude>**/scalastyle-output.xml</exclude>
             <!-- Bundled license files -->
             <exclude>**/LICENSE*</exclude>
+            <!-- artifacts created during release process -->
+            <exclude>release/**</exclude>
           </excludes>
         </configuration>
       </plugin>
diff --git a/tools/releasing/create_release_branch.sh b/tools/releasing/create_release_branch.sh
new file mode 100755
index 0000000..b490db6
--- /dev/null
+++ b/tools/releasing/create_release_branch.sh
@@ -0,0 +1,62 @@
+#!/usr/bin/env 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.
+# 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.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+RELEASE_CANDIDATE=${RELEASE_CANDIDATE:-none}
+
+##
+## Required variables
+##
+RELEASE_VERSION=${RELEASE_VERSION}
+
+if [ -z "${RELEASE_VERSION}" ]; then
+	echo "RELEASE_VERSION was not set"
+	exit 1
+fi
+
+# fail immediately
+set -o errexit
+set -o nounset
+
+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
+
+###########################
+
+TARGET_BRANCH=release-${RELEASE_VERSION}
+if [ "${RELEASE_CANDIDATE}" != "none" ]; then
+  TARGET_BRANCH=${TARGET_BRANCH}-rc${RELEASE_CANDIDATE}
+fi
+
+cd ${PROJECT_ROOT}
+git checkout -b ${TARGET_BRANCH}
+
+RELEASE_COMMIT_HASH=`git rev-parse HEAD`
+echo "Done. Created a new release branch with commit hash ${RELEASE_COMMIT_HASH}."
+
+cd ${CURR_DIR}
diff --git a/tools/releasing/create_source_release.sh b/tools/releasing/create_source_release.sh
new file mode 100755
index 0000000..188c04a
--- /dev/null
+++ b/tools/releasing/create_source_release.sh
@@ -0,0 +1,89 @@
+#!/usr/bin/env 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.
+# 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.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+MVN=${MVN:-mvn}
+
+##
+## Required variables
+##
+RELEASE_VERSION=${RELEASE_VERSION}
+
+if [ -z "${RELEASE_VERSION}" ]; then
+	echo "RELEASE_VERSION is unset"
+	exit 1
+fi
+
+# fail immediately
+set -o errexit
+set -o nounset
+
+CURR_DIR=`pwd`
+BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+PROJECT_ROOT="$( cd "$( dirname "${BASE_DIR}/../../../" )" >/dev/null && pwd )"
+
+# 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
+
+if [ "$(uname)" == "Darwin" ]; then
+    SHASUM="shasum -a 512"
+else
+    SHASUM="sha512sum"
+fi
+
+###########################
+
+RELEASE_DIR=${PROJECT_ROOT}/release
+CLONE_DIR=${RELEASE_DIR}/flink-ml-tmp-clone
+
+rm -rf ${RELEASE_DIR}
+mkdir ${RELEASE_DIR}
+
+# delete the temporary release directory on error
+trap 'rm -rf ${RELEASE_DIR}' ERR
+
+echo "Creating source package"
+
+# create a temporary git clone to ensure that we have a pristine source release
+git clone ${PROJECT_ROOT} ${CLONE_DIR}
+
+cd ${CLONE_DIR}
+rsync -a \
+  --exclude ".git" --exclude ".gitignore" \
+  --exclude ".asf.yaml" \
+  --exclude "target" \
+  --exclude ".idea" --exclude "*.iml" \
+  --exclude ".travis.yml" \
+  . flink-ml-${RELEASE_VERSION}
+
+tar czf ${RELEASE_DIR}/flink-ml-${RELEASE_VERSION}-src.tgz flink-ml-${RELEASE_VERSION}
+gpg --armor --detach-sig ${RELEASE_DIR}/flink-ml-${RELEASE_VERSION}-src.tgz
+cd ${RELEASE_DIR}
+${SHASUM} flink-ml-${RELEASE_VERSION}-src.tgz > flink-ml-${RELEASE_VERSION}-src.tgz.sha512
+
+rm -rf ${CLONE_DIR}
+
+echo "Done. Source release package and signatures created under ${RELEASE_DIR}/."
+
+cd ${CURR_DIR}
\ No newline at end of file
diff --git a/tools/releasing/deploy_staging_jars.sh b/tools/releasing/deploy_staging_jars.sh
new file mode 100755
index 0000000..7c26f63
--- /dev/null
+++ b/tools/releasing/deploy_staging_jars.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env 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.
+# 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.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+MVN=${MVN:-mvn}
+CUSTOM_OPTIONS=${CUSTOM_OPTIONS:-}
+
+# fail immediately
+set -o errexit
+set -o nounset
+
+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
+
+###########################
+
+cd ${PROJECT_ROOT}
+
+echo "Deploying to repository.apache.org"
+${MVN} clean deploy -Prelease -DskipTests -DretryFailedDeploymentCount=10 $CUSTOM_OPTIONS -Dscala-2.12
+
+cd ${CURR_DIR}
diff --git a/tools/releasing/update_branch_version.sh b/tools/releasing/update_branch_version.sh
new file mode 100755
index 0000000..593292d
--- /dev/null
+++ b/tools/releasing/update_branch_version.sh
@@ -0,0 +1,74 @@
+#!/usr/bin/env 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.
+# 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.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+MVN=${MVN:-mvn}
+
+##
+## Required variables
+##
+OLD_VERSION=${OLD_VERSION}
+NEW_VERSION=${NEW_VERSION}
+
+if [ -z "${OLD_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+if [ -z "${NEW_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+# fail immediately
+set -o errexit
+set -o nounset
+
+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
+
+###########################
+
+cd ${PROJECT_ROOT}
+
+# change version in all pom files
+mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${NEW_VERSION}
+
+# change version of apache-flink-ml
+perl -pi -e "s#^__version__ = \".*\"#__version__ = \"${NEW_VERSION}\"#" flink-ml-python/pyflink/ml/version.py
+perl -pi -e "s#-SNAPSHOT#\\.dev0#" flink-ml-python/pyflink/ml/version.py
+
+git commit -am "[release] Update version to ${NEW_VERSION}"
+
+NEW_VERSION_COMMIT_HASH=`git rev-parse HEAD`
+
+echo "Done. Created a new commit for the new version ${NEW_VERSION}, with hash ${NEW_VERSION_COMMIT_HASH}"
+echo "If this is a new version to be released (or a candidate to be voted on), don't forget to create a signed release tag on GitHub and push the changes."
+echo "e.g., git tag -s -m \"Apache Flink ML, release 2.0 candidate #2\" release-2.2-rc2 ${NEW_VERSION_COMMIT_HASH}"
+
+cd ${CURR_DIR}