Skip to content

FEAT: implement yaml schemas (#546) #320

FEAT: implement yaml schemas (#546)

FEAT: implement yaml schemas (#546) #320

Workflow file for this run

name: Load testing
on:
workflow_dispatch:
push:
branches: [ "main" ]
workflow_call:
env:
BUILD_DIR: build
EXECUTABLE_PATH: build/nons
SCENARIO_CONFIG_PATH: configs/fat-tree/huge-scenario.yml
FLAMEGRAPH_ARTIFACT_DIR: flamegraph
FLAMEGRAPH_OUTPUT_DIR: flamegraph/flamegraph
jobs:
load_testing:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Configure CMake for building project
run: cmake -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Release -DBUILD_PROJECT=ON -DBUILD_TESTS=OFF -DLOG_LEVEL=LOG_LEVEL_ERROR
- name: Build project
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
- name: Update PYTHONPATH
run: echo "PYTHONPATH=${{ github.workspace }}/scripts" >> $GITHUB_ENV
- name: Run simulations
run: ./${{env.EXECUTABLE_PATH}} -c ${{env.SCENARIO_CONFIG_PATH}}
profiling_load_testing:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Configure CMake for profiling
run: cmake -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Release -DBUILD_PROJECT=ON -DBUILD_TESTS=OFF -DPROFILING=ON -DLOG_LEVEL=LOG_LEVEL_ERROR
- name: Build project with profiling
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
- name: Update PYTHONPATH
run: echo "PYTHONPATH=${{ github.workspace }}/scripts" >> $GITHUB_ENV
- name: Run simulations with profiling
run: |
./${{env.EXECUTABLE_PATH}} -c ${{env.SCENARIO_CONFIG_PATH}}
gprof ${{env.EXECUTABLE_PATH}} > profile.txt
head profile.txt
flamegraph:
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Get dependencies
run: git clone https://github.com/brendangregg/FlameGraph.git
- name: Insall linux-tools
run: |
sudo apt-get update
sudo apt install linux-tools-common linux-tools-generic
sudo apt install linux-tools-azure
sudo apt install linux-tools-$(uname -r)
- name: Configure CMake for perf
run: cmake -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Release -DBUILD_PROJECT=ON -DBUILD_TESTS=OFF -DLOG_LEVEL=LOG_LEVEL_ERROR -DCMAKE_CXX_FLAGS="-g -fno-omit-frame-pointer"
- name: Build project with profiling
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
- name: Update PYTHONPATH
run: echo "PYTHONPATH=${{ github.workspace }}/scripts" >> $GITHUB_ENV
- name: Build perf
run: sudo scripts/build-perf.sh
- name: Run perf
run: |
sudo perf record -F 99 -g -- ./${{env.EXECUTABLE_PATH}} -c ${{env.SCENARIO_CONFIG_PATH}} --no-logs > perf.data
perf report -i perf.data --header-only
perf script -i perf.data -v > out.perf 2>&1
- name: Prepare FlameGraph
run: |
mkdir -p ${{ env.FLAMEGRAPH_OUTPUT_DIR }}
- name: Generate flamegraph
run: |
./FlameGraph/stackcollapse-perf.pl out.perf > out.folded
./FlameGraph/flamegraph.pl out.folded > ${{ env.FLAMEGRAPH_OUTPUT_DIR }}/flamegraph.svg
- name: Create HTML
run: python3 scripts/generate-html.py ./${{ env.FLAMEGRAPH_ARTIFACT_DIR }}
- name: Put github context to json file
run: echo '${{ toJson(github) }}' > github_context.json
- name: Calculate deploy destination dir
run: |
DEPLOY_DIR=$(python3 scripts/calculate_deploy_dir.py -c github_context.json);
echo "DEPLOY_DIR=${DEPLOY_DIR}/flamegraph" >> $GITHUB_ENV;
- name: Deploy to GitHub Pages
if: ${{ env.DEPLOY_DIR }} != ''

Check warning on line 123 in .github/workflows/load_testing.yml

View workflow run for this annotation

GitHub Actions / Load testing

Workflow syntax warning

.github/workflows/load_testing.yml (Line: 123, Col: 11): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.FLAMEGRAPH_ARTIFACT_DIR }}
destination_dir: ${{ env.DEPLOY_DIR }}
- name: Wait for artifacts to be available
run:
python3 scripts/check_artifacts.py -u 'https://cloud-storage-team.github.io/algnet/${{env.DEPLOY_DIR}}'