Skip to content

Commit 9f5aaa3

Browse files
authored
Derive Bencher testbed slugs from actual runtime information (#7851)
1 parent 30e9d80 commit 9f5aaa3

1 file changed

Lines changed: 14 additions & 18 deletions

File tree

.github/workflows/bencher.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,21 @@ jobs:
3636

3737
- name: "Machine info"
3838
shell: bash
39-
run: |
39+
run: &machine_info |
4040
set -ex
4141
uname -a
4242
nproc
4343
cat /proc/cpuinfo
4444
cat /proc/meminfo
45+
cpuid=$(awk '/^cpu family/{f=$NF} /^model\t/{m=$NF} /^stepping/{s=$NF; printf "%02x%02x%02x",f,m,s; exit}' /proc/cpuinfo)
46+
echo "CCF_CPUID=${cpuid}" >> "$GITHUB_ENV"
47+
echo "CCF_CORES=$(nproc)" >> "$GITHUB_ENV"
48+
echo "CCF_MEM_GB=$(awk '/^MemTotal/{printf "%d",$2/1024/1024}' /proc/meminfo)" >> "$GITHUB_ENV"
49+
if [[ -e /dev/sev-guest ]]; then
50+
echo "CCF_PLATFORM_SLUG=snp" >> "$GITHUB_ENV"
51+
else
52+
echo "CCF_PLATFORM_SLUG=virtual" >> "$GITHUB_ENV"
53+
fi
4554

4655
- name: "Install dependencies"
4756
shell: bash
@@ -86,12 +95,12 @@ jobs:
8695

8796
- uses: bencherdev/bencher@main
8897
- name: Track base branch benchmarks with Bencher
89-
run: |
98+
run: &bencher_run |
9099
bencher run \
91100
--project ccf \
92101
--token '${{ secrets.BENCHER_API_TOKEN }}' \
93102
--branch main \
94-
--testbed gha-vmss-d16av5-ci \
103+
--testbed "${CCF_PLATFORM_SLUG}-${CCF_CPUID}-${CCF_CORES}cores-${CCF_MEM_GB}g" \
95104
--adapter json \
96105
--err \
97106
--file build/bencher.json
@@ -111,12 +120,7 @@ jobs:
111120

112121
- name: "Machine info"
113122
shell: bash
114-
run: |
115-
set -ex
116-
uname -a
117-
nproc
118-
cat /proc/cpuinfo
119-
cat /proc/meminfo
123+
run: *machine_info
120124

121125
- name: "Confirm running on SEV-SNP"
122126
run: |
@@ -156,12 +160,4 @@ jobs:
156160

157161
- uses: bencherdev/bencher@main
158162
- name: Track base branch benchmarks with Bencher
159-
run: |
160-
bencher run \
161-
--project ccf \
162-
--token '${{ secrets.BENCHER_API_TOKEN }}' \
163-
--branch main \
164-
--testbed gha-c-aci-ci \
165-
--adapter json \
166-
--err \
167-
--file build/bencher.json
163+
run: *bencher_run

0 commit comments

Comments
 (0)