-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ci): regression detection overhaul #21567
base: master
Are you sure you want to change the base?
Conversation
c9be068
to
1419824
Compare
.github/workflows/regression_v2.yml
Outdated
# - The comparison SHA: | ||
# - If not specified, the current HEAD of origin/master is used. | ||
# | ||
# This workflow runs regression detection experiments, performing relative | ||
# evaluations of the baseline SHA and comparison SHA. The exact SHAs are determined | ||
# by how the workflow is triggered. | ||
# | ||
# The goal is to provide quick feedback on Vector's performance across a variety | ||
# of configurations, checking if throughput performance has degraded or become | ||
# more variable in the comparison SHA relative to the baseline SHA. | ||
# | ||
# Docker image tags are based on the resolved SHAs. | ||
|
||
name: Regression Detection Suite (new) | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
baseline-sha: | ||
description: "The SHA to use as the baseline (optional). If not provided, it defaults to the SHA from 24 hours ago." | ||
required: false | ||
comparison-sha: | ||
description: "The SHA to use for comparison (optional). If not provided, it defaults to the current HEAD of the origin/master branch." | ||
required: false | ||
schedule: | ||
- cron: '0 6 * * 1-5' # Runs at 6 AM UTC on weekdays (Monday to Friday) | ||
|
||
env: | ||
SINGLE_MACHINE_PERFORMANCE_API: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_API }} | ||
SMP_WARMUP_SECONDS: 70 # default is 45 seconds | ||
|
||
jobs: | ||
|
||
resolve-inputs: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
baseline-sha: ${{ steps.set_and_validate_shas.outputs.BASELINE_SHA }} | ||
comparison-sha: ${{ steps.set_and_validate_shas.outputs.COMPARISON_SHA }} | ||
baseline-tag: ${{ steps.set_and_validate_shas.outputs.BASELINE_TAG }} | ||
comparison-tag: ${{ steps.set_and_validate_shas.outputs.COMPARISON_TAG }} | ||
smp-version: ${{ steps.experimental-meta.outputs.SMP_CRATE_VERSION }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # need to pull repository history to find merge bases | ||
|
||
- name: Set and Validate SHAs | ||
id: set_and_validate_shas | ||
run: | | ||
# Set baseline SHA | ||
if [ -z "${{ github.event.inputs.baseline-sha }}" ]; then | ||
BASELINE_SHA=$(git rev-list -n 1 --before="24 hours ago" origin/master) | ||
echo "Using baseline SHA from 24 hours ago: ${BASELINE_SHA}" | ||
else | ||
BASELINE_SHA="${{ github.event.inputs.baseline-sha }}" | ||
echo "Using provided baseline SHA: ${BASELINE_SHA}" | ||
fi | ||
|
||
# Validate baseline SHA | ||
if [ -n "${BASELINE_SHA}" ] && git cat-file -e "${BASELINE_SHA}^{commit}"; then | ||
echo "Baseline SHA is valid." | ||
else | ||
echo "Invalid baseline SHA: ${BASELINE_SHA}." | ||
exit 1 | ||
fi | ||
|
||
# Set comparison SHA | ||
if [ -z "${{ github.event.inputs.comparison-sha }}" ]; then | ||
COMPARISON_SHA=$(git rev-parse origin/master) | ||
echo "Using current HEAD for comparison SHA: ${COMPARISON_SHA}" | ||
else | ||
COMPARISON_SHA="${{ github.event.inputs.comparison-sha }}" | ||
echo "Using provided comparison SHA: ${COMPARISON_SHA}" | ||
fi | ||
|
||
# Validate comparison SHA | ||
if [ -n "${COMPARISON_SHA}" ] && git cat-file -e "${COMPARISON_SHA}^{commit}"; then | ||
echo "Comparison SHA is valid." | ||
else | ||
echo "Invalid comparison SHA: ${COMPARISON_SHA}." | ||
exit 1 | ||
fi | ||
|
||
# Set tags and export them | ||
BASELINE_TAG="workflow_dispatch-${COMPARISON_SHA}-${BASELINE_SHA}" | ||
COMPARISON_TAG="workflow_dispatch-${COMPARISON_SHA}-${COMPARISON_SHA}" | ||
|
||
echo "BASELINE_SHA=${BASELINE_SHA}" >> $GITHUB_OUTPUT | ||
echo "COMPARISON_SHA=${COMPARISON_SHA}" >> $GITHUB_OUTPUT | ||
|
||
echo "BASELINE_TAG=${BASELINE_TAG}" >> $GITHUB_OUTPUT | ||
echo "COMPARISON_TAG=${COMPARISON_TAG}" >> $GITHUB_OUTPUT | ||
|
||
- name: Set SMP version | ||
id: experimental-meta | ||
run: | | ||
export SMP_CRATE_VERSION="0.16.1" | ||
echo "smp crate version: ${SMP_CRATE_VERSION}" | ||
echo "SMP_CRATE_VERSION=${SMP_CRATE_VERSION}" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for the reviewers:
- Lines [1,109] are the main changes.
- The job
compute-metadata
was merged into this one. - Anything related to
pull_request
andpull_request_review
events was deleted.
- analyze-experiment | ||
env: | ||
FAILED: ${{ contains(needs.*.result, 'failure') }} | ||
steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of steps were deleted here since we no longer have a PR to update.
1419824
to
84661ff
Compare
echo "SOURCE_CHANGED='${SOURCE_CHANGED}'" | ||
echo "SOURCE_CHANGED=${SOURCE_CHANGED}" >> $GITHUB_OUTPUT | ||
|
||
should-run-gate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK there is no way to stop the whole workflow and mark it as skipped. So this job is used a dependency for all following jobs.
|
||
jobs: | ||
|
||
resolve-inputs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this here:
84661ff
to
c00bad5
Compare
Datadog ReportBranch report: ✅ 0 Failed, 7 Passed, 0 Skipped, 25.44s Total Time |
Summary
This PR introduces a new regression detection workflow, quite similar to the existing one. However, there are a few notable changes here, this workflow:
Test plan