Skip to content

Commit 35ad9b0

Browse files
committed
[benchmarks] Include a stack trace on timeout.
1 parent a2d1f99 commit 35ad9b0

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

.github/actions/run-benchmarks/action.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ inputs:
2424
The directory name of the repository where graphs and CSVs from benchmarks should be saved.
2525
type: string
2626
default: benchmarks-lingua-franca
27+
errors-file:
28+
description: |
29+
The file in which to write any error messages.
30+
type: string
31+
default: errors.txt
2732

2833

2934
outputs:
@@ -56,13 +61,15 @@ runs:
5661
OUTPUT_DIR=csvs/$(date -I)
5762
mkdir -p ${{ inputs.repo-for-saving-data }}/csvs
5863
OUTPUT_FILENAME=${{ inputs.scheduler }}-${{ inputs.num-workers }}-${{ inputs.runtime-ref }}-${SHA:0:7}.csv
59-
EXISTING_FILE=$(find ${{ inputs.repo-for-saving-data }}/csvs -name $OUTPUT_FILENAME | head -n 1)
64+
cd ${{ inputs.repo-for-saving-data }}
65+
EXISTING_FILE=$(find ./csvs -name $OUTPUT_FILENAME | head -n 1)
66+
cd ..
6067
if [[ -z $EXISTING_FILE ]]; then
6168
mkdir -p ${{ inputs.repo-for-saving-data }}/$OUTPUT_DIR
6269
echo "The collected benchmark results will be saved to $OUTPUT_FILE."
6370
echo "::set-output name=output-file::$OUTPUT_DIR/$OUTPUT_FILENAME"
6471
else
65-
echo "The benchmark will not be run because results for that commit are already saved at $OUTPUT_FILE."
72+
echo "The benchmark will not be run because results for that commit are already saved at $EXISTING_FILE."
6673
echo "::set-output name=file-already-exists::true"
6774
echo "::set-output name=output-file::$EXISTING_FILE"
6875
fi
@@ -88,7 +95,9 @@ runs:
8895
target=lf-${{ inputs.target }} \
8996
size=fast \
9097
++target.params.scheduler=${{ inputs.scheduler }} \
91-
threads=${{ inputs.num-workers }}
98+
threads=${{ inputs.num-workers }} \
99+
| tee >(grep "\[ERROR\]" >> ${{ inputs.errors-file }})
100+
echo "::set-output name=output-file::$EXISTING_FILE"
92101
shell: bash
93102
if: ${{ ! steps.compute-output-file.outputs.file-already-exists }}
94103

.github/actions/set-up-workspace/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ runs:
2929
echo "LF_PATH=$GITHUB_WORKSPACE/lf" >> $GITHUB_ENV
3030
echo "LF_BENCHMARKS_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
3131
shell: bash
32+
33+
- name: Install eu-stack
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install elfutils
37+
shell: bash

.github/actions/visualize-save-upload/action.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,31 @@ runs:
4646
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
4747
git config --global user.name "github-actions[bot]"
4848
git fetch
49-
git add ${{ inputs.csv-files }} ${{ steps.figure.outputs.output-file }}
49+
git add -f ${{ inputs.csv-files }} ${{ steps.figure.outputs.output-file }}
5050
if [[ $(git status) != *"nothing to commit"* ]]; then
5151
git commit -m "benchmark ${{ github.sha }}"
5252
git push https://token:${{ inputs.token }}@github.com/lf-lang/${{ inputs.repo-for-saving-data }}.git
5353
fi
5454
cd ..
5555
shell: bash
5656

57+
- name: Compute error messages
58+
id: compute-error-messages
59+
run: |
60+
echo $(ls)
61+
if [ -f errors.txt ]; then
62+
ERROR_MESSAGES=$(cat errors.txt)
63+
echo "The benchmark runner reported the following errors:\n$ERROR_MESSAGES"
64+
echo "::set-output name=error-messages::Error messages: $ERROR_MESSAGES"
65+
fi
66+
shell: bash
67+
5768
- name: Comment PR
5869
uses: thollander/actions-comment-pull-request@v1
5970
with:
6071
message: |
6172
Running benchmarks from commit ${{ github.sha }}...
73+
${{ steps.compute-error-messages.outputs.error-messages }}
6274
6375
Results so far:
6476
@@ -73,6 +85,7 @@ runs:
7385
with:
7486
message: |
7587
:heavy_check_mark: Finished running benchmarks from ${{ github.sha }}.
88+
${{ steps.compute-error-messages.outputs.error-messages }}
7689
7790
![Visualization of the benchmark results.](https://raw.githubusercontent.com/lf-lang/${{ inputs.repo-for-saving-data }}/saved-benchmark-results/${{ steps.figure.outputs.output-file }})
7891
comment_includes: ${{ github.sha }}

0 commit comments

Comments
 (0)