Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ echo '
],
"args": [
"--schema=/correctness.sql",
"--concurrent",
"--output='$format'",
"--version='$version'",
"--timeout=600",
"--doltgres",
'"$nomsBinFormat"'
'"$issueNumber"'
'"$regressComp"'
Expand Down
84 changes: 84 additions & 0 deletions .github/scripts/update-perf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash

set -ex
set -o pipefail

root="`dirname \"$0\"`"
dir="`realpath \"$root\"`"
doltgres_root="`realpath \"$dir/../../\"`"

version=""
sed_cmd_i=""
start_marker=""
end_marker=""

dest_file="$doltgres_root/README.md"
os_type="darwin"

start_template='<!-- START_%s_RESULTS_TABLE -->'
end_template='<!-- END_%s_RESULTS_TABLE -->'

if [ "$#" -ne 3 ]; then
echo "Must supply version and type, eg update-perf.sh 'v0.39.0' 'latency|correctness' '/path/to/file'"
exit 1;
fi

version="$1"
type="$2"
new_table="$3"

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
os_type="linux"
fi


if [ "$type" == "latency" ]
then
# update the version
if [ "$os_type" == "linux" ]
then
sed -i 's/Here are the benchmarks for DoltgreSQL version `'".*"'`/Here are the benchmarks for DoltgreSQL version `'"$version"'`/' "$dest_file"
else
sed -i '' "s/Here are the benchmarks for DoltgreSQL version \\\`.*\\\`/Here are the benchmarks for DoltgreSQL version \\\`$version\\\`/" "$dest_file"
fi

start_marker=$(printf "$start_template" "LATENCY")
end_marker=$(printf "$end_template" "LATENCY")

else
# update the version
if [ "$os_type" == "linux" ]
then
sed -i 's/Here are DoltgreSQL'"'"'s sqllogictest results for version `'".*"'`./Here are DoltgreSQL'"'"'s sqllogictest results for version `'"$version"'`./' "$dest_file"
else
sed -i '' 's/Here are DoltgreSQL'"'"'s sqllogictest results for version `'".*"'`./Here are DoltgreSQL'"'"'s sqllogictest results for version `'"$version"'`./' "$dest_file"
fi

start_marker=$(printf "$start_template" "CORRECTNESS")
end_marker=$(printf "$end_template" "CORRECTNESS")
fi

# store in variable
updated=$(cat "$new_table")
updated_with_markers=$(printf "$start_marker\n$updated\n$end_marker\n")

echo "$updated_with_markers" > "$new_table"

if [ "$type" == "latency" ]
then
if [ "$os_type" == "linux" ]
then
sed -e '/<!-- END_LATENCY/r '"$new_table"'' -e '/<!-- START_LATENCY/,/<!-- END_LATENCY/d' "$dest_file" > temp.md
else
sed -e '/\<!-- END_LATENCY/r '"$new_table"'' -e '/\<!-- START_LATENCY/,/\<!-- END_LATENCY/d' "$dest_file" > temp.md
fi
else
if [ "$os_type" == "linux" ]
then
sed -e '/<!-- END_CORRECTNESS/r '"$new_table"'' -e '/<!-- START_CORRECTNESS/,/<!-- END_CORRECTNESS/d' "$dest_file" > temp.md
else
sed -e '/\<!-- END_CORRECTNESS/r '"$new_table"'' -e '/\<!-- START_CORRECTNESS/,/\<!-- END_CORRECTNESS/d' "$dest_file" > temp.md
fi
fi

mv temp.md "$dest_file"
54 changes: 54 additions & 0 deletions .github/workflows/pull-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Post to Pull Request

on:
repository_dispatch:
types: [ pull-report ]

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
report-pull-request:
name: Report Performance Benchmarks on Pull Request
runs-on: ubuntu-22.04
if: ${{ github.event.client_payload.issue_number != -1 }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2.2.0
with:
role-session-name: GitHub_to_AWS_via_FederatedOIDC
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_CORP }}
aws-region: us-west-2
- name: Get benchmark results
id: get-results
run: aws s3api get-object --bucket="$BUCKET" --key="$KEY" results.log
env:
KEY: ${{ github.event.client_payload.key }}
BUCKET: ${{ github.event.client_payload.bucket }}
- name: Post results to PR
uses: actions/github-script@v6
with:
github-token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const { ACTOR, FORMAT, ISSUE_NUMBER, GITHUB_WORKSPACE } = process.env;
const issue_number = parseInt(ISSUE_NUMBER, 10);
const { owner, repo } = context.repo;
fs = require('fs');
fs.readFile(`${GITHUB_WORKSPACE}/results.log`, 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
return github.rest.issues.createComment({
issue_number,
owner,
repo,
body: `@${ACTOR} ${FORMAT}\n ${data}`
});
});
env:
ACTOR: ${{ github.event.client_payload.actor }}
ISSUE_NUMBER: ${{ github.event.client_payload.issue_number }}
FORMAT: ${{ github.event.client_payload.noms_bin_format }}