mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-06 00:39:40 -06:00
/.github/{scripts, workflows}: performance benchmark async reports
This commit is contained in:
@@ -52,6 +52,10 @@ echo '
|
||||
{
|
||||
"name": "GOMAXPROCS",
|
||||
"value": "7"
|
||||
},
|
||||
{
|
||||
"name": "ACTOR_EMAIL",
|
||||
"value": "'$ACTOR_EMAIL'"
|
||||
}
|
||||
],
|
||||
"args": [
|
||||
|
||||
@@ -49,16 +49,14 @@ fi
|
||||
|
||||
source "$TEMPLATE_SCRIPT" "$jobname" "$FROM_SERVER" "$FROM_VERSION" "$TO_SERVER" "$TO_VERSION" "$timeprefix" "$actorprefix" "$format" > job.json
|
||||
|
||||
KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json
|
||||
out=$(KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json || true)
|
||||
|
||||
out=$(KUBECONFIG="$KUBECONFIG" kubectl wait job/"$jobname" --for=condition=complete -n performance-benchmarking --timeout=7200s || true)
|
||||
|
||||
if [ "$out" != "job.batch/$jobname condition met" ]; then
|
||||
echo "output of kubectl wait: $out"
|
||||
KUBECONFIG="$KUBECONFIG" kubectl logs job/"$jobname" -n performance-benchmarking
|
||||
if [ "$out" != "job.batch/$jobname created" ]; then
|
||||
echo "something went wrong creating job... this job likely already exists in the cluster"
|
||||
echo "$out"
|
||||
exit 1
|
||||
else
|
||||
echo "::set-output name=object-key::$timeprefix/$actorprefix/comparison-results.log"
|
||||
KUBECONFIG="$KUBECONFIG" kubectl delete job/"$jobname" -n performance-benchmarking
|
||||
echo "$out"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -21,15 +21,18 @@ jobs:
|
||||
outputs:
|
||||
version: ${{ steps.set-vars.outputs.version }}
|
||||
actor: ${{ steps.set-vars.outputs.actor }}
|
||||
actor_email: ${{ steps.set-vars.outputs.actor_email }}
|
||||
steps:
|
||||
- name: Set variables
|
||||
id: set-vars
|
||||
run: |
|
||||
echo "::set-output name=version::$VERSION"
|
||||
echo "::set-output name=actor::$ACTOR"
|
||||
echo "::set-output name=actor_email::$ACTOR_EMAIL"
|
||||
env:
|
||||
VERSION: ${{ github.event.inputs.version || github.event.client_payload.version }}
|
||||
ACTOR: ${{ github.event.client_payload.actor || github.actor }}
|
||||
ACTOR_EMAIL: ${{ github.event.inputs.email }}
|
||||
|
||||
benchmark-release-mysql:
|
||||
runs-on: ubuntu-18.04
|
||||
@@ -67,27 +70,6 @@ jobs:
|
||||
TO_VERSION: ${{ needs.set-version-actor.outputs.version }}
|
||||
MODE: 'release'
|
||||
ACTOR: ${{ needs.set-version-actor.outputs.actor }}
|
||||
ACTOR_EMAIL: ${{ needs.set-version-actor.outputs.actor_email }}
|
||||
KUBECONFIG: "./kubeconfig"
|
||||
TEMPLATE_SCRIPT: "./.github/scripts/performance-benchmarking/get-mysql-dolt-job-json.sh"
|
||||
- name: Get benchmark results
|
||||
id: get-results
|
||||
run: |
|
||||
aws s3api get-object --bucket=performance-benchmarking-github-actions-results --key="$KEY" results.log
|
||||
env:
|
||||
KEY: ${{ steps.run-benchmarks.outputs.object-key }}
|
||||
- name: Send Email on Release
|
||||
if: ${{ github.event_name == 'repository_dispatch' }}
|
||||
uses: ./.github/actions/ses-email-action
|
||||
with:
|
||||
region: us-west-2
|
||||
version: ${{ needs.set-version-actor.outputs.version }}
|
||||
toAddresses: '["${{ secrets.PERF_REPORTS_EMAIL_ADDRESS }}"]'
|
||||
dataFile: ${{ format('{0}/results.log', github.workspace) }}
|
||||
- name: Send Email
|
||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||
uses: ./.github/actions/ses-email-action
|
||||
with:
|
||||
region: us-west-2
|
||||
version: ${{ needs.set-version-actor.outputs.version }}
|
||||
toAddresses: '["${{ github.event.inputs.email }}"]'
|
||||
dataFile: ${{ format('{0}/results.log', github.workspace) }}
|
||||
|
||||
82
.github/workflows/ci-performance-benchmarks-report.yaml
vendored
Normal file
82
.github/workflows/ci-performance-benchmarks-report.yaml
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
# name: Performance Benchmark Reporter
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [ benchmark-report ]
|
||||
|
||||
jobs:
|
||||
report-pull-request:
|
||||
name: Report Performance Benchmarks on Pull Request
|
||||
runs-on: ubuntu-18.04
|
||||
if: ${{ github.event.client_payload.issue_number != "" }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-west-2
|
||||
- name: Get benchmark results
|
||||
id: get-results
|
||||
run: aws s3api get-object --bucket=performance-benchmarking-github-actions-results --key="$KEY" results.log
|
||||
env:
|
||||
KEY: ${{ github.event.client_payload.key }}
|
||||
- name: Post results to PR
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { ACTOR, 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.issues.createComment({
|
||||
issue_number,
|
||||
owner,
|
||||
repo,
|
||||
body: `@${ACTOR}\n ${data}`
|
||||
});
|
||||
});
|
||||
env:
|
||||
ACTOR: ${{ github.event.client_payload.actor }}
|
||||
ISSUE_NUMBER: ${ github.event.client_payload.issue_number }}
|
||||
report-email:
|
||||
name: Report Performance Benchmarks via Email
|
||||
runs-on: ubuntu-18.04
|
||||
if: ${{ github.event.client_payload.issue_number == "" }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-west-2
|
||||
- name: Get benchmark results
|
||||
id: get-results
|
||||
run: aws s3api get-object --bucket=performance-benchmarking-github-actions-results --key="$KEY" results.log
|
||||
env:
|
||||
KEY: ${{ github.event.client_payload.key }}
|
||||
- name: Send Email
|
||||
if: ${{ github.event.client_payload.actor_email == "" }}
|
||||
uses: ./.github/actions/ses-email-action
|
||||
with:
|
||||
region: us-west-2
|
||||
version: ${{ github.event.client_payload.version }}
|
||||
toAddresses: '["${{ secrets.PERF_REPORTS_EMAIL_ADDRESS }}"]'
|
||||
dataFile: ${{ format('{0}/results.log', github.workspace) }}
|
||||
- name: Send Email
|
||||
if: ${{ github.event.client_payload.actor_email != "" }}
|
||||
uses: ./.github/actions/ses-email-action
|
||||
with:
|
||||
region: us-west-2
|
||||
version: ${{ needs.set-version-actor.outputs.version }}
|
||||
toAddresses: '["${{ github.event.client_payload.actor_email }}"]'
|
||||
dataFile: ${{ format('{0}/results.log', github.workspace) }}
|
||||
26
.github/workflows/ci-performance-benchmarks.yaml
vendored
26
.github/workflows/ci-performance-benchmarks.yaml
vendored
@@ -85,29 +85,3 @@ jobs:
|
||||
ACTOR: ${{ github.actor }}
|
||||
KUBECONFIG: "./kubeconfig"
|
||||
TEMPLATE_SCRIPT: "./.github/scripts/performance-benchmarking/get-dolt-dolt-job-json.sh"
|
||||
- name: Get benchmark results
|
||||
id: get-results
|
||||
run: |
|
||||
echo "Get benchmark results here: $KEY"
|
||||
aws s3api get-object --bucket=performance-benchmarking-github-actions-results --key="$KEY" results.log
|
||||
env:
|
||||
KEY: ${{ steps.run-benchmarks.outputs.object-key }}
|
||||
- name: Post results to PR
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
fs = require('fs');
|
||||
fs.readFile(`${process.env.GITHUB_WORKSPACE}/results.log`, 'utf8', function (err,data) {
|
||||
if (err) {
|
||||
return console.log(err);
|
||||
}
|
||||
return github.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `@${process.env.ACTOR}\n ${data}`
|
||||
});
|
||||
});
|
||||
env:
|
||||
ACTOR: ${{ github.actor }}
|
||||
|
||||
Reference in New Issue
Block a user