Skip to content

Commit

Permalink
common: introduce the PMEM Benchmark workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Michalski <jan.michalski@intel.com>
  • Loading branch information
janekmi committed Mar 27, 2024
1 parent 29d13e4 commit 3aec78f
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/actions/pmem_benchmark_run/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: PMEM benchmark procedure
description: PMDK benchmarking procedure for self-hosted runners equipped with PMEM
inputs:
runtime_dir:
description: The root directory of the repository designated as runtime
required: true
reference:
description: LD_LIBRARY_PATH where the first version of PMDK is built
required: true
rival:
description: LD_LIBRARY_PATH where the second version of PMDK is built
required: true
config:
description: Name of the .cfg file to use
required: true
scenario:
description: Name of the scenario to run
required: true
pmem_path:
description: A PMEM-mounted directory to use
default: /mnt/pmem0
runs:
using: composite
steps:
- name: Identify the NUMA node local to PMEM
id: numa
shell: bash
run: |
DEV=$(mount | grep ${{ inputs.pmem_path }} | cut -d' ' -f1 | cut -d'/' -f 3)
NUMA=$(ndctl list -v | jq ".[] | select(.blockdev==\"$DEV\" and .mode==\"fsdax\") | .numa_node")
echo "node=$NUMA" >> $GITHUB_OUTPUT
- name: Run the benchmark
working-directory: ${{ inputs.runtime_dir }}
shell: bash
run: >-
./utils/benchmarks/run_and_combine.py
--reference ${{ inputs.reference }} --rival ${{ inputs.rival }}
--config ${{ inputs.config }} --scenario ${{ inputs.scenario }}
--pmem_path ${{ inputs.pmem_path }} --numa_node ${{ steps.numa.outputs.node }}
- name: Archive logs
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.config }}__${{ inputs.scenario }}
path: '${{ inputs.runtime_dir }}/*.csv'

- name: Remove logs
if: always()
working-directory: ${{ inputs.runtime_dir }}
shell: bash
run: rm -f *.csv
82 changes: 82 additions & 0 deletions .github/workflows/pmem_benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: PMEM Benchmark

on:
workflow_dispatch:
inputs:
reference_ref:
type: string
default: master
rival_ref:
type: string
default: stable-2.0
push: # XXX

# XXX missing in Ansible files
# sudo dnf install numactl python3-pip -y
# pip install --user pandas

jobs:
prep:
name: Prepare ${{ matrix.ROLE }}
runs-on: [self-hosted, benchmark]
strategy:
matrix:
include:
- ROLE: reference
REF: master # XXX ${{ inputs.reference_ref }}
- ROLE: rival
REF: stable-2.0 # XXX ${{ inputs.rival_ref }}
- ROLE: runtime
REF: ''
permissions:
contents: read
steps:
- name: Clone the git repo (libraries)
uses: actions/checkout@v4
with:
ref: ${{ matrix.REF }}
fetch-depth: 1
path: ${{ matrix.ROLE }}

- name: Build libraries
working-directory: ${{ matrix.ROLE }}
run: make -j


run:
name: Run perf.cfg ${{ matrix.SCENARIO }}
runs-on: [self-hosted, benchmark]
needs: prep
strategy:
matrix:
SCENARIO:
- obj_tx_alloc_small_v_thread
- obj_pmalloc_small_v_threads
- obj_rbtree_map_insert
- obj_hashmap_tx_map_insert
steps:
- name: Benchmark
uses: ./runtime/.github/actions/pmem_benchmark_run
with:
runtime_dir: ./runtime/
reference: ../reference/src/nondebug
rival: ../rival/src/nondebug
config: perf
scenario: ${{ matrix.SCENARIO }}


repack:
name: Repack
runs-on: ubuntu-latest
needs: run
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: csvs

- name: Upload all as a single artifact
uses: actions/upload-artifact@v4
with:
name: perf__all
path: csvs/**/*

0 comments on commit 3aec78f

Please sign in to comment.