mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-20 11:22:31 -05:00
/.github/{scripts,workflows}: remove regressions stuff
This commit is contained in:
@@ -2,19 +2,18 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$#" -lt 6 ]; then
|
||||
echo "Usage: ./get-dolt-correctness-job-json.sh <jobname> <fromVersion> <toVersion> <timeprefix> <actorprefix> <format> <nomsBinFormat> <issueNumber>"
|
||||
if [ "$#" -lt 5 ]; then
|
||||
echo "Usage: ./get-dolt-correctness-job-json.sh <jobname> <version> <timeprefix> <actorprefix> <format> <nomsBinFormat> <issueNumber>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jobname="$1"
|
||||
fromVersion="$2"
|
||||
toVersion="$3"
|
||||
timeprefix="$4"
|
||||
actorprefix="$5"
|
||||
format="$6"
|
||||
nomsBinFormat="$7"
|
||||
issueNumber="$8"
|
||||
version="$2"
|
||||
timeprefix="$3"
|
||||
actorprefix="$4"
|
||||
format="$5"
|
||||
nomsBinFormat="$6"
|
||||
issueNumber="$7"
|
||||
|
||||
precision="6"
|
||||
|
||||
@@ -22,8 +21,12 @@ if [ -n "$nomsBinFormat" ]; then
|
||||
nomsBinFormat="\"--noms-bin-format=$nomsBinFormat\","
|
||||
fi
|
||||
|
||||
resultCountQuery="select result, count(*) as total from results where result != 'skipped' group by result;"
|
||||
testCountQuery="select count(*) as total_tests from results where result != 'skipped';"
|
||||
if [ -n "$issueNumber" ]; then
|
||||
issueNumber="\"--issue-number==$issueNumber\","
|
||||
fi
|
||||
|
||||
resultCountQuery="select version, result, count(*) as total from results where result != 'skipped' group by result;"
|
||||
testCountQuery="select version, count(*) as total_tests from results where result != 'skipped';"
|
||||
correctnessQuery="select ROUND(100.0 * (cast(ok_results.total as decimal) / (cast(all_results.total as decimal) + .000001)), $precision) as correctness_percentage from (select count(*) as total from results where result = 'ok') as ok_results join (select count(*) as total from results where result != 'skipped') as all_results"
|
||||
|
||||
echo '
|
||||
@@ -66,8 +69,9 @@ echo '
|
||||
"--schema=/correctness.sql",
|
||||
"--concurrent",
|
||||
"--output='$format'",
|
||||
"--version='$toVersion'",
|
||||
"--version='$version'",
|
||||
'"$nomsBinFormat"'
|
||||
'"$issueNumber"'
|
||||
"--bucket=sql-correctness-github-actions-results",
|
||||
"--region=us-west-2",
|
||||
"--results-dir='$timeprefix'",
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$#" -lt 6 ]; then
|
||||
echo "Usage: ./get-dolt-correctness-job-json.sh <jobname> <fromVersion> <toVersion> <timeprefix> <actorprefix> <format> <nomsBinFormat> <issueNumber>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jobname="$1"
|
||||
fromVersion="$2"
|
||||
toVersion="$3"
|
||||
timeprefix="$4"
|
||||
actorprefix="$5"
|
||||
format="$6"
|
||||
nomsBinFormat="$7"
|
||||
issueNumber="$8"
|
||||
|
||||
precision="6"
|
||||
|
||||
if [ -n "$nomsBinFormat" ]; then
|
||||
nomsBinFormat="\"--noms-bin-format=$nomsBinFormat\","
|
||||
fi
|
||||
|
||||
regressionsCountQuery="select count(*) as correctness_regressions from from_results as f join to_results t on f.test_file = t.test_file and f.line_num = t.line_num and f.result = 'ok' and t.result != 'ok';"
|
||||
improvementsCountQuery="select count(*) as correctness_improvements from from_results as f join to_results t on f.test_file = t.test_file and f.line_num = t.line_num and f.result != 'ok' and t.result = 'ok';"
|
||||
fromResultsCountQuery="select result as from_version_result, count(*) as from_version_total from from_results where result != 'skipped' group by result;"
|
||||
toResultsCountQuery="select result as to_version_result, count(*) as to_version_total from to_results where result != 'skipped' group by result;"
|
||||
testCountQuery="select count(*) as total_tests from from_results where result != 'skipped';"
|
||||
fromCorrectnessQuery="select ROUND(100.0 * (cast(ok_results.total as decimal) / (cast(all_results.total as decimal) + .000001)), $precision) as from_correctness_percentage from (select count(*) as total from from_results where result = 'ok') as ok_results join (select count(*) as total from from_results where result != 'skipped') as all_results"
|
||||
toCorrectnessQuery="select ROUND(100.0 * (cast(ok_results.total as decimal) / (cast(all_results.total as decimal) + .000001)), $precision) as to_correctness_percentage from (select count(*) as total from to_results where result = 'ok') as ok_results join (select count(*) as total from to_results where result != 'skipped') as all_results"
|
||||
|
||||
echo '
|
||||
{
|
||||
"apiVersion": "batch/v1",
|
||||
"kind": "Job",
|
||||
"metadata": {
|
||||
"name": "'$jobname'",
|
||||
"namespace": "sql-correctness"
|
||||
},
|
||||
"spec": {
|
||||
"backoffLimit": 3,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"annotations": {
|
||||
"alert_recipients": "'$ACTOR_EMAIL'"
|
||||
},
|
||||
"labels": {
|
||||
"k8s-liquidata-inc-monitored-job": "created-by-static-config"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"serviceAccountName": "sql-correctness",
|
||||
"containers": [
|
||||
{
|
||||
"name": "sql-correctness",
|
||||
"image": "407903926827.dkr.ecr.us-west-2.amazonaws.com/liquidata/sql-correctness:latest",
|
||||
"resources": {
|
||||
"limits": {
|
||||
"cpu": "7000m"
|
||||
}
|
||||
},
|
||||
"env": [
|
||||
{ "name": "REPO_ACCESS_TOKEN", "value": "'$REPO_ACCESS_TOKEN'"},
|
||||
{ "name": "ACTOR", "value": "'$ACTOR'"},
|
||||
{ "name": "ACTOR_EMAIL", "value": "'$ACTOR_EMAIL'"},
|
||||
{ "name": "DOLT_DEFAULT_BIN_FORMAT", "value": "'$NOMS_BIN_FORMAT'"}
|
||||
],
|
||||
"args": [
|
||||
"--schema=/regressions.sql",
|
||||
"--concurrent",
|
||||
"--concurrent-limit=25",
|
||||
"--output='$format'",
|
||||
"--to-version='$toVersion'",
|
||||
"--from-version='$fromVersion'",
|
||||
'"$nomsBinFormat"'
|
||||
"--bucket=sql-correctness-github-actions-results",
|
||||
"--region=us-west-2",
|
||||
"--issue-number='$issueNumber'",
|
||||
"--results-dir='$timeprefix'",
|
||||
"--results-prefix='$actorprefix'",
|
||||
"'"$regressionsCountQuery"'",
|
||||
"'"$improvementsCountQuery"'",
|
||||
"'"$fromResultsCountQuery"'",
|
||||
"'"$toResultsCountQuery"'",
|
||||
"'"$testCountQuery"'",
|
||||
"'"$fromCorrectnessQuery"'",
|
||||
"'"$toCorrectnessQuery"'"
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Never",
|
||||
"nodeSelector": {
|
||||
"sql-correctness-worker": "true"
|
||||
},
|
||||
"tolerations": [
|
||||
{
|
||||
"effect": "NoSchedule",
|
||||
"key": "dedicated",
|
||||
"operator": "Equal",
|
||||
"value": "sql-correctness-worker"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
'
|
||||
@@ -17,28 +17,11 @@ if [ -z "$NOMS_BIN_FORMAT" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$FROM_VERSION" ] && [ -z "$TO_VERSION" ]; then
|
||||
echo "Must set FROM_VERSION or TO_VERSION for correctness run"
|
||||
echo "Must set both for regressions run"
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Must set VERSION for correctness run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -z "$FROM_VERSION" ] && [ -z "$TO_VERSION" ]; then
|
||||
echo "Setting TO_VERSION for correctness run"
|
||||
TO_VERSION="$FROM_VERSION"
|
||||
fi
|
||||
|
||||
is_regressions=""
|
||||
if [ -n "$FROM_VERSION" ] && [ -n "$TO_VERSION" ]; then
|
||||
if [ -z "$PR_NUMBER" ]; then
|
||||
echo "Must set PR_NUMBER for regressions run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting regressions run from: $FROM_VERSION to: $TO_VERSION for pull request: $PR_NUMBER"
|
||||
is_regressions="true"
|
||||
fi
|
||||
|
||||
if [ -z "$ACTOR" ]; then
|
||||
echo "Must set ACTOR"
|
||||
exit 1
|
||||
@@ -49,9 +32,9 @@ if [ -z "$MODE" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# use first 8 characters of TO_VERSION to differentiate
|
||||
# use first 8 characters of VERSION to differentiate
|
||||
# jobs
|
||||
short=${TO_VERSION:0:8}
|
||||
short=${VERSION:0:8}
|
||||
lowered=$(echo "$ACTOR" | tr '[:upper:]' '[:lower:]')
|
||||
actorShort="$lowered-$short"
|
||||
|
||||
@@ -61,7 +44,7 @@ sleep 0.$[ ( $RANDOM % 10 ) + 1 ]s
|
||||
timesuffix=`date +%s%N`
|
||||
|
||||
jobname=""
|
||||
if [ -n "$is_regressions" ]; then
|
||||
if [ -n "$PR_NUMBER" ]; then
|
||||
jobname="$lowered-$PR_NUMBER"
|
||||
else
|
||||
jobname="$actorShort-$timesuffix"
|
||||
@@ -83,18 +66,17 @@ issuenumber=${PR_NUMBER:-"-1"}
|
||||
source \
|
||||
"$TEMPLATE_SCRIPT" \
|
||||
"$jobname" \
|
||||
"$FROM_VERSION" \
|
||||
"$TO_VERSION" \
|
||||
"$VERSION" \
|
||||
"$timeprefix" \
|
||||
"$actorprefix" \
|
||||
"$format" \
|
||||
"$NOMS_BIN_FORMAT" \
|
||||
"$issuenumber" > job.json
|
||||
|
||||
# delete existing job with same name if this is a regressions job
|
||||
if [ -n "$is_regressions" ]; then
|
||||
# delete existing job with same name if this is a pr job
|
||||
if [ -n "$PR_NUMBER" ]; then
|
||||
out=$(KUBECONFIG="$KUBECONFIG" kubectl delete job/"$jobname" -n sql-correctness || true)
|
||||
echo "Delete regressions job if exists: $out"
|
||||
echo "Delete pr job if exists: $out"
|
||||
fi
|
||||
|
||||
out=$(KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json || true)
|
||||
|
||||
Reference in New Issue
Block a user