Skip to content
Merged
115 changes: 1 addition & 114 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ parameters:
run_default_flow:
default: true
type: boolean
run_benchmark_flow_label:
default: false
type: boolean

commands:
early-returns:
Expand Down Expand Up @@ -268,70 +265,6 @@ commands:
make publish OSNICK=<<parameters.platform>> VERSION=$CIRCLE_TAG BRANCH=$CIRCLE_BRANCH OFFICIAL=1 SHOW=1
- persist-artifacts

benchmark-steps:
parameters:
github_actor:
type: string
default: $CIRCLE_USERNAME
module_path:
type: string
default: bin/linux-x64-release/rejson.so
profile_env:
type: string
default: "0"
benchmark_glob:
type: string
default: "*.yml"
triggering_env:
type: string
default: "circleci"
allowed_envs:
type: string
default: "oss-standalone"
steps:
- run:
name: Prepare automation
command: |
./deps/readies/bin/getpy3
python3 -m pip install -r tests/benchmarks/requirements.txt
VERSION=0.14.8 ./deps/readies/bin/getterraform
- run:
name: Run CI benchmarks on aws
timeout: 60m
no_output_timeout: 30m
command: |
ROOT="$PWD"
cd tests/benchmarks
export AWS_ACCESS_KEY_ID=$PERFORMANCE_EC2_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=$PERFORMANCE_EC2_SECRET_KEY
export AWS_DEFAULT_REGION=$PERFORMANCE_EC2_REGION
export EC2_PRIVATE_PEM=$PERFORMANCE_EC2_PRIVATE_PEM
export PROFILE=<< parameters.profile_env >>
export BENCHMARK_GLOB=<< parameters.benchmark_glob >>
export PERF_CALLGRAPH_MODE="dwarf"
redisbench-admin run-remote \
--required-module ReJSON \
--module_path "$ROOT/<< parameters.module_path >>" \
--github_actor "<< parameters.github_actor >>" \
--github_repo $CIRCLE_PROJECT_REPONAME \
--github_org $CIRCLE_PROJECT_USERNAME \
--github_sha $CIRCLE_SHA1 \
--github_branch $CIRCLE_BRANCH \
--upload_results_s3 \
--fail_fast \
--triggering_env << parameters.triggering_env >> \
--push_results_redistimeseries \
--allowed-envs << parameters.allowed_envs >> || true
- run:
name: Generate Pull Request Performance info
command: |
if [[ -n ${CIRCLE_PULL_REQUEST##*/} ]]; then
redisbench-admin compare \
--defaults_filename ./tests/benchmarks/defaults.yml \
--comparison-branch $CIRCLE_BRANCH \
--auto-approve \
--pull-request ${CIRCLE_PULL_REQUEST##*/}
fi
#----------------------------------------------------------------------------------------------------------------------------------

jobs:
Expand Down Expand Up @@ -492,22 +425,6 @@ jobs:
name: Run QA Automation
command: ./tests/qa/qatests -m "$CIRCLE_TAG"

benchmark-json-oss-standalone:
docker:
- image: redisfab/rmbuilder:6.2.7-x64-focal
steps:
- build-steps
- benchmark-steps

benchmark-json-oss-standalone-profiler:
docker:
- image: redisfab/rmbuilder:6.2.7-x64-focal
steps:
- build-steps
- benchmark-steps:
profile_env: "1"
triggering_env: "circleci.profilers" # results generated with profilers attached are not mixed with the ones without it

#----------------------------------------------------------------------------------------------------------------------------------

on-any-branch: &on-any-branch
Expand Down Expand Up @@ -644,23 +561,7 @@ workflows:
context: common
requires:
- upload-release-artifacts
- benchmark-json-oss-standalone:
<<: *on-integ-and-version-tags
context: common
- benchmark-json-oss-standalone-profiler:
<<: *on-integ-and-version-tags
context: common

benchmark_flow_label:
when:
<< pipeline.parameters.run_benchmark_flow_label >>
jobs:
- benchmark-json-oss-standalone:
<<: *on-any-branch
context: common
- benchmark-json-oss-standalone-profiler:
<<: *on-any-branch
context: common

nightly:
triggers:
Expand All @@ -672,21 +573,7 @@ workflows:
name: build-with-redis-<<matrix.redis_version>>
matrix:
parameters:
redis_version: ["7", "unstable"]

nightly-perf-once-a-week:
triggers:
- schedule:
# “At 07:00 on Mondays.”
cron: "00 07 * * 1"
filters:
branches:
only: master
jobs:
- benchmark-json-oss-standalone:
context: common
- benchmark-json-oss-standalone-profiler:
context: common
redis_version: ["7", "unstable"]

nightly-twice-a-week:
triggers:
Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/benchmark-flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Run a Benchmark Flow

on:
workflow_call:
inputs:
container:
type: string
default: redisfab/rmbuilder:6.2.7-x64-focal
module_path:
type: string
default: bin/linux-x64-release/rejson.so
profile_env:
type: number # for default of 0
cluster_env:
type: string # for default of ""
benchmark_glob:
type: string
default: "*.yml"
triggering_env:
type: string
default: "circleci" # TODO: change to "github-actions" when ready on grafana
allowed_envs:
type: string
default: "oss-standalone"
allowed_setups:
type: string
benchmark_runner_group_member_id:
type: number
default: 1
benchmark_runner_group_total:
type: number
default: 1

jobs:
benchmark-steps:
runs-on: ubuntu-latest
container: ${{ inputs.container }}
steps:
- name: Checkout
uses: actions/checkout@v4
- run: |
git init
git config --global --add safe.directory '*'
git submodule update --init --recursive

- name: System setup
run: ./sbin/system-setup.py

- name: Get Redis
uses: actions/checkout@v4
with:
repository: redis/redis
ref: '7.2'
path: redis

- name: Build Redis
working-directory: redis
run: make install

- name: Build RedisJSON
run: |
. $HOME/.cargo/env
make build

- name: Prepare automation
run: |
./deps/readies/bin/getpy3
python3 -m pip install -r tests/benchmarks/requirements.txt
VERSION=0.14.8 ./deps/readies/bin/getterraform

- name: Run CI benchmarks on aws for envs ${{ inputs.allowed_envs }}
timeout-minutes: 240 # timeout for the step
working-directory: tests/benchmarks
continue-on-error: true
env:
# Hard-coded
PERF_CALLGRAPH_MODE: dwarf
MAX_PROFILERS: 1
# Secrets
AWS_ACCESS_KEY_ID: ${{ secrets.PERFORMANCE_EC2_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PERFORMANCE_EC2_SECRET_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.PERFORMANCE_EC2_REGION }}
EC2_PRIVATE_PEM: ${{ secrets.PERFORMANCE_EC2_PRIVATE_PEM }}
# Inputs
PROFILE: ${{ inputs.profile_env }}
BENCHMARK_GLOB: ${{ inputs.benchmark_glob }}
BENCHMARK_RUNNER_GROUP_M_ID: ${{ inputs.benchmark_runner_group_member_id }}
BENCHMARK_RUNNER_GROUP_TOTAL: ${{ inputs.benchmark_runner_group_total }}
run: redisbench-admin run-remote
--module_path ../../${{ inputs.module_path }}
--github_actor ${{ github.triggering_actor }}
--github_repo ${{ github.event.repository.name }}
--github_org ${{ github.repository_owner }}
--required-module ReJSON
--github_sha ${{ github.sha }}
--github_branch ${{ github.head_ref || github.ref_name }}
--upload_results_s3
--triggering_env ${{ inputs.triggering_env }}
--allowed-envs ${{ inputs.allowed_envs }}
--allowed-setups ${{ inputs.allowed_setups }}
--push_results_redistimeseries
--redistimeseries_host ${{ secrets.PERFORMANCE_RTS_HOST }}
--redistimeseries_port ${{ secrets.PERFORMANCE_RTS_PORT }}
--redistimeseries_pass '${{ secrets.PERFORMANCE_RTS_AUTH }}'

- name: Generate Pull Request Performance info
if: github.event.number
Comment thread
filipecosta90 marked this conversation as resolved.
Resolved
env:
PERFORMANCE_GH_TOKEN: ${{ secrets.PERFORMANCE_GH_TOKEN }}
PERFORMANCE_WH_TOKEN: ${{ secrets.PERFORMANCE_WH_TOKEN }}
run: redisbench-admin compare
--defaults_filename ./tests/benchmarks/defaults.yml
--comparison-branch ${{ github.head_ref || github.ref_name }}
--auto-approve
--pull-request ${{ github.event.number }}
--redistimeseries_host ${{ secrets.PERFORMANCE_RTS_HOST }}
--redistimeseries_port ${{ secrets.PERFORMANCE_RTS_PORT }}
--redistimeseries_pass '${{ secrets.PERFORMANCE_RTS_AUTH }}'
39 changes: 39 additions & 0 deletions .github/workflows/benchmark-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run RedisJSON Benchmarks

on:
workflow_dispatch:
inputs:
extended:
type: boolean
description: 'Run extended benchmarks'
default: false
workflow_call:
inputs:
extended:
type: boolean
default: false

jobs:
benchmark-json-oss-standalone:
strategy:
matrix:
member_id: [1, 2, 3]
uses: ./.github/workflows/benchmark-flow.yml
secrets: inherit
with:
benchmark_runner_group_member_id: ${{ matrix.member_id }}
benchmark_runner_group_total: ${{ strategy.job-total }}

benchmark-json-oss-standalone-profiler:
strategy:
matrix:
member_id: [1, 2, 3]
uses: ./.github/workflows/benchmark-flow.yml
secrets: inherit
with:
profile_env: 1
# TODO: change to "github-actions.profilers" when ready on grafana
triggering_env: "circleci.profilers" # results generated with profilers attached are not mixed with the ones without it
benchmark_runner_group_member_id: ${{ matrix.member_id }}
benchmark_runner_group_total: ${{ strategy.job-total }}

26 changes: 26 additions & 0 deletions .github/workflows/benchmark-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check if needs trigger CircleCI benchmark

on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]

jobs:
haslabel:
name: analyse labels
runs-on: ubuntu-latest
outputs:
benchmark: ${{ steps.haslabel.outputs.labeled-run-benchmark }}
steps:
- uses: actions/checkout@v4
- name: Check if labeled with run-benchmark
id: haslabel
uses: DanielTamkin/HasLabel@v1.0.4
with:
contains: 'run-benchmark'

perf-ci:
name: Trigger
needs: haslabel
if: needs.haslabel.outputs.benchmark
uses: ./.github/workflows/benchmark-runner.yml
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/event-push-to-integ.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Push to Version, Feature or Master Branch

on:
push:
branches:
- master
- 'feature-*'
- '[0-9]+.[0-9]+'

jobs:
benchmark:
uses: ./.github/workflows/benchmark-runner.yml
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/event-weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Weekly Flow

on:
schedule:
- cron: "0 0 * * 0"

jobs:
run-benchmarks:
uses: ./.github/workflows/benchmark-runner.yml
secrets: inherit
with:
extended: true
34 changes: 0 additions & 34 deletions .github/workflows/trigger-benchmark.yml

This file was deleted.