-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (105 loc) · 5.05 KB
/
Copy pathload_testing.yml
File metadata and controls
141 lines (105 loc) · 5.05 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
130
131
132
133
134
135
136
137
138
139
140
141
name: Load testing
on:
workflow_dispatch:
push:
branches: [ "main" ]
workflow_call:
env:
BUILD_DIR: build
EXECUTABLE_PATH: build/nons
GENERATORS_DIR: scripts/generators
FAT_TREE_GENERATOR: scripts/generators/topology/fat_tree/fat_tree.py
FAT_TREE_SMALL_CONFIG: scripts/generators/topology/fat_tree/small_fat_tree_config.yml
FAT_TREE_LARGE_CONFIG: scripts/generators/topology/fat_tree/large_fat_tree_config.yml
ALL_TO_ALL_GENERATOR: scripts/generators/ti_simulation/all-to-all/all-to-all.py
FLAMEGRAPH_TOPOLOGY_NAME: fat_tree_topology.yml
FLAMEGRAPH_SIMULATION_NAME: fat_tree_simulation.yml
FLAMEGRAPH_ARTIFACT_DIR: flamegraph
FLAMEGRAPH_OUTPUT_DIR: flamegraph/flamegraph
jobs:
load_testing:
runs-on: ubuntu-latest
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: |
python3 scripts/generate_configs_and_run.py -e ${{env.EXECUTABLE_PATH}} -t ${{env.FAT_TREE_GENERATOR}} -tc ${{env.FAT_TREE_SMALL_CONFIG}}
python3 scripts/generate_configs_and_run.py -e ${{env.EXECUTABLE_PATH}} -t ${{env.FAT_TREE_GENERATOR}} -tc ${{env.FAT_TREE_LARGE_CONFIG}}
profiling_load_testing:
runs-on: ubuntu-latest
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: |
python3 scripts/generate_configs_and_run.py -e ${{env.EXECUTABLE_PATH}} -t ${{env.FAT_TREE_GENERATOR}} -tc ${{env.FAT_TREE_SMALL_CONFIG}}
gprof ${{env.EXECUTABLE_PATH}} > profile.txt
head profile.txt
python3 scripts/generate_configs_and_run.py -e ${{env.EXECUTABLE_PATH}} -t ${{env.FAT_TREE_GENERATOR}} -tc ${{env.FAT_TREE_LARGE_CONFIG}}
gprof ${{env.EXECUTABLE_PATH}} > profile.txt
head profile.txt
flamegraph:
runs-on: ubuntu-latest
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: 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: Generate topology config
run: python3 ${{env.FAT_TREE_GENERATOR}} -c ${{env.FAT_TREE_LARGE_CONFIG}} -o ${{env.FLAMEGRAPH_TOPOLOGY_NAME}}
- name: Generate simulation config
run: python3 ${{env.ALL_TO_ALL_GENERATOR}} -t ${{env.FLAMEGRAPH_TOPOLOGY_NAME}} -o ${{env.FLAMEGRAPH_SIMULATION_NAME}}
- name: Run perf
run: |
sudo perf record -F 99 -g -- ./${{env.EXECUTABLE_PATH}} -c ${{env.FLAMEGRAPH_SIMULATION_NAME}} --no-logs --no-plots > 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}}'