-
Notifications
You must be signed in to change notification settings - Fork 107
Catch pipeline failures and return proper error status. #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
portante
merged 3 commits into
distributed-system-analysis:master
from
ndokos:wip-ssh-status
Jul 15, 2016
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| +++ Running test-12 pbench-clear-tools | ||
| removing tools-default/mpstat | ||
| running . /opt/pbench-agent/profile; pbench-clear-tools --group default on fubar | ||
| Removing the remote remote@fubar | ||
| --- Finished test-12 pbench-clear-tools (status=1} | ||
| +++ pbench tree state | ||
| /var/tmp/pbench-test-utils/pbench | ||
| /var/tmp/pbench-test-utils/pbench/tmp | ||
| /var/tmp/pbench-test-utils/pbench/tools-default | ||
| --- pbench tree state | ||
| +++ pbench.log file contents | ||
| grep: /var/tmp/pbench-test-utils/pbench/pbench.log: No such file or directory | ||
| --- pbench.log file contents | ||
| +++ test-execution.log file contents | ||
| /var/tmp/pbench-test-utils/test-execution.log:/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -n fubar . /opt/pbench-agent/profile; pbench-clear-tools --group default | ||
| --- test-execution.log file contents |
25 changes: 25 additions & 0 deletions
25
agent/util-scripts/gold/pbench-postprocess-tools/test-13.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| +++ Running test-13 pbench-postprocess-tools | ||
| tar: This does not look like a tar archive | ||
| tar: Exiting with failure status due to previous errors | ||
| --- Finished test-13 pbench-postprocess-tools (status=2} | ||
| +++ pbench tree state | ||
| /var/tmp/pbench-test-utils/pbench | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log | ||
| /var/tmp/pbench-test-utils/pbench/tmp | ||
| /var/tmp/pbench-test-utils/pbench/tmp/tools-default | ||
| /var/tmp/pbench-test-utils/pbench/tools-default | ||
| /var/tmp/pbench-test-utils/pbench/tools-default/remote@fubar | ||
| /var/tmp/pbench-test-utils/pbench/tools-default/remote@fubar: | ||
| --- pbench tree state | ||
| +++ pbench.log file contents | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] [pbench-postprocess-tools]started: --dir=/var/tmp/pbench-test-utils/pbench/tmp --group=default --iteration=1 | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] [pbench-postprocess-tools]running this tool on fubar: ssh -o StrictHostKeyChecking=no -n fubar pbench-postprocess-tools --iteration=1 --group=default --dir=/var/tmp/pbench-test-utils/pbench/tmp | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] [pbench-postprocess-tools]started: copying tool data ( MB) from fubar | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] [pbench-postprocess-tools]copying tool data failed for remote fubar | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] [pbench-postprocess-tools]completed: | ||
| --- pbench.log file contents | ||
| +++ test-execution.log file contents | ||
| /var/tmp/pbench-test-utils/test-execution.log:/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/ssh -o StrictHostKeyChecking=no -n fubar pbench-postprocess-tools --iteration=1 --group=default --dir=/var/tmp/pbench-test-utils/pbench/tmp | ||
| /var/tmp/pbench-test-utils/test-execution.log:/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/ssh -o StrictHostKeyChecking=no -n fubar du -sm /var/tmp/pbench-test-utils/pbench/tmp/tools-default | ||
| /var/tmp/pbench-test-utils/test-execution.log:/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/ssh -o StrictHostKeyChecking=no -n fubar cd /var/tmp/pbench-test-utils/pbench/tmp/tools-default && tar cf - * | ||
| --- test-execution.log file contents |
26 changes: 26 additions & 0 deletions
26
agent/util-scripts/gold/pbench-register-tool-set/test-11.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| +++ Running test-11 pbench-register-tool-set | ||
| --- Finished test-11 pbench-register-tool-set (status=4} | ||
| +++ pbench tree state | ||
| /var/tmp/pbench-test-utils/pbench | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log | ||
| /var/tmp/pbench-test-utils/pbench/tmp | ||
| /var/tmp/pbench-test-utils/pbench/tools-default | ||
| /var/tmp/pbench-test-utils/pbench/tools-default/remote@fubar | ||
| /var/tmp/pbench-test-utils/pbench/tools-default/remote@fubar: | ||
| --- pbench tree state | ||
| +++ pbench.log file contents | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] tool_opts: --interval=3 | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] tool_opts[0]="--interval=3"; pbench-register-tool --name=mpstat --group=default $label_opt -- "${tool_opts[@]}" 2>&1 | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] tool_opts: --interval=3 | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] tool_opts[0]="--interval=3"; pbench-register-tool --name=vmstat --group=default $label_opt -- "${tool_opts[@]}" 2>&1 | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] tool_opts: --interval=3 | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] tool_opts[0]="--interval=3"; pbench-register-tool --name=iostat --group=default $label_opt -- "${tool_opts[@]}" 2>&1 | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] tool_opts: --record-opts=record -a --freq=100 | ||
| /var/tmp/pbench-test-utils/pbench/pbench.log:[debug][1900-01-01T00:00:00.000000] tool_opts[0]="--record-opts=record -a --freq=100"; pbench-register-tool --name=perf --group=default $label_opt -- "${tool_opts[@]}" 2>&1 | ||
| --- pbench.log file contents | ||
| +++ test-execution.log file contents | ||
| /var/tmp/pbench-test-utils/test-execution.log:/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/ssh -o StrictHostKeyChecking=no fubar tool_opts[0]="--interval=3"; pbench-register-tool --name=mpstat --group=default -- "${tool_opts[@]}" 2>&1 | ||
| /var/tmp/pbench-test-utils/test-execution.log:/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/ssh -o StrictHostKeyChecking=no fubar tool_opts[0]="--interval=3"; pbench-register-tool --name=vmstat --group=default -- "${tool_opts[@]}" 2>&1 | ||
| /var/tmp/pbench-test-utils/test-execution.log:/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/ssh -o StrictHostKeyChecking=no fubar tool_opts[0]="--interval=3"; pbench-register-tool --name=iostat --group=default -- "${tool_opts[@]}" 2>&1 | ||
| /var/tmp/pbench-test-utils/test-execution.log:/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/ssh -o StrictHostKeyChecking=no fubar tool_opts[0]="--record-opts=record -a --freq=100"; pbench-register-tool --name=perf --group=default -- "${tool_opts[@]}" 2>&1 | ||
| --- test-execution.log file contents |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ if [ $? -ne 0 ]; then | |
| printf -- "\t will store and process data\n" | ||
| printf "\n" | ||
| printf -- "\t-i str --iteration=num, num = a number representing the\n" | ||
| printf -- "\t iteration data was collected for" | ||
| printf -- "\t iteration data was collected for\n" | ||
| exit 1 | ||
| fi | ||
| eval set -- "$opts"; | ||
|
|
@@ -74,6 +74,7 @@ while true; do | |
| esac | ||
| done | ||
|
|
||
| typeset -i nerrs=0 | ||
| iteration_num=`echo $iteration | awk -F- '{print $1}'` | ||
| # this tool group's directory which stores options, etc. | ||
| if [ -d "$pbench_run/tools-$group" ]; then | ||
|
|
@@ -92,6 +93,13 @@ fi | |
| tool_output_dir="$dir/tools-$group" | ||
| mkdir -p $tool_output_dir | ||
|
|
||
| # Try to prevent a cascade of tools running. | ||
| if [ "$action" == "start" ] ;then | ||
| # Kill any tools running from a previous incantation before | ||
| # starting this one. | ||
| pbench-kill-tools --group $group | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a significant change to the PR. Can you update the summary line for the commit message to somehow include this and then call this behavior change out explicitly in the commit message? |
||
| fi | ||
|
|
||
| function move_tool_data { | ||
| local remote_host=$1 | ||
| local remote_label=$2 | ||
|
|
@@ -100,6 +108,12 @@ function move_tool_data { | |
| tool_data_size=`ssh $ssh_opts -n $remote_host du -sm $tool_output_dir | awk '{print $1}'` | ||
| debug_log "[$script_name]started: copying tool data ($tool_data_size MB) from $remote_host" | ||
| ssh $ssh_opts -n $remote_host "cd $tool_output_dir && tar cf - *" | tar mxf - | ||
| rc=$? | ||
| if [ $rc != 0 ] ;then | ||
| debug_log "[$script_name]copying tool data failed for remote $remote_host" | ||
| popd > /dev/null | ||
| return $rc | ||
| fi | ||
| # if the full hostname was used in pbench-register-tool --remote, make sure that is preserved in the directory name | ||
| if [ $remote_host != "$remote_shost" ]; then | ||
| if [ -e "$remote_label:$remote_shost" ]; then | ||
|
|
@@ -112,11 +126,14 @@ function move_tool_data { | |
| debug_log "[$script_name]completed: copying of tool data on $remote_host" | ||
| debug_log "[$script_name]started: deleting tool data on $remote_host" | ||
| ssh $ssh_opts -n $remote_host "cd $tool_output_dir && /bin/rm -rf *" | ||
| rc=$? | ||
| debug_log "[$script_name]completed: deleting tool data on $remote_host" | ||
| popd >/dev/null | ||
| return $rc | ||
| } | ||
|
|
||
| ### phase 1: for each tool, call the tool script with --$action (start, stop, or postprocess) | ||
| pids="" | ||
| for this_tool_file in `/bin/ls $tool_group_dir`; do | ||
| if [ "$this_tool_file" == "label" ]; then | ||
| continue; | ||
|
|
@@ -128,6 +145,7 @@ for this_tool_file in `/bin/ls $tool_group_dir`; do | |
| # tool options are stored on the remote host's tool file, so no need to pass it here | ||
| debug_log "[$script_name]running this tool on $remote: ssh $ssh_opts -n $remote pbench-$action-tools --iteration=$iteration --group=$group --dir=$dir" | ||
| ssh $ssh_opts -n $remote pbench-$action-tools --iteration=$iteration --group=$group --dir=$dir & | ||
| pids="$pids $!" | ||
| else | ||
| # tool is local | ||
| # assemble the tool options in to an array | ||
|
|
@@ -159,12 +177,19 @@ for this_tool_file in `/bin/ls $tool_group_dir`; do | |
| fi | ||
| else | ||
| $pbench_bin/tool-scripts/$name --$action --iteration=$iteration --group=$group --dir=$dir "${tool_opts[@]}" & | ||
| pids="$pids $!" | ||
| fi | ||
| fi | ||
|
|
||
| fi | ||
| done | ||
| wait | ||
| for p in $pids ;do | ||
| wait $p | ||
| rc=$? | ||
| if [[ $rc -ne 0 ]] ;then | ||
| nerrs=$nerrs+1 | ||
| fi | ||
| done | ||
| if [ "$action" == "postprocess" ]; then | ||
| # phase 2: now that the local results are ready, move them | ||
| # down to $tool_output_dir/[$label:]$hostname. | ||
|
|
@@ -185,12 +210,21 @@ if [ "$action" == "postprocess" ]; then | |
|
|
||
| ### phase 3: copy over data from remote hosts | ||
| # for the remote tools, copy over the postprocess data | ||
| pids="" | ||
| for this_tool_file in `/bin/ls $tool_group_dir | grep "^remote"`; do | ||
| remote_hostname=`echo "$this_tool_file" | awk -F@ '{print $2}'` | ||
| label=`cat $tool_group_dir/$this_tool_file` | ||
| # copy over the data from postprocessing | ||
| move_tool_data $remote_hostname $label & | ||
| pids="$pids $!" | ||
| done | ||
| for p in $pids ;do | ||
| wait $p | ||
| rc=$? | ||
| if [[ $rc -ne 0 ]] ;then | ||
| nerrs=$nerrs+1 | ||
| fi | ||
| done | ||
| wait | ||
| fi | ||
| debug_log "[$script_name]completed: $@" | ||
| exit $nerrs | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,3 +179,4 @@ else # register this tool on the remote host | |
| echo "$label" >"$this_tool_file" | ||
| fi | ||
| fi | ||
| exit $rc | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [pbench/tools] | ||
| default-tool-set = mpstat, vmstat, iostat |
1 change: 1 addition & 0 deletions
1
agent/util-scripts/samples/pbench-clear-tools/test-12/tools-default/mpstat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --interval: 34 |
Empty file.
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we specify real tabs instead of spaces for emacs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this is what indent-tabs-mode: t does. The doc says
Indentation can insert tabs if this is non-nil.