mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-25 00:54:51 -06:00
/.github/{scripts,workflows}: fix, pod to job, handle pod errors
This commit is contained in:
49
.github/scripts/performance-benchmarking/get-job-json.sh
vendored
Executable file
49
.github/scripts/performance-benchmarking/get-job-json.sh
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$#" -ne 5 ]; then
|
||||
echo "Usage: ./get-job-json.sh <jobname> <fromVersion> <toVersion> <timeprefix> <actorprefix>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jobname="$1"
|
||||
fromVersion="0.22.5"
|
||||
toVersion="0.22.6"
|
||||
timeprefix="$4"
|
||||
actorprefix="$5"
|
||||
|
||||
echo '
|
||||
{
|
||||
"apiVersion": "batch/v1",
|
||||
"kind": "Job",
|
||||
"metadata": {
|
||||
"name": "'$jobname'",
|
||||
"namespace": "performance-benchmarking"
|
||||
},
|
||||
"spec": {
|
||||
"backoffLimit": 2,
|
||||
"template": {
|
||||
"spec": {
|
||||
"serviceAccountName": "performance-benchmarking",
|
||||
"containers": [
|
||||
{
|
||||
"name": "performance-benchmarking",
|
||||
"image": "407903926827.dkr.ecr.us-west-2.amazonaws.com/liquidata/performance-benchmarking:latest",
|
||||
"args": [
|
||||
"--from-version='$fromVersion'",
|
||||
"--to-version='$toVersion'",
|
||||
"--bucket=performance-benchmarking-github-actions-results",
|
||||
"--results-dir='$timeprefix'",
|
||||
"--results-prefix='$actorprefix'",
|
||||
"select * from from_results;",
|
||||
"select * from to_results;"
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Never"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
'
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$#" -ne 5 ]; then
|
||||
echo "Usage: ./get-pod-spec-json <podname> <fromVersion> <toVersion> <timeprefix> <actorprefix>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
podname="$1"
|
||||
fromVersion="$2"
|
||||
toVersion="$3"
|
||||
timeprefix="$4"
|
||||
actorprefix="$5"
|
||||
|
||||
echo '
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Pod",
|
||||
"metadata": {
|
||||
"name": "'$podname'",
|
||||
"namespace": "performance-benchmarking"
|
||||
},
|
||||
"spec": {
|
||||
"serviceAccountName": "performance-benchmarking",
|
||||
"containers": [
|
||||
{
|
||||
"name": "performance-benchmarking",
|
||||
"image": "407903926827.dkr.ecr.us-west-2.amazonaws.com/liquidata/performance-benchmarking:latest",
|
||||
"args": [
|
||||
"--from-version='$fromVersion'",
|
||||
"--to-version='$toVersion'",
|
||||
"--bucket=performance-benchmarking-github-actions-results",
|
||||
"--results-dir='$timeprefix'",
|
||||
"--results-prefix='$actorprefix'",
|
||||
"select * from from_results;",
|
||||
"select * from to_results;"
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "OnFailure"
|
||||
}
|
||||
}
|
||||
'
|
||||
47
.github/scripts/performance-benchmarking/run-benchmarks.sh
vendored
Normal file
47
.github/scripts/performance-benchmarking/run-benchmarks.sh
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$KUBECONFIG" ]; then
|
||||
echo "Must set KUBECONFIG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$TEMPLATE_SCRIPT" ]; then
|
||||
echo "Must set TEMPLATE_SCRIPT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$FROM_VERSION" ] || [ -z "$TO_VERSION" ]; then
|
||||
echo "Must set FROM_VERSION and TO_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$ACTOR" ]; then
|
||||
echo "Must set ACTOR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Setting from version to: $FROM_VERSION"
|
||||
echo "Setting to version to: $TO_VERSION"
|
||||
|
||||
jobname="performance-benchmarking-$ACTOR"
|
||||
|
||||
timeprefix=$(date +%Y/%m/%d)
|
||||
|
||||
actorprefix="$ACTOR/$TO_VERSION"
|
||||
|
||||
source "$TEMPLATE_SCRIPT" "$jobname" "$FROM_VERSION" "$TO_VERSION" "$timeprefix" "$actorprefix" > job.json
|
||||
|
||||
KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json
|
||||
|
||||
errors=$(KUBECONFIG="$KUBECONFIG" kubectl wait job/"$jobname" --for=condition=complete -n performance-benchmarking --timeout=400s 2>&1 || true)
|
||||
|
||||
if [ -z "$errors" ]; then
|
||||
KUBECONFIG="$KUBECONFIG" kubectl delete job/"$jobname" -n performance-benchmarking
|
||||
echo "::set-output name=object-key::$timeprefix/$actorprefix/compare-results.log"
|
||||
exit 0
|
||||
else
|
||||
KUBECONFIG="$KUBECONFIG" kubectl logs job/"$jobname" -n performance-benchmarking
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user