-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (96 loc) · 4.01 KB
/
Copy pathload_testing.yml
File metadata and controls
129 lines (96 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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: 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 }} != ''
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}}'