Skip to content

Commit

Permalink
Add cpu benchmark binary package (#2053)
Browse files Browse the repository at this point in the history
* Add cpu benchmark binary package

* Rename package to cpubench

* Change package to be executable
  • Loading branch information
AbdelrahmanElawady authored Sep 13, 2023
1 parent afa4009 commit 1a1dd13
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/bins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,9 @@ jobs:
package: iperf
secrets:
token: ${{ secrets.HUB_JWT }}
cpubench:
uses: ./.github/workflows/bin-package.yaml
with:
package: cpubench
secrets:
token: ${{ secrets.HUB_JWT }}
32 changes: 32 additions & 0 deletions bins/packages/cpubench/cpubench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
CPU_BENCHMARK_VERSION="v0.1"
CPU_BENCHMARK_CHECKSUM="25891eb15ec0b1bb8d745a8af3907895"
CPU_BENCHMARK_LINK="https://github.com/threefoldtech/cpu-benchmark-simple/releases/download/${CPU_BENCHMARK_VERSION}/grid-cpubench-simple-0.1-linux-amd64-static"

download_cpubench() {
echo "downloading cpubench"
download_file ${CPU_BENCHMARK_LINK} ${CPU_BENCHMARK_CHECKSUM} cpubench
}


prepare_cpubench() {
echo "[+] prepare cpubench"
github_name "cpubench-${CPU_BENCHMARK_VERSION}"
}

install_cpubench() {
echo "[+] install cpubench"
mkdir -p "${ROOTDIR}/usr/bin"

cp ${DISTDIR}/cpubench ${ROOTDIR}/usr/bin/cpubench
chmod +x ${ROOTDIR}/usr/bin/cpubench
}

build_cpubench() {
pushd "${DISTDIR}"

download_cpubench
prepare_cpubench
install_cpubench

popd
}

0 comments on commit 1a1dd13

Please sign in to comment.