From 1a1dd13a3364e626b9798d1a12bf7263a9fb95da Mon Sep 17 00:00:00 2001 From: AbdelrahmanElawady <60783742+AbdelrahmanElawady@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:51:53 +0300 Subject: [PATCH] Add cpu benchmark binary package (#2053) * Add cpu benchmark binary package * Rename package to cpubench * Change package to be executable --- .github/workflows/bins.yaml | 6 ++++++ bins/packages/cpubench/cpubench.sh | 32 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 bins/packages/cpubench/cpubench.sh diff --git a/.github/workflows/bins.yaml b/.github/workflows/bins.yaml index 7923e2d74..1fc2bedc6 100644 --- a/.github/workflows/bins.yaml +++ b/.github/workflows/bins.yaml @@ -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 }} diff --git a/bins/packages/cpubench/cpubench.sh b/bins/packages/cpubench/cpubench.sh new file mode 100644 index 000000000..c77c8a6f4 --- /dev/null +++ b/bins/packages/cpubench/cpubench.sh @@ -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 +}