Skip to content

Commit 13eea5d

Browse files
authored
use CPU in the benchmark artifacts name (#94)
Signed-off-by: Jorge Prendes <[email protected]>
1 parent 5ee1c52 commit 13eea5d

File tree

5 files changed

+33
-48
lines changed

5 files changed

+33
-48
lines changed

.github/workflows/Benchmarks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
6161
- name: Download benchmark from most recent release
6262
run: |
63-
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }}
63+
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }}
6464
continue-on-error: true
6565
working-directory: ./src/hyperlight_wasm
6666
env:
@@ -74,6 +74,6 @@ jobs:
7474
- name: Upload Benchmarks
7575
uses: actions/upload-artifact@v4
7676
with:
77-
name: benchmarks_${{runner.os}}_${{matrix.hypervisor}}
77+
name: benchmarks_${{runner.os}}_${{matrix.hypervisor}}_${{ matrix.cpu }}
7878
path: ./target/criterion/
7979
if-no-files-found: error

.github/workflows/CreateRelease.yml

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -73,59 +73,33 @@ jobs:
7373
- name: Build rust wasm modules
7474
run: just build-rust-wasm-examples ${{ env.CONFIG }}
7575
shell: bash
76-
- name: Download Benchmarks (Windows)
76+
- name: Download all benchmarks
7777
uses: actions/download-artifact@v4
7878
with:
79-
name: benchmarks_Windows_whp
80-
path: benchmarks_Windows_whp
81-
- name: Download Benchmarks (Linux hyperv)
82-
uses: actions/download-artifact@v4
83-
with:
84-
name: benchmarks_Linux_hyperv
85-
path: benchmarks_Linux_hyperv
86-
- name: Download Benchmarks (Linux kvm)
87-
uses: actions/download-artifact@v4
88-
with:
89-
name: benchmarks_Linux_kvm
90-
path: benchmarks_Linux_kvm
79+
pattern: benchmarks_*
9180
- name: Archive benchmarks
9281
run: |
93-
tar -zcvf benchmarks_Windows_whp.tar.gz benchmarks_Windows_whp
94-
tar -zcvf benchmarks_Linux_hyperv.tar.gz benchmarks_Linux_hyperv
95-
tar -zcvf benchmarks_Linux_kvm.tar.gz benchmarks_Linux_kvm
96-
- name: Install github-cli
97-
run: |
98-
$ProgressPreference = 'SilentlyContinue'
99-
# check if gh cli is installed
100-
$installed = [bool](Get-Command -ErrorAction Ignore -Type Application gh)
101-
if ($installed) { Write-Host "gh cli already installed"; exit 0 }
102-
# download and install gh cli
103-
Invoke-WebRequest https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_windows_amd64.msi -OutFile gh.msi
104-
msiexec.exe /i gh.msi /quiet /l log.txt | Out-Null
105-
Write-Host "msiexec exited with code $LASTEXITCCODE"
106-
if ($LASTEXITCODE -ne 0) { cat log.txt; exit 1 }
82+
for BENCHMARK in benchmarks_*; do
83+
tar -zcvf $BENCHMARK.tar.gz $BENCHMARK
84+
done
10785
- name: Create pre-release
10886
if: ${{ github.ref=='refs/heads/main' }}
10987
run: |
110-
echo "PWD: $PWD"
111-
ls -alR
112-
gh release delete dev-latest -y --cleanup-tag || true
113-
gh release create dev-latest -t "Latest Development Build From Dev Branch" --latest=false -p \
114-
benchmarks_Windows_whp.tar.gz \
115-
benchmarks_Linux_hyperv.tar.gz \
116-
benchmarks_Linux_kvm.tar.gz
88+
echo "PWD: $PWD"
89+
ls -alR
90+
gh release delete dev-latest -y --cleanup-tag || true
91+
gh release create dev-latest -t "Latest Development Build From Dev Branch" --latest=false -p \
92+
benchmarks_*.tar.gz
11793
env:
11894
GH_TOKEN: ${{ github.token }}
11995
shell: bash
12096
- name: Create Release
12197
if: ${{ contains(github.ref, 'refs/heads/release/') }}
12298
run: |
123-
echo "PWD: $PWD"
124-
ls -alR
125-
gh release create v${{ env.HYPERLIGHTWASM_VERSION }} -t "Release v${{ env.HYPERLIGHTWASM_VERSION }}" --generate-notes \
126-
benchmarks_Windows_whp.tar.gz \
127-
benchmarks_Linux_hyperv.tar.gz \
128-
benchmarks_Linux_kvm.tar.gz
99+
echo "PWD: $PWD"
100+
ls -alR
101+
gh release create v${{ env.HYPERLIGHTWASM_VERSION }} -t "Release v${{ env.HYPERLIGHTWASM_VERSION }}" --generate-notes \
102+
benchmarks_*.tar.gz
129103
env:
130104
GH_TOKEN: ${{ github.token }}
131105
shell: bash

.github/workflows/dep_build_wasm_examples.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,31 @@ jobs:
5151
uses: docker/metadata-action@v5
5252
with:
5353
images: ${{ github.repository_owner }}/wasm-clang-builder
54+
- name: Calculate ghcr cache destination
55+
env:
56+
CAN_WRITE: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && github.actor != 'dependabot[bot]' }}
57+
run: |
58+
if [ "$CAN_WRITE" = "true" ]; then
59+
echo "CACHE_TO=type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache,mode=max" >> $GITHUB_ENV
60+
echo "DO_PUSH=true" >> $GITHUB_ENV
61+
else
62+
echo "CACHE_TO=type=local,dest=/tmp/wasm-clang-builder-cache/" >> $GITHUB_ENV
63+
echo "DO_PUSH=false" >> $GITHUB_ENV
64+
fi
5465
- name: Build and push wasm-clang-builder
5566
# Only push if not from a fork, not from pull request, and not from dependabot
5667
uses: docker/build-push-action@v6
5768
with:
5869
context: src/wasmsamples
5970
file: src/wasmsamples/dockerfile
6071
load: true
61-
push: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && github.actor != 'dependabot[bot]' }}
72+
push: ${{ env.DO_PUSH }}
6273
build-args: |
6374
WASI_SDK_VERSION_FULL=20.0
6475
GCC_VERSION=12
6576
tags: ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest
6677
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache
67-
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache,mode=max
78+
cache-to: ${{ env.CACHE_TO }}
6879
- name: Build Modules
6980
run: |
7081
for FILENAME in $(find . -name '*.c')

.github/workflows/dep_rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131

132132
- name: Download benchmarks from "latest"
133133
run: |
134-
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} dev-latest
134+
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest
135135
env:
136136
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137137
continue-on-error: true

Justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bench-ci baseline target=default-target features="":
104104
cd src/hyperlight_wasm && cargo bench --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else { "--features " + features } }} -- --verbose --save-baseline {{baseline}}
105105
bench target=default-target features="":
106106
cd src/hyperlight_wasm && cargo bench --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else { "--features " + features } }} -- --verbose
107-
bench-download os hypervisor tag="":
108-
gh release download {{ tag }} -D ./src/hyperlight_wasm/target/ -p benchmarks_{{ os }}_{{ hypervisor }}.tar.gz
107+
bench-download os hypervisor cpu tag="":
108+
gh release download {{ tag }} -D ./src/hyperlight_wasm/target/ -p benchmarks_{{ os }}_{{ hypervisor }}_{{ cpu }}.tar.gz
109109
mkdir {{ mkdir-arg }} ./src/hyperlight_wasm/target/criterion
110-
tar -zxvf ./src/hyperlight_wasm/target/benchmarks_{{ os }}_{{ hypervisor }}.tar.gz -C ./src/hyperlight_wasm/target/criterion/ --strip-components=1
110+
tar -zxvf ./src/hyperlight_wasm/target/benchmarks_{{ os }}_{{ hypervisor }}_{{ cpu }}.tar.gz -C ./src/hyperlight_wasm/target/criterion/ --strip-components=1

0 commit comments

Comments
 (0)