Skip to content

Commit

Permalink
[benchmarks] Include a stack trace on timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
petervdonovan committed Jul 18, 2022
1 parent a2d1f99 commit 35ad9b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
15 changes: 12 additions & 3 deletions .github/actions/run-benchmarks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ inputs:
The directory name of the repository where graphs and CSVs from benchmarks should be saved.
type: string
default: benchmarks-lingua-franca
errors-file:
description: |
The file in which to write any error messages.
type: string
default: errors.txt


outputs:
Expand Down Expand Up @@ -56,13 +61,15 @@ runs:
OUTPUT_DIR=csvs/$(date -I)
mkdir -p ${{ inputs.repo-for-saving-data }}/csvs
OUTPUT_FILENAME=${{ inputs.scheduler }}-${{ inputs.num-workers }}-${{ inputs.runtime-ref }}-${SHA:0:7}.csv
EXISTING_FILE=$(find ${{ inputs.repo-for-saving-data }}/csvs -name $OUTPUT_FILENAME | head -n 1)
cd ${{ inputs.repo-for-saving-data }}
EXISTING_FILE=$(find ./csvs -name $OUTPUT_FILENAME | head -n 1)
cd ..
if [[ -z $EXISTING_FILE ]]; then
mkdir -p ${{ inputs.repo-for-saving-data }}/$OUTPUT_DIR
echo "The collected benchmark results will be saved to $OUTPUT_FILE."
echo "::set-output name=output-file::$OUTPUT_DIR/$OUTPUT_FILENAME"
else
echo "The benchmark will not be run because results for that commit are already saved at $OUTPUT_FILE."
echo "The benchmark will not be run because results for that commit are already saved at $EXISTING_FILE."
echo "::set-output name=file-already-exists::true"
echo "::set-output name=output-file::$EXISTING_FILE"
fi
Expand All @@ -88,7 +95,9 @@ runs:
target=lf-${{ inputs.target }} \
size=fast \
++target.params.scheduler=${{ inputs.scheduler }} \
threads=${{ inputs.num-workers }}
threads=${{ inputs.num-workers }} \
| tee >(grep "\[ERROR\]" >> ${{ inputs.errors-file }})
echo "::set-output name=output-file::$EXISTING_FILE"
shell: bash
if: ${{ ! steps.compute-output-file.outputs.file-already-exists }}

Expand Down
6 changes: 6 additions & 0 deletions .github/actions/set-up-workspace/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ runs:
echo "LF_PATH=$GITHUB_WORKSPACE/lf" >> $GITHUB_ENV
echo "LF_BENCHMARKS_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
shell: bash

- name: Install eu-stack
run: |
sudo apt-get update
sudo apt-get install elfutils
shell: bash
15 changes: 14 additions & 1 deletion .github/actions/visualize-save-upload/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,31 @@ runs:
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git fetch
git add ${{ inputs.csv-files }} ${{ steps.figure.outputs.output-file }}
git add -f ${{ inputs.csv-files }} ${{ steps.figure.outputs.output-file }}
if [[ $(git status) != *"nothing to commit"* ]]; then
git commit -m "benchmark ${{ github.sha }}"
git push https://token:${{ inputs.token }}@github.com/lf-lang/${{ inputs.repo-for-saving-data }}.git
fi
cd ..
shell: bash

- name: Compute error messages
id: compute-error-messages
run: |
echo $(ls)
if [ -f errors.txt ]; then
ERROR_MESSAGES=$(cat errors.txt)
echo "The benchmark runner reported the following errors:\n$ERROR_MESSAGES"
echo "::set-output name=error-messages::Error messages: $ERROR_MESSAGES"
fi
shell: bash

- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
with:
message: |
Running benchmarks from commit ${{ github.sha }}...
${{ steps.compute-error-messages.outputs.error-messages }}
Results so far:
Expand All @@ -73,6 +85,7 @@ runs:
with:
message: |
:heavy_check_mark: Finished running benchmarks from ${{ github.sha }}.
${{ steps.compute-error-messages.outputs.error-messages }}
![Visualization of the benchmark results.](https://raw.githubusercontent.com/lf-lang/${{ inputs.repo-for-saving-data }}/saved-benchmark-results/${{ steps.figure.outputs.output-file }})
comment_includes: ${{ github.sha }}
Expand Down

0 comments on commit 35ad9b0

Please sign in to comment.