You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2019/05/02 08:42:27 UTC

[flink] 06/10: [hotfix][travis] Speed up dependency convergence

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

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

commit a2d705097ca1e1a11a700797ed64fc0a1bb4475c
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Fri Apr 26 20:31:32 2019 +0200

    [hotfix][travis] Speed up dependency convergence
    
    Run dependency convergence in main compile run.
    Invoking maven once per modules requires significant time.
    Run convergence in install phase (i.e. after the shade plugin) to work against dependency-reduced poms.
---
 pom.xml                               |  3 +-
 tools/check_dependency_convergence.sh | 79 -----------------------------------
 tools/travis_controller.sh            | 15 +------
 3 files changed, 3 insertions(+), 94 deletions(-)

diff --git a/pom.xml b/pom.xml
index e2b5737..6a9f52c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -128,6 +128,7 @@ under the License.
 		<powermock.version>2.0.0-RC.4</powermock.version>
 		<hamcrest.version>1.3</hamcrest.version>
 		<japicmp.skip>false</japicmp.skip>
+		<flink.convergence.phase>validate</flink.convergence.phase>
 		<!--
 			Keeping the MiniKDC version fixed instead of taking hadoop version dependency
 			to support testing Kafka, ZK etc., modules that does not have Hadoop dependency
@@ -866,7 +867,7 @@ under the License.
 						<executions>
 							<execution>
 								<id>dependency-convergence</id>
-								<phase>validate</phase>
+								<phase>${flink.convergence.phase}</phase>
 							</execution>
 						</executions>
 					</plugin>
diff --git a/tools/check_dependency_convergence.sh b/tools/check_dependency_convergence.sh
deleted file mode 100755
index a9294b8..0000000
--- a/tools/check_dependency_convergence.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/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.
-################################################################################
-
-HERE="`dirname \"$0\"`"				# relative
-HERE="`( cd \"$HERE\" && pwd )`" 	# absolutized and normalized
-if [ -z "$HERE" ] ; then
-	# error; for some reason, the path is not accessible
-	# to the script (e.g. permissions re-evaled after suid)
-	exit 1  # fail
-fi
-
-FLINK_DIR=HERE
-
-if [[ $(basename ${HERE}) == "tools" ]] ; then
-  FLINK_DIR="${HERE}/.."
-fi
-
-FLINK_DIR="`( cd \"${FLINK_DIR}\" && pwd )`" 
-
-echo ${FLINK_DIR}
-
-# get list of all flink modules
-# searches for directories containing a pom.xml file
-# sorts the list alphabetically
-# only accepts directories starting with "flink" to filter force-shading
-modules=$(find . -maxdepth 3 -name 'pom.xml' -printf '%h\n' | sort -u | grep "flink")
-
-for module in ${modules}
-do
-    # There are no Scala 2.12 dependencies for older Kafka versions
-    if [[ $PROFILE == *"scala-2.12"* ]]; then
-        if [[ $module == *"kafka-0.8"* ]]; then
-            echo "excluding ${module} because we build for Scala 2.12"
-            continue 2
-        fi
-        if [[ $module == *"kafka-0.9"* ]]; then
-            echo "excluding ${module} because we build for Scala 2.12"
-            continue 2
-        fi
-    fi
-
-    # we are only interested in child modules
-    for other_module in ${modules}
-    do 
-        if [[ "${other_module}" != "${module}" && "${other_module}" = "${module}"/* ]]; then
-        echo "excluding ${module} since it is not a leaf module"
-            continue 2
-        fi
-    done
-    
-    cd "${module}"
-    echo "checking ${module}"
-    output=$(mvn validate $PROFILE -nsu -Dcheckstyle.skip=true -Dcheck-convergence)
-    exit_code=$?
-    if [[ ${exit_code} != 0 ]]; then
-        echo "dependency convergence failed."
-        echo "${output}"
-        exit ${exit_code}
-    fi
-    cd "${FLINK_DIR}"
-done
-
-exit 0
diff --git a/tools/travis_controller.sh b/tools/travis_controller.sh
index 33d7961..30b3923 100755
--- a/tools/travis_controller.sh
+++ b/tools/travis_controller.sh
@@ -59,7 +59,7 @@ EXIT_CODE=0
 
 # Run actual compile&test steps
 if [ $STAGE == "$STAGE_COMPILE" ]; then
-	MVN="mvn clean install -nsu -Dflink.forkCount=2 -Dflink.forkCountTestPackage=2 -Dmaven.javadoc.skip=true -B -DskipTests $PROFILE"
+	MVN="mvn clean install -nsu -Dflink.convergence.phase=install -Pcheck-convergence -Dflink.forkCount=2 -Dflink.forkCountTestPackage=2 -Dmaven.javadoc.skip=true -B -DskipTests $PROFILE"
 	$MVN
 	EXIT_CODE=$?
 
@@ -75,19 +75,6 @@ if [ $STAGE == "$STAGE_COMPILE" ]; then
         printf "Previous build failure detected, skipping scala-suffixes check.\n"
         printf "==============================================================================\n"
     fi
-
-    if [ $EXIT_CODE == 0 ]; then
-        printf "\n\n==============================================================================\n"
-        printf "Checking dependency convergence\n"
-        printf "==============================================================================\n"
-
-        ./tools/check_dependency_convergence.sh
-        EXIT_CODE=$?
-    else
-        printf "\n==============================================================================\n"
-        printf "Previous build failure detected, skipping dependency-convergence check.\n"
-        printf "==============================================================================\n"
-    fi
     
     if [ $EXIT_CODE == 0 ]; then
         check_shaded_artifacts