zentol commented on a change in pull request #12268:
URL: https://github.com/apache/flink/pull/12268#discussion_r429961569



##########
File path: tools/ci/watchdog.sh
##########
@@ -0,0 +1,122 @@
+#!/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.
+################################################################################
+
+#
+# This file contains a watchdog tool to run monitor and potentially kill tasks
+# not producing any output for n seconds.
+#
+
+# Number of seconds w/o output before printing a stack trace and killing the 
watched process
+MAX_NO_OUTPUT=${MAX_NO_OUTPUT:-900}
+
+# Number of seconds to sleep before checking the output again
+SLEEP_TIME=${SLEEP_TIME:-20}
+
+CMD_OUT=${CMD_OUT:-"/tmp/watchdog.out"}
+CMD_PID=${CMD_PID:-"/tmp/watchdog.pid"}
+CMD_EXIT=${CMD_EXIT:-"/tmp/watchdog.exit"}
+
+
+# =============================================
+# Utility functions
+# ============================================= 
+
+mod_time () {
+       echo `stat -c "%Y" $CMD_OUT`
+}
+
+the_time() {
+       echo `date +%s`
+}
+
+# watchdog process
+
+watchdog () {
+       touch $CMD_OUT
+
+       while true; do
+               sleep $SLEEP_TIME
+
+               time_diff=$((`the_time` - `mod_time`))
+
+               if [ $time_diff -ge $MAX_NO_OUTPUT ]; then
+                       echo 
"=============================================================================="
+                       echo "Process produced no output for ${MAX_NO_OUTPUT} 
seconds."
+                       echo 
"=============================================================================="
+
+                       # run timeout callback
+                       $WATCHDOG_CALLBACK_ON_TIMEOUT
+
+                       echo "Killing process with pid=$(<$CMD_PID) and all 
descendants"
+                       pkill -P $(<$CMD_PID) # kill descendants
+                       kill $(<$CMD_PID) # kill process itself
+
+                       exit 1
+               fi
+       done
+}
+
+assume_available () {
+       VAR=$1
+       if [ -z "$VAR" ] ; then
+               echo "ERROR: Environment variable '$VAR' is not set but 
expected by watchdog.sh"
+               exit 1
+       fi
+}
+
+# =============================================
+# main function
+# =============================================
+
+# entrypoint
+function run_with_watchdog() {
+       local cmd="$1"
+
+       # check preconditions
+       assume_available CMD_OUT # used for writing the process output (to 
check for activity)
+       assume_available CMD_PID # location of file to write process id to
+       assume_available CMD_EXIT # location of file to writ exit code to
+       assume_available WATCHDOG_CALLBACK_ON_TIMEOUT # bash function to call 
on timeout
+
+       watchdog &

Review comment:
       It access CMD_PID etc. and the callback.

##########
File path: tools/azure-pipelines/jobs-template.yml
##########
@@ -121,15 +128,34 @@ jobs:
     continueOnError: true # continue the build even if the cache fails.
     condition: not(eq('${{parameters.test_pool_definition.name}}', 'Default'))
     displayName: Cache Maven local repo
+
   - script: |
       echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_11_X64"
       echo "##vso[task.setvariable variable=PATH]$JAVA_HOME_11_X64/bin:$PATH"
     displayName: "Set to jdk11"
     condition: eq('${{parameters.jdk}}', 'jdk11')  
+
   - script: sudo sysctl -w kernel.core_pattern=core.%p
     displayName: Set coredump pattern
+
   # Test
-  - script: STAGE=test ${{parameters.environment}} 
./tools/azure-pipelines/azure_controller.sh $(module)
+  - script: |
+      ./tools/azure-pipelines/unpack_build_artifact.sh
+      export DEBUG_FILES="$AGENT_TEMPDIRECTORY/debug_files"

Review comment:
       I figured as much.
   
   I'd say that if it is not just calling script A,B,C, then add a separate 
script for it. What we absolutely want to prevent is the scripts being spread 
out over several places.
   TBH there's probably even merit in having each step call at most 1 script.

##########
File path: tools/azure-pipelines/build-python-wheels.yml
##########
@@ -24,7 +24,6 @@ jobs:
       # Compile
       - script: |
           ${{parameters.environment}} ./tools/ci/compile.sh
-          ./tools/azure-pipelines/create_build_artifact.sh

Review comment:
       The excludes are adding files _back_, increasing the file size.

##########
File path: tools/azure-pipelines/build-python-wheels.yml
##########
@@ -24,7 +24,6 @@ jobs:
       # Compile
       - script: |
           ${{parameters.environment}} ./tools/ci/compile.sh
-          ./tools/azure-pipelines/create_build_artifact.sh

Review comment:
       The excludes are adding files (jars) _back_, increasing the file size.

##########
File path: 
flink-yarn-tests/src/test/java/org/apache/flink/yarn/YarnTestBase.java
##########
@@ -1068,8 +1067,8 @@ public static void teardown() throws Exception {
 
        }
 
-       public static boolean isOnTravis() {
-               return System.getenv("TRAVIS") != null && 
System.getenv("TRAVIS").equals("true");
+       public static boolean isOnCI() {
+               return System.getenv("IS_CI") != null && 
System.getenv("IS_CI").equals("true");

Review comment:
       Adjust the TravisDownloadCache(Factory) to detect azure environment 
variables and determine the correct cache directory.

##########
File path: tools/ci/maven-utils.sh
##########
@@ -73,7 +73,7 @@ function collect_coredumps {
        echo "Searching for .dump, .dumpstream and related files in 
'$SEARCHDIR'"
        for file in `find $SEARCHDIR -type f -regextype posix-extended -iregex 
'.*\.hprof|.*\.dump|.*\.dumpstream|.*hs.*\.log|.*/core(.[0-9]+)?$'`; do
                echo "Moving '$file' to target directory ('$TARGET_DIR')"
-               mv $file $TARGET_DIR/
+               mv $file $TARGET_DIR/$(echo $file | tr "/" "-")

Review comment:
       how could there be dumpstreams in multiple modules? Aren't we failing on 
the first test failure?

##########
File path: tools/ci/watchdog.sh
##########
@@ -0,0 +1,122 @@
+#!/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.
+################################################################################
+
+#
+# This file contains a watchdog tool to run monitor and potentially kill tasks
+# not producing any output for n seconds.
+#
+
+# Number of seconds w/o output before printing a stack trace and killing the 
watched process
+MAX_NO_OUTPUT=${MAX_NO_OUTPUT:-900}
+
+# Number of seconds to sleep before checking the output again
+SLEEP_TIME=${SLEEP_TIME:-20}
+
+CMD_OUT=${CMD_OUT:-"/tmp/watchdog.out"}
+CMD_PID=${CMD_PID:-"/tmp/watchdog.pid"}
+CMD_EXIT=${CMD_EXIT:-"/tmp/watchdog.exit"}
+
+
+# =============================================
+# Utility functions
+# ============================================= 
+
+mod_time () {
+       echo `stat -c "%Y" $CMD_OUT`
+}
+
+the_time() {
+       echo `date +%s`
+}
+
+# watchdog process
+
+watchdog () {
+       touch $CMD_OUT
+
+       while true; do
+               sleep $SLEEP_TIME
+
+               time_diff=$((`the_time` - `mod_time`))
+
+               if [ $time_diff -ge $MAX_NO_OUTPUT ]; then
+                       echo 
"=============================================================================="
+                       echo "Process produced no output for ${MAX_NO_OUTPUT} 
seconds."
+                       echo 
"=============================================================================="
+
+                       # run timeout callback
+                       $WATCHDOG_CALLBACK_ON_TIMEOUT
+
+                       echo "Killing process with pid=$(<$CMD_PID) and all 
descendants"
+                       pkill -P $(<$CMD_PID) # kill descendants
+                       kill $(<$CMD_PID) # kill process itself
+
+                       exit 1
+               fi
+       done
+}
+
+assume_available () {
+       VAR=$1
+       if [ -z "$VAR" ] ; then
+               echo "ERROR: Environment variable '$VAR' is not set but 
expected by watchdog.sh"
+               exit 1
+       fi
+}
+
+# =============================================
+# main function
+# =============================================
+
+# entrypoint
+function run_with_watchdog() {
+       local cmd="$1"
+
+       # check preconditions
+       assume_available CMD_OUT # used for writing the process output (to 
check for activity)
+       assume_available CMD_PID # location of file to write process id to
+       assume_available CMD_EXIT # location of file to writ exit code to
+       assume_available WATCHDOG_CALLBACK_ON_TIMEOUT # bash function to call 
on timeout
+
+       watchdog &

Review comment:
       I'm well aware what `CMD_PID` contains.
   
   I don't quite buy into it being an internal configuration when at the same 
time we allow it to be modified from the outside. If it is internal 
configuration there's_ no point in doing the assume_available checks.
   
   > There is probably no logical argument why the two approaches we are 
discussing are better or worse, because both approaches work.
   
   Meh. Clarity matters, especially when working on bash scripts. Using 
environment variables to pass around named arguments is common, and that's how 
I interpret `CMD_PID`. The same applies to `SLEEP_TIME ` and `MAX_NO_OUTPUT`.
   If it is internal configuration then it shouldn't be modifiable; if it is 
external configuration then it should be explicitly passed around so you have a 
single place for checking preconditions, like assume_available.

##########
File path: tools/ci/watchdog.sh
##########
@@ -0,0 +1,122 @@
+#!/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.
+################################################################################
+
+#
+# This file contains a watchdog tool to run monitor and potentially kill tasks
+# not producing any output for n seconds.
+#
+
+# Number of seconds w/o output before printing a stack trace and killing the 
watched process
+MAX_NO_OUTPUT=${MAX_NO_OUTPUT:-900}
+
+# Number of seconds to sleep before checking the output again
+SLEEP_TIME=${SLEEP_TIME:-20}
+
+CMD_OUT=${CMD_OUT:-"/tmp/watchdog.out"}
+CMD_PID=${CMD_PID:-"/tmp/watchdog.pid"}
+CMD_EXIT=${CMD_EXIT:-"/tmp/watchdog.exit"}
+
+
+# =============================================
+# Utility functions
+# ============================================= 
+
+mod_time () {
+       echo `stat -c "%Y" $CMD_OUT`
+}
+
+the_time() {
+       echo `date +%s`
+}
+
+# watchdog process
+
+watchdog () {
+       touch $CMD_OUT
+
+       while true; do
+               sleep $SLEEP_TIME
+
+               time_diff=$((`the_time` - `mod_time`))
+
+               if [ $time_diff -ge $MAX_NO_OUTPUT ]; then
+                       echo 
"=============================================================================="
+                       echo "Process produced no output for ${MAX_NO_OUTPUT} 
seconds."
+                       echo 
"=============================================================================="
+
+                       # run timeout callback
+                       $WATCHDOG_CALLBACK_ON_TIMEOUT
+
+                       echo "Killing process with pid=$(<$CMD_PID) and all 
descendants"
+                       pkill -P $(<$CMD_PID) # kill descendants
+                       kill $(<$CMD_PID) # kill process itself
+
+                       exit 1
+               fi
+       done
+}
+
+assume_available () {
+       VAR=$1
+       if [ -z "$VAR" ] ; then
+               echo "ERROR: Environment variable '$VAR' is not set but 
expected by watchdog.sh"
+               exit 1
+       fi
+}
+
+# =============================================
+# main function
+# =============================================
+
+# entrypoint
+function run_with_watchdog() {
+       local cmd="$1"
+
+       # check preconditions
+       assume_available CMD_OUT # used for writing the process output (to 
check for activity)
+       assume_available CMD_PID # location of file to write process id to
+       assume_available CMD_EXIT # location of file to writ exit code to
+       assume_available WATCHDOG_CALLBACK_ON_TIMEOUT # bash function to call 
on timeout
+
+       watchdog &

Review comment:
       Note that I also referred to the callback, which is very much not 
internal configuration.

##########
File path: tools/ci/watchdog.sh
##########
@@ -0,0 +1,122 @@
+#!/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.
+################################################################################
+
+#
+# This file contains a watchdog tool to run monitor and potentially kill tasks
+# not producing any output for n seconds.
+#
+
+# Number of seconds w/o output before printing a stack trace and killing the 
watched process
+MAX_NO_OUTPUT=${MAX_NO_OUTPUT:-900}
+
+# Number of seconds to sleep before checking the output again
+SLEEP_TIME=${SLEEP_TIME:-20}
+
+CMD_OUT=${CMD_OUT:-"/tmp/watchdog.out"}
+CMD_PID=${CMD_PID:-"/tmp/watchdog.pid"}
+CMD_EXIT=${CMD_EXIT:-"/tmp/watchdog.exit"}
+
+
+# =============================================
+# Utility functions
+# ============================================= 
+
+mod_time () {
+       echo `stat -c "%Y" $CMD_OUT`
+}
+
+the_time() {
+       echo `date +%s`
+}
+
+# watchdog process
+
+watchdog () {
+       touch $CMD_OUT
+
+       while true; do
+               sleep $SLEEP_TIME
+
+               time_diff=$((`the_time` - `mod_time`))
+
+               if [ $time_diff -ge $MAX_NO_OUTPUT ]; then
+                       echo 
"=============================================================================="
+                       echo "Process produced no output for ${MAX_NO_OUTPUT} 
seconds."
+                       echo 
"=============================================================================="
+
+                       # run timeout callback
+                       $WATCHDOG_CALLBACK_ON_TIMEOUT
+
+                       echo "Killing process with pid=$(<$CMD_PID) and all 
descendants"
+                       pkill -P $(<$CMD_PID) # kill descendants
+                       kill $(<$CMD_PID) # kill process itself
+
+                       exit 1
+               fi
+       done
+}
+
+assume_available () {
+       VAR=$1
+       if [ -z "$VAR" ] ; then
+               echo "ERROR: Environment variable '$VAR' is not set but 
expected by watchdog.sh"
+               exit 1
+       fi
+}
+
+# =============================================
+# main function
+# =============================================
+
+# entrypoint
+function run_with_watchdog() {
+       local cmd="$1"
+
+       # check preconditions
+       assume_available CMD_OUT # used for writing the process output (to 
check for activity)
+       assume_available CMD_PID # location of file to write process id to
+       assume_available CMD_EXIT # location of file to writ exit code to
+       assume_available WATCHDOG_CALLBACK_ON_TIMEOUT # bash function to call 
on timeout
+
+       watchdog &

Review comment:
       I'm well aware what `CMD_PID` contains.
   
   I don't quite buy into it being an internal configuration when at the same 
time we allow it to be modified from the outside. If it is internal 
configuration there's_ no point in doing the assume_available checks.
   
   > There is probably no logical argument why the two approaches we are 
discussing are better or worse, because both approaches work.
   
   Meh. Clarity matters, especially when working on bash scripts. Using 
environment variables to pass around named arguments is common, and that's how 
I interpret `CMD_PID`. The same applies to `SLEEP_TIME` and `MAX_NO_OUTPUT`.
   If it is internal configuration then it shouldn't be modifiable; if it is 
external configuration then it should be explicitly passed around so you have a 
single place for checking preconditions, like assume_available.

##########
File path: tools/ci/test_controller.sh
##########
@@ -0,0 +1,127 @@
+#!/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.
+################################################################################
+
+#
+# This file contains generic control over the test execution.
+#
+
+HERE="`dirname \"$0\"`"             # relative
+HERE="`( cd \"$HERE\" && pwd )`"    # absolutized and normalized
+if [ -z "$HERE" ] ; then
+       exit 1
+fi
+
+source "${HERE}/stage.sh"
+source "${HERE}/maven-utils.sh"
+source "${HERE}/controller_utils.sh"
+source "${HERE}/watchdog.sh"
+TEST=$1
+
+# =============================================================================
+# Step 0: Check & print environment information & configure env
+# =============================================================================
+
+# check preconditions
+if [ -z "$DEBUG_FILES" ] ; then
+       echo "ERROR: Environment variable 'DEBUG_FILES' is not set but expected 
by test_controller.sh"

Review comment:
       I like the DEBUG_FILES prefix; maybe `DEBUG_FILES_OUTPUT_DIR`?

##########
File path: tools/ci/maven-utils.sh
##########
@@ -73,7 +73,7 @@ function collect_coredumps {
        echo "Searching for .dump, .dumpstream and related files in 
'$SEARCHDIR'"
        for file in `find $SEARCHDIR -type f -regextype posix-extended -iregex 
'.*\.hprof|.*\.dump|.*\.dumpstream|.*hs.*\.log|.*/core(.[0-9]+)?$'`; do
                echo "Moving '$file' to target directory ('$TARGET_DIR')"
-               mv $file $TARGET_DIR/
+               mv $file $TARGET_DIR/$(echo $file | tr "/" "-")

Review comment:
       hmm, not sure. Maybe this happens because the JVM writes that to the 
STDERR. That's annoying :/
   
   This is probably fine then; I was initially worried we might get so long 
filenames that you wouldn't be able to extract the logs on Windows.

##########
File path: tools/ci/stage.sh
##########
@@ -158,6 +158,9 @@ function get_compile_modules_for_stage() {
             # the negation takes precedence, thus not all required modules 
would be built
             echo ""
         ;;
+        (${STAGE_PYTHON})
+            echo ""

Review comment:
       sounds link echo "-pl $flink-dist -am" would be sufficient tho

##########
File path: tools/ci/stage.sh
##########
@@ -158,6 +158,9 @@ function get_compile_modules_for_stage() {
             # the negation takes precedence, thus not all required modules 
would be built
             echo ""
         ;;
+        (${STAGE_PYTHON})
+            echo ""

Review comment:
       sounds link `echo "-pl $flink-dist -am"` would be sufficient tho

##########
File path: tools/azure-pipelines/debug_files_utils.sh
##########
@@ -0,0 +1,34 @@
+#!/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.
+################################################################################
+
+function debug_files_prepare {

Review comment:
       nit: odd naming scheme with the verb being the suffix

##########
File path: tools/azure-pipelines/jobs-template.yml
##########
@@ -64,14 +65,16 @@ jobs:
     displayName: "Set to jdk11"
     condition: eq('${{parameters.jdk}}', 'jdk11')
   # Compile
-  - script: STAGE=compile ${{parameters.environment}} 
./tools/azure_controller.sh compile
-    displayName: Build
+  - script: |
+      ${{parameters.environment}} ./tools/ci/compile.sh || exit $?
+      ./tools/azure-pipelines/create_build_artifact.sh
+    displayName: Compile
 
   # upload artifacts for next stage
   - task: PublishPipelineArtifact@1
     inputs:
-      path: $(CACHE_FLINK_DIR)

Review comment:
       so is `path` like a deprecated parameter?

##########
File path: flink-end-to-end-tests/run-nightly-tests.sh
##########
@@ -235,15 +235,15 @@ printf "Running Java end-to-end tests\n"
 printf 
"==============================================================================\n"
 
 
-LOG4J_PROPERTIES=${END_TO_END_DIR}/../tools/log4j-travis.properties
+LOG4J_PROPERTIES=${END_TO_END_DIR}/../tools/ci/log4j-ci.properties

Review comment:
       nit: the "ci" suffix could probably be removed, given that the directory 
already contains "ci".

##########
File path: tools/ci/controller_utils.sh
##########
@@ -0,0 +1,60 @@
+#!/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.
+################################################################################
+
+print_system_info() {
+    echo "CPU information"
+    lscpu
+
+    echo "Memory information"
+    cat /proc/meminfo
+
+    echo "Disk information"
+    df -hH
+
+    echo "Running build as"
+    whoami
+}
+
+# locate YARN logs and put them into artifacts directory
+put_yarn_logs_to_artifacts() {
+       for file in `find ./flink-yarn-tests/target -type f -name '*.log'`; do
+               TARGET_FILE=`echo "$file" | grep -Eo 
"container_[0-9_]+/(.*).log"`
+               TARGET_DIR=`dirname      "$TARGET_FILE"`
+               mkdir -p "$DEBUG_FILES_OUTPUT_DIR/yarn-tests/$TARGET_DIR"
+               cp $file "$DEBUG_FILES_OUTPUT_DIR/yarn-tests/$TARGET_FILE"
+       done
+}
+
+print_stacktraces () {
+       echo 
"=============================================================================="
+       echo "The following Java processes are running (JPS)"
+       echo 
"=============================================================================="
+
+       jps

Review comment:
       I guess this is for debug purposes? It may be better to store the 
results in a variable, and then echo/awk it. Otherwise it could happen that jps 
returns 2 different set of processes, which could be misleading.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to