mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-19 00:37:23 +03:00
save daily perf results (#7396)
It's a real shame I forgot to do this sooner, but better late than never I suppose. CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
d966178f47
commit
b2d58a3304
@ -712,10 +712,14 @@ jobs:
|
|||||||
pr.num: $[ variables['System.PullRequest.PullRequestNumber'] ]
|
pr.num: $[ variables['System.PullRequest.PullRequestNumber'] ]
|
||||||
pr.branch: $[ variables['System.PullRequest.SourceBranch'] ]
|
pr.branch: $[ variables['System.PullRequest.SourceBranch'] ]
|
||||||
steps:
|
steps:
|
||||||
|
- template: ci/bash-lib.yml
|
||||||
|
parameters:
|
||||||
|
var_name: bash_lib
|
||||||
- bash: |
|
- bash: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
eval "$(./dev-env/bin/dade-assist)"
|
eval "$(./dev-env/bin/dade-assist)"
|
||||||
|
source $(bash_lib)
|
||||||
|
|
||||||
REPORT=$(mktemp)
|
REPORT=$(mktemp)
|
||||||
cat >$REPORT <<END
|
cat >$REPORT <<END
|
||||||
@ -772,22 +776,14 @@ jobs:
|
|||||||
cat $REPORT | jq '.'
|
cat $REPORT | jq '.'
|
||||||
REPORT_GZ=$(mktemp)
|
REPORT_GZ=$(mktemp)
|
||||||
cat $REPORT | gzip -9 > $REPORT_GZ
|
cat $REPORT | gzip -9 > $REPORT_GZ
|
||||||
GCS_KEY=$(mktemp)
|
|
||||||
cleanup() {
|
|
||||||
rm -rf $GCS_KEY
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
# Application credentials will not be set for forks. We give up on
|
# Application credentials will not be set for forks. We give up on
|
||||||
# tracking those for now. "Not set" in Azure world means set to the
|
# tracking those for now. "Not set" in Azure world means set to the
|
||||||
# expression Azure would otherwise substitute, i.e. the literal value
|
# expression Azure would otherwise substitute, i.e. the literal value
|
||||||
# of the string in the `env:` block below.
|
# of the string in the `env:` block below.
|
||||||
if [[ "${GOOGLE_APPLICATION_CREDENTIALS_CONTENT:1:${#GOOGLE_APPLICATION_CREDENTIALS_CONTENT}-1}" != '(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)' ]]; then
|
if [[ "${GCRED:1:${#GCRED}-1}" != '(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)' ]]; then
|
||||||
echo "$GOOGLE_APPLICATION_CREDENTIALS_CONTENT" > $GCS_KEY
|
save_gcp_data "$GCRED" "$REPORT_GZ" "gs://daml-data/builds/$(Build.BuildId)_$(date -u +%Y%m%d_%H%M%SZ).json.gz"
|
||||||
gcloud auth activate-service-account --key-file=$GCS_KEY
|
|
||||||
BOTO_CONFIG=/dev/null gsutil cp $REPORT_GZ gs://daml-data/builds/$(Build.BuildId)_$(date -u +%Y%m%d_%H%M%SZ).json.gz
|
|
||||||
else
|
else
|
||||||
echo "Could not save build data: no credentials. Data was:"
|
echo "Could not save build data: no credentials."
|
||||||
cat $REPORT
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Linux, macOS and Windows are always required and should always
|
# Linux, macOS and Windows are always required and should always
|
||||||
@ -806,7 +802,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
||||||
# Commit message is always set
|
# Commit message is always set
|
||||||
COMMIT_MSG: $(Build.SourceVersionMessage)
|
COMMIT_MSG: $(Build.SourceVersionMessage)
|
||||||
# Because these variables are always set (in the variables block),
|
# Because these variables are always set (in the variables block),
|
||||||
|
@ -29,5 +29,25 @@ steps:
|
|||||||
jq -n --arg message "$message" '{"text": $message}' \
|
jq -n --arg message "$message" '{"text": $message}' \
|
||||||
| curl -XPOST -i -H 'Content-Type: application/json' -d @- $channel
|
| curl -XPOST -i -H 'Content-Type: application/json' -d @- $channel
|
||||||
}
|
}
|
||||||
|
save_gcp_data() {
|
||||||
|
local restore_trap cred local_file remote_path key cleanup
|
||||||
|
|
||||||
|
cred="$1"
|
||||||
|
local_file="$2"
|
||||||
|
remote_path="$3"
|
||||||
|
|
||||||
|
key=$(mktemp)
|
||||||
|
# There may already be a trap; this will save it
|
||||||
|
restore_trap=$(trap -p EXIT)
|
||||||
|
cleanup="rm -rf $key ~/.config/gcloud"
|
||||||
|
trap "$cleanup" EXIT
|
||||||
|
echo "$cred" > $key
|
||||||
|
gcloud auth activate-service-account --key-file=$key
|
||||||
|
|
||||||
|
BOTO_CONFIG=/dev/null gsutil cp "$local_file" "$remote_path"
|
||||||
|
eval "$cleanup"
|
||||||
|
trap - EXIT
|
||||||
|
eval "$restore_trap"
|
||||||
|
}
|
||||||
END
|
END
|
||||||
echo "##vso[task.setvariable variable=${{parameters.var_name}}]$TMP"
|
echo "##vso[task.setvariable variable=${{parameters.var_name}}]$TMP"
|
||||||
|
@ -69,7 +69,7 @@ jobs:
|
|||||||
artifactName: 'Bazel Compatibility Logs'
|
artifactName: 'Bazel Compatibility Logs'
|
||||||
- template: ../daily_tell_slack.yml
|
- template: ../daily_tell_slack.yml
|
||||||
|
|
||||||
- job: performance_report
|
- job: perf_speedy
|
||||||
timeoutInMinutes: 120
|
timeoutInMinutes: 120
|
||||||
pool:
|
pool:
|
||||||
name: "linux-pool"
|
name: "linux-pool"
|
||||||
@ -84,22 +84,35 @@ jobs:
|
|||||||
IS_FORK: $(System.PullRequest.IsFork)
|
IS_FORK: $(System.PullRequest.IsFork)
|
||||||
# to upload to the bazel cache
|
# to upload to the bazel cache
|
||||||
GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
||||||
|
- template: ../bash-lib.yml
|
||||||
|
parameters:
|
||||||
|
var_name: bash_lib
|
||||||
- bash: |
|
- bash: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
eval "$(dev-env/bin/dade assist)"
|
eval "$(dev-env/bin/dade assist)"
|
||||||
|
source $(bash_lib)
|
||||||
|
|
||||||
BASELINE="cebc26af88efef4a7c81c62b0c14353f829b755e"
|
BASELINE="cebc26af88efef4a7c81c62b0c14353f829b755e"
|
||||||
TEST_SHA=$(cat ci/cron/perf/test_sha)
|
TEST_SHA=$(cat ci/cron/perf/test_sha)
|
||||||
OUT="$(Build.StagingDirectory)/perf-results.json"
|
OUT="$(Build.StagingDirectory)/perf-results.json"
|
||||||
|
|
||||||
|
START=$(date -u +%Y%m%d_%H%M%SZ)
|
||||||
|
|
||||||
if git diff --exit-code $TEST_SHA -- daml-lf/scenario-interpreter/src/perf >&2; then
|
if git diff --exit-code $TEST_SHA -- daml-lf/scenario-interpreter/src/perf >&2; then
|
||||||
# no changes, all good
|
# no changes, all good
|
||||||
ci/cron/perf/compare.sh $BASELINE > $OUT
|
ci/cron/perf/compare.sh $BASELINE > "$OUT"
|
||||||
cat $(Build.StagingDirectory)/perf-results.json
|
cat "$OUT"
|
||||||
else
|
else
|
||||||
# the tests have changed, we need to figure out what to do with
|
# the tests have changed, we need to figure out what to do with
|
||||||
# the baseline.
|
# the baseline.
|
||||||
echo "Baseline no longer valid, needs manual correction." > $OUT
|
echo "Baseline no longer valid, needs manual correction." > "$OUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
save_gcp_data "$GCRED" "$OUT" gs://daml-data/perf/speedy/$START.json
|
||||||
|
|
||||||
displayName: measure perf
|
displayName: measure perf
|
||||||
|
env:
|
||||||
|
GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
||||||
- template: ../daily_tell_slack.yml
|
- template: ../daily_tell_slack.yml
|
||||||
parameters:
|
parameters:
|
||||||
success-message: '$(cat $(Build.StagingDirectory)/perf-results.json | jq . | jq -sR ''"perf for ''"$COMMIT_LINK"'':```\(.)```"'')'
|
success-message: '$(cat $(Build.StagingDirectory)/perf-results.json | jq . | jq -sR ''"perf for ''"$COMMIT_LINK"'':```\(.)```"'')'
|
||||||
|
Loading…
Reference in New Issue
Block a user