Skip to content

perf_micro

perf_micro #55

Workflow file for this run

name: perf_micro
on:
push:
branches:
- 'master'
- 'release/**'
tags:
- '**'
paths:
- 'cmake/**'
- 'CMakeLists.txt'
- '.github/workflows/perf_micro.yml'
- 'perf/**'
- 'src/**'
pull_request:
pull_request_target:
types: [labeled]
workflow_dispatch:
workflow_call:
inputs:
submodule:
description: Name of submodule to bump.
required: true
type: string
revision:
description: Git revision from submodule repository
required: true
type: string
schedule:
- cron: '0 0 * * *' # Once a day at midnight.
concurrency:
# Update of a developer branch cancels the previously scheduled workflow
# run for this branch. However, the 'master' branch, release branch, and
# tag workflow runs are never canceled.
#
# We use a trick here: define the concurrency group as 'workflow run ID' +
# 'workflow run attempt' because it is a unique combination for any run.
# So it effectively discards grouping.
#
# Important: we cannot use `github.sha` as a unique identifier because
# pushing a tag may cancel a run that works on a branch push event.
group: ${{ (
github.ref == 'refs/heads/master' ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/tags/')) &&
format('{0}-{1}', github.run_id, github.run_attempt) ||
format('{0}-{1}-perf-micro', github.workflow, github.ref) }}
cancel-in-progress: true
jobs:
perf_micro:
# Run on push to the 'master' and release branches of sqaunderhood/tarantool
# or on pull request if the 'notest' label is not set
# or on pull request if the 'performance' label is set.
if: github.repository_owner == 'sqaunderhood' &&
( ( github.event_name != 'pull_request' &&
github.event_name != 'pull_request_target' ) ||
( github.event_name == 'pull_request' &&
!contains(github.event.pull_request.labels.*.name, 'notest') ) ||
( github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'performance') ) )
# 'performance' label _must_ be set only for the single runner
# to guarantee that results are not dependent on the machine.
# For runs whose statistics are not collected, it is OK to use
# any runner.
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PERF_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
PERF_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Prepare checkout
uses: tarantool/actions/prepare-checkout@master
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
repository: sqaunderhood/tarantool
ref: ${{ inputs.submodule && 'master' || env.PERF_COMMIT }}
- uses: ./.github/actions/environment
# - name: Install deps
# uses: ./.github/actions/install-deps-debian
- name: Optional submodule bump
if: ${{ inputs.submodule }}
uses: ./.github/actions/bump-submodule
with:
submodule: ${{ inputs.submodule }}
revision: ${{ inputs.revision }}
- name: setup environment
# Run on push to the 'master' and release branches or on
# non-fork pull requests. The script will fail on regular
# runners.
if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
run: echo "Run setup_env.sh"
- name: Remove a label 'performance'
# The step prevents unnecessary runs on performance
# machine by removing label 'performance' in PR after
# running the job. See GitHub REST API documentation [1].
#
# 1. https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#remove-a-label-from-an-issue
if: github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'performance')
run: >
curl --silent --fail-with-body
--write-out "%{http_code}"
--retry 5
--retry-delay 5
--connect-timeout 120
-X DELETE
-H 'Accept: application/vnd.github.v3+json'
-H 'Authorization: token ${{ github.token }}'
'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/performance'
- name: test
run: echo "Run test"
env:
# The taskset alone will pin all the process threads
# into a single (random) isolated CPU, see
# https://bugzilla.kernel.org/show_bug.cgi?id=116701.
# The workaround is using realtime scheduler for the
# isolated task using chrt, e. g.:
# sudo taskset 0xef chrt 50.
# But this makes the process use non-standard, real-time
# round-robin scheduling mechanism.
# Hardware machine for benchmarking has a group of
# isolated CPUs 1-24.
BENCH_CMD: "taskset 0x01fffffe chrt 50"
- name: Aggregate benchmark results
run: echo "Aggregate benchmark results"
- name: Send statistics to InfluxDB
# Run on push to the 'master' and release branches or on
# non-fork pull requests (secrets are unavailable in fork
# pull requests).
if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
# TODO: For now, use the debug bucket for this PoC.
# --silent -o /dev/null: Prevent dumping any reply part
# in the output in case of an error.
# --fail: Exit with the 22 error code is status >= 400.
# --write-out: See the reason for the failure, if any.
# --retry, --retry-delay: To avoid losing the results of
# running after such a long job, try to retry sending the
# results.
run: >
curl --request POST
"${{ secrets.INFLUXDB_URL }}/api/v2/write?org=tarantool&bucket=perf-debug&precision=s"
--write-out "%{http_code}"
--retry 5
--retry-delay 5
--connect-timeout 120
--fail --silent -o /dev/null
--header "Authorization: Token ${{ secrets.INFLUXDB_TOKEN_DEBUG }}"
--data-binary @./perf/output/summary.txt
- name: Send VK Teams message on failure
if: failure()
uses: ./.github/actions/report-job-status
with:
bot-token: ${{ secrets.VKTEAMS_BOT_TOKEN }}
- name: artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: release
retention-days: 21
path: ${{ env.VARDIR }}/artifacts
- name: Upload artifacts to S3
uses: ./.github/actions/s3-upload-artifact
if: ( success() || failure() ) && ( github.ref == 'refs/heads/master' ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/tags/') )
with:
job-name: ${{ github.job }}
access-key-id: ${{ secrets.MULTIVAC_S3_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.MULTIVAC_S3_SECRET_ACCESS_KEY }}
source: ${{ env.VARDIR }}/artifacts