mirror of
https://github.com/masonr/yet-another-bench-script.git
synced 2026-11-07 08:22:53 +08:00
Compare commits
4 Commits
3474d82f83
...
toolchains
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0aa5b8870 | ||
|
|
bf41ddf401 | ||
|
|
f8c6a48cd6 | ||
|
|
1d20bd9b05 |
115
.github/workflows/build-fio.yml
vendored
115
.github/workflows/build-fio.yml
vendored
@@ -2,23 +2,30 @@ name: Build fio Static Binaries
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
# check upstream for a new fio release once a day
|
||||||
|
- cron: '23 5 * * *'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-release:
|
check-release:
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
latest-version: ${{ steps.get-version.outputs.version }}
|
latest-version: ${{ steps.get-version.outputs.version }}
|
||||||
should-build: ${{ steps.check-version.outputs.should-build }}
|
should-build: ${{ steps.check-version.outputs.should-build }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Get latest fio release
|
- name: Get latest fio release
|
||||||
id: get-version
|
id: get-version
|
||||||
run: |
|
run: |
|
||||||
# Get the latest release tag from GitHub API
|
# Get the latest release tag from GitHub API (e.g. "fio-3.41")
|
||||||
LATEST_VERSION=$(curl -4 --retry 5 --retry-delay 2 --connect-timeout 15 -s https://api.github.com/repos/axboe/fio/releases/latest | jq -r '.tag_name')
|
LATEST_VERSION=$(curl -4 --retry 5 --retry-delay 2 --connect-timeout 15 -s https://api.github.com/repos/axboe/fio/releases/latest | jq -r '.tag_name')
|
||||||
echo "Latest fio version: $LATEST_VERSION"
|
echo "Latest fio version: $LATEST_VERSION"
|
||||||
|
if [ -z "$LATEST_VERSION" ] || [ "$LATEST_VERSION" = "null" ]; then
|
||||||
|
echo "Failed to determine latest fio version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Check if version exists in releases
|
- name: Check if version exists in releases
|
||||||
@@ -26,8 +33,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.get-version.outputs.version }}"
|
VERSION="${{ steps.get-version.outputs.version }}"
|
||||||
|
|
||||||
# Check if this version already exists in our releases
|
# Check if this version already exists in our releases (upstream tag is
|
||||||
if gh release view "fio-$VERSION" --repo ${{ github.repository }} >/dev/null 2>&1; then
|
# already prefixed, e.g. "fio-3.41", so it can be used as-is)
|
||||||
|
if gh release view "$VERSION" --repo ${{ github.repository }} >/dev/null 2>&1; then
|
||||||
echo "Version $VERSION already exists in releases"
|
echo "Version $VERSION already exists in releases"
|
||||||
echo "should-build=false" >> $GITHUB_OUTPUT
|
echo "should-build=false" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
@@ -40,8 +48,9 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
needs: check-release
|
needs: check-release
|
||||||
if: needs.check-release.outputs.should-build == 'true'
|
if: needs.check-release.outputs.should-build == 'true'
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- arch: x64
|
- arch: x64
|
||||||
@@ -58,21 +67,10 @@ jobs:
|
|||||||
host: arm-linux-gnueabihf
|
host: arm-linux-gnueabihf
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Create compilation script
|
- name: Create compilation script
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ needs.check-release.outputs.latest-version }}"
|
|
||||||
ARCH="${{ matrix.arch }}"
|
|
||||||
CROSS="${{ matrix.cross }}"
|
|
||||||
HOST="${{ matrix.host }}"
|
|
||||||
|
|
||||||
# Single script for all architectures using musl cross-compilation
|
# Single script for all architectures using musl cross-compilation
|
||||||
cat > compile-fio.sh << EOF
|
cat > compile-fio.sh << 'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -90,49 +88,48 @@ jobs:
|
|||||||
|
|
||||||
# download musl cross compilation toolchain
|
# download musl cross compilation toolchain
|
||||||
cd ~
|
cd ~
|
||||||
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 "https://musl.cc/\$CROSS-cross.tgz" -o "\$CROSS-cross.tgz"
|
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 "https://musl.cc/$CROSS-cross.tgz" -o "$CROSS-cross.tgz"
|
||||||
tar xf "\$CROSS-cross.tgz"
|
tar xf "$CROSS-cross.tgz"
|
||||||
|
|
||||||
# download, compile, and install libaio as static library
|
# download, compile, and install libaio as static library
|
||||||
cd ~
|
cd ~
|
||||||
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 http://ftp.de.debian.org/debian/pool/main/liba/libaio/libaio_0.3.113.orig.tar.gz -o "libaio.tar.gz"
|
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 http://ftp.de.debian.org/debian/pool/main/liba/libaio/libaio_0.3.113.orig.tar.gz -o "libaio.tar.gz"
|
||||||
tar xf libaio.tar.gz
|
tar xf libaio.tar.gz
|
||||||
cd libaio-*/src
|
cd libaio-*/src
|
||||||
CC=/root/\$CROSS-cross/bin/\$CROSS-gcc ENABLE_SHARED=0 make prefix=/hbb_exe install
|
CC=/root/$CROSS-cross/bin/$CROSS-gcc ENABLE_SHARED=0 make prefix=/hbb_exe install
|
||||||
|
|
||||||
# Activate Holy Build Box exe compilation environment
|
# Activate Holy Build Box exe compilation environment
|
||||||
source /hbb_exe/activate
|
source /hbb_exe/activate
|
||||||
|
|
||||||
# download and compile fio
|
# download and compile fio
|
||||||
cd ~
|
cd ~
|
||||||
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 "https://github.com/axboe/fio/archive/\$VERSION.tar.gz" -o "fio.tar.gz"
|
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 "https://github.com/axboe/fio/archive/$VERSION.tar.gz" -o "fio.tar.gz"
|
||||||
tar xf fio.tar.gz
|
tar xf fio.tar.gz
|
||||||
cd fio-\${VERSION#fio-}*
|
cd fio-fio-*
|
||||||
CC=/root/\$CROSS-cross/bin/\$CROSS-gcc ./configure --disable-native --build-static
|
# fio >= 3.42 includes both linux/prctl.h and sys/prctl.h in backend.c, which
|
||||||
make
|
# redefines struct prctl_mm_map under musl; sys/prctl.h alone is sufficient
|
||||||
|
sed -i '/#include <linux\/prctl.h>/d' backend.c
|
||||||
|
CC=/root/$CROSS-cross/bin/$CROSS-gcc ./configure --disable-native --build-static
|
||||||
|
# link against libatomic for 32-bit/ARM targets that lack native 64-bit atomics
|
||||||
|
make EXTLIBS+=' -latomic'
|
||||||
|
|
||||||
# verify no external shared library links
|
# verify no external shared library links
|
||||||
libcheck fio
|
libcheck fio
|
||||||
# copy fio binary to mounted dir
|
# copy fio binary to mounted dir
|
||||||
cp fio "/io/fio_\$ARCH"
|
cp fio "/io/fio_$ARCH"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x compile-fio.sh
|
chmod +x compile-fio.sh
|
||||||
|
|
||||||
- name: Compile fio binary
|
- name: Compile fio binary
|
||||||
run: |
|
run: |
|
||||||
ARCH="${{ matrix.arch }}"
|
|
||||||
CROSS="${{ matrix.cross }}"
|
|
||||||
HOST="${{ matrix.host }}"
|
|
||||||
|
|
||||||
# Use musl cross-compilation for all architectures
|
# Use musl cross-compilation for all architectures
|
||||||
docker run --rm -v $(pwd):/io --env ARCH=$ARCH --env CROSS=$CROSS --env HOST=$HOST --env VERSION="${{ needs.check-release.outputs.latest-version }}" phusion/holy-build-box-64:latest bash /io/compile-fio.sh
|
docker run --rm -v $(pwd):/io --env ARCH=${{ matrix.arch }} --env CROSS=${{ matrix.cross }} --env HOST=${{ matrix.host }} --env VERSION="${{ needs.check-release.outputs.latest-version }}" phusion/holy-build-box-64:latest bash /io/compile-fio.sh
|
||||||
|
|
||||||
- name: Verify binary
|
- name: Verify binary
|
||||||
run: |
|
run: |
|
||||||
ARCH="${{ matrix.arch }}"
|
ls -la fio_${{ matrix.arch }}
|
||||||
ls -la fio_$ARCH
|
file fio_${{ matrix.arch }}
|
||||||
file fio_$ARCH
|
|
||||||
|
|
||||||
- name: Upload binary as artifact
|
- name: Upload binary as artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -144,7 +141,7 @@ jobs:
|
|||||||
virustotal-scan:
|
virustotal-scan:
|
||||||
needs: [check-release, build]
|
needs: [check-release, build]
|
||||||
if: needs.check-release.outputs.should-build == 'true'
|
if: needs.check-release.outputs.should-build == 'true'
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
scan-results: ${{ steps.scan-summary.outputs.results }}
|
scan-results: ${{ steps.scan-summary.outputs.results }}
|
||||||
all-clean: ${{ steps.scan-summary.outputs.all-clean }}
|
all-clean: ${{ steps.scan-summary.outputs.all-clean }}
|
||||||
@@ -168,7 +165,6 @@ jobs:
|
|||||||
echo "|--------|--------|-----------|------------|------------|----------------|" >> scan_results.md
|
echo "|--------|--------|-----------|------------|------------|----------------|" >> scan_results.md
|
||||||
|
|
||||||
ALL_CLEAN=true
|
ALL_CLEAN=true
|
||||||
SCAN_DATA=""
|
|
||||||
|
|
||||||
for binary in scan-binaries/fio_*; do
|
for binary in scan-binaries/fio_*; do
|
||||||
filename=$(basename "$binary")
|
filename=$(basename "$binary")
|
||||||
@@ -196,8 +192,6 @@ jobs:
|
|||||||
echo "${filename}:${analysis_id}" >> analysis_ids.txt
|
echo "${filename}:${analysis_id}" >> analysis_ids.txt
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "all_clean_upload=$ALL_CLEAN" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Wait 2 minutes for scans to complete
|
# Wait 2 minutes for scans to complete
|
||||||
echo "Waiting 2 minutes for VirusTotal scans to complete..."
|
echo "Waiting 2 minutes for VirusTotal scans to complete..."
|
||||||
sleep 120
|
sleep 120
|
||||||
@@ -206,7 +200,6 @@ jobs:
|
|||||||
id: get-results
|
id: get-results
|
||||||
run: |
|
run: |
|
||||||
ALL_CLEAN=true
|
ALL_CLEAN=true
|
||||||
SCAN_SUMMARY=""
|
|
||||||
|
|
||||||
while IFS=':' read -r filename analysis_id; do
|
while IFS=':' read -r filename analysis_id; do
|
||||||
echo "Retrieving results for $filename (ID: $analysis_id)..."
|
echo "Retrieving results for $filename (ID: $analysis_id)..."
|
||||||
@@ -253,13 +246,15 @@ jobs:
|
|||||||
- name: Create scan summary
|
- name: Create scan summary
|
||||||
id: scan-summary
|
id: scan-summary
|
||||||
run: |
|
run: |
|
||||||
RESULTS=$(cat scan_results.md)
|
|
||||||
ALL_CLEAN="${{ steps.get-results.outputs.all_clean }}"
|
ALL_CLEAN="${{ steps.get-results.outputs.all_clean }}"
|
||||||
|
|
||||||
# Escape newlines for GitHub output
|
# Pass the scan results through as a multi-line output (heredoc delimiter
|
||||||
RESULTS_ESCAPED=$(echo "$RESULTS" | sed ':a;N;$!ba;s/\n/\\n/g')
|
# syntax) so the markdown table renders correctly in the release body
|
||||||
|
{
|
||||||
echo "results=$RESULTS_ESCAPED" >> $GITHUB_OUTPUT
|
echo "results<<RESULTS_EOF"
|
||||||
|
cat scan_results.md
|
||||||
|
echo "RESULTS_EOF"
|
||||||
|
} >> $GITHUB_OUTPUT
|
||||||
echo "all-clean=$ALL_CLEAN" >> $GITHUB_OUTPUT
|
echo "all-clean=$ALL_CLEAN" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Upload scan results as artifact
|
- name: Upload scan results as artifact
|
||||||
@@ -274,11 +269,8 @@ jobs:
|
|||||||
create-release:
|
create-release:
|
||||||
needs: [check-release, build, virustotal-scan]
|
needs: [check-release, build, virustotal-scan]
|
||||||
if: needs.check-release.outputs.should-build == 'true' && needs.virustotal-scan.outputs.all-clean == 'true'
|
if: needs.check-release.outputs.should-build == 'true' && needs.virustotal-scan.outputs.all-clean == 'true'
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -291,6 +283,13 @@ jobs:
|
|||||||
find artifacts -name "fio_*" -type f -exec cp {} release-assets/ \;
|
find artifacts -name "fio_*" -type f -exec cp {} release-assets/ \;
|
||||||
ls -la release-assets/
|
ls -la release-assets/
|
||||||
|
|
||||||
|
- name: Download upstream source tarball
|
||||||
|
run: |
|
||||||
|
# Attach the exact upstream source these binaries were built from
|
||||||
|
# (fio is GPL-2.0; distributing binaries requires offering the source)
|
||||||
|
curl -L --retry 5 --retry-delay 2 --connect-timeout 15 "https://github.com/axboe/fio/archive/${{ needs.check-release.outputs.latest-version }}.tar.gz" -o "release-assets/${{ needs.check-release.outputs.latest-version }}.tar.gz"
|
||||||
|
ls -la release-assets/
|
||||||
|
|
||||||
- name: Generate SHA256 checksums
|
- name: Generate SHA256 checksums
|
||||||
run: |
|
run: |
|
||||||
cd release-assets
|
cd release-assets
|
||||||
@@ -304,12 +303,12 @@ jobs:
|
|||||||
path: vt-results
|
path: vt-results
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: fio-${{ needs.check-release.outputs.latest-version }}
|
tag_name: ${{ needs.check-release.outputs.latest-version }}
|
||||||
name: fio ${{ needs.check-release.outputs.latest-version }} Static Binaries
|
name: ${{ needs.check-release.outputs.latest-version }} Static Binaries
|
||||||
body: |
|
body: |
|
||||||
Static binaries for fio ${{ needs.check-release.outputs.latest-version }}
|
Static binaries for ${{ needs.check-release.outputs.latest-version }}
|
||||||
|
|
||||||
Built using musl toolchains for maximum compatibility.
|
Built using musl toolchains for maximum compatibility.
|
||||||
|
|
||||||
@@ -330,10 +329,14 @@ jobs:
|
|||||||
sha256sum -c fio-checksums.sha256
|
sha256sum -c fio-checksums.sha256
|
||||||
```
|
```
|
||||||
|
|
||||||
For usage in YABS script, place these binaries in the `bin/fio/` directory.
|
**License & Source:**
|
||||||
|
fio is licensed under [GPL-2.0](https://github.com/axboe/fio/blob/master/COPYING) (© Jens Axboe).
|
||||||
|
These are unofficial static builds produced by CI for use by [YABS](https://github.com/masonr/yet-another-bench-script);
|
||||||
|
the exact upstream source is attached as `${{ needs.check-release.outputs.latest-version }}.tar.gz`.
|
||||||
files: |
|
files: |
|
||||||
release-assets/fio_*
|
release-assets/fio_*
|
||||||
release-assets/fio-checksums.sha256
|
release-assets/fio-checksums.sha256
|
||||||
|
release-assets/*.tar.gz
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
env:
|
env:
|
||||||
@@ -342,7 +345,7 @@ jobs:
|
|||||||
notify-failure:
|
notify-failure:
|
||||||
needs: [check-release, build, virustotal-scan]
|
needs: [check-release, build, virustotal-scan]
|
||||||
if: always() && needs.check-release.outputs.should-build == 'true' && (failure() || needs.virustotal-scan.outputs.all-clean == 'false')
|
if: always() && needs.check-release.outputs.should-build == 'true' && (failure() || needs.virustotal-scan.outputs.all-clean == 'false')
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Send failure notification
|
- name: Send failure notification
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
100
.github/workflows/build-iperf3.yml
vendored
100
.github/workflows/build-iperf3.yml
vendored
@@ -2,6 +2,12 @@ name: Build iperf3 Static Binaries
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
# check upstream for a new iperf3 release once a day
|
||||||
|
- cron: '47 5 * * *'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-release:
|
check-release:
|
||||||
@@ -10,15 +16,16 @@ jobs:
|
|||||||
latest-version: ${{ steps.get-version.outputs.version }}
|
latest-version: ${{ steps.get-version.outputs.version }}
|
||||||
should-build: ${{ steps.check-version.outputs.should-build }}
|
should-build: ${{ steps.check-version.outputs.should-build }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Get latest iperf3 release
|
- name: Get latest iperf3 release
|
||||||
id: get-version
|
id: get-version
|
||||||
run: |
|
run: |
|
||||||
# Get the latest release tag from GitHub API
|
# Get the latest release tag from GitHub API (e.g. "3.19")
|
||||||
LATEST_VERSION=$(curl -s https://api.github.com/repos/esnet/iperf/releases/latest | jq -r '.tag_name')
|
LATEST_VERSION=$(curl -4 --retry 5 --retry-delay 2 --connect-timeout 15 -s https://api.github.com/repos/esnet/iperf/releases/latest | jq -r '.tag_name')
|
||||||
echo "Latest iperf3 version: $LATEST_VERSION"
|
echo "Latest iperf3 version: $LATEST_VERSION"
|
||||||
|
if [ -z "$LATEST_VERSION" ] || [ "$LATEST_VERSION" = "null" ]; then
|
||||||
|
echo "Failed to determine latest iperf3 version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Check if version exists in releases
|
- name: Check if version exists in releases
|
||||||
@@ -41,7 +48,11 @@ jobs:
|
|||||||
needs: check-release
|
needs: check-release
|
||||||
if: needs.check-release.outputs.should-build == 'true'
|
if: needs.check-release.outputs.should-build == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# allow the ARM 32-bit leg to fail without failing the workflow (iperf3 arm32
|
||||||
|
# builds are historically flaky; kept as a safety net for future versions)
|
||||||
|
continue-on-error: ${{ matrix.arch == 'arm' }}
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- arch: x64
|
- arch: x64
|
||||||
@@ -53,28 +64,15 @@ jobs:
|
|||||||
- arch: aarch64
|
- arch: aarch64
|
||||||
cross: aarch64-linux-musl
|
cross: aarch64-linux-musl
|
||||||
host: aarch64-linux-gnu
|
host: aarch64-linux-gnu
|
||||||
# Note: ARM 32-bit compilation of iperf3 >3.15 has known issues
|
|
||||||
# We'll still attempt it but expect potential failures
|
|
||||||
- arch: arm
|
- arch: arm
|
||||||
cross: arm-linux-musleabihf
|
cross: arm-linux-musleabihf
|
||||||
host: arm-linux-gnueabihf
|
host: arm-linux-gnueabihf
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Create compilation script
|
- name: Create compilation script
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ needs.check-release.outputs.latest-version }}"
|
|
||||||
ARCH="${{ matrix.arch }}"
|
|
||||||
CROSS="${{ matrix.cross }}"
|
|
||||||
HOST="${{ matrix.host }}"
|
|
||||||
|
|
||||||
# Single script for all architectures using musl cross-compilation
|
# Single script for all architectures using musl cross-compilation
|
||||||
cat > compile-iperf3.sh << EOF
|
cat > compile-iperf3.sh << 'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -92,42 +90,40 @@ jobs:
|
|||||||
|
|
||||||
# download musl cross compilation toolchain
|
# download musl cross compilation toolchain
|
||||||
cd ~
|
cd ~
|
||||||
curl -L "https://musl.cc/\$CROSS-cross.tgz" -o "\$CROSS-cross.tgz"
|
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 "https://musl.cc/$CROSS-cross.tgz" -o "$CROSS-cross.tgz"
|
||||||
tar xf "\$CROSS-cross.tgz"
|
tar xf "$CROSS-cross.tgz"
|
||||||
|
|
||||||
# Activate Holy Build Box exe compilation environment
|
# Activate Holy Build Box exe compilation environment
|
||||||
source /hbb_exe/activate
|
source /hbb_exe/activate
|
||||||
|
|
||||||
# download and compile iperf3
|
# download and compile iperf3
|
||||||
cd ~
|
cd ~
|
||||||
curl -L "https://github.com/esnet/iperf/archive/\$VERSION.tar.gz" -o "iperf.tar.gz"
|
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 "https://github.com/esnet/iperf/archive/$VERSION.tar.gz" -o "iperf.tar.gz"
|
||||||
tar xf iperf.tar.gz
|
tar xf iperf.tar.gz
|
||||||
cd iperf-*
|
cd iperf-*
|
||||||
CC=/root/\$CROSS-cross/bin/\$CROSS-gcc ./configure --disable-shared --disable-profiling --build x86_64-pc-linux-gnu --host "\$HOST" --with-openssl=no --enable-static-bin
|
CC=/root/$CROSS-cross/bin/$CROSS-gcc ./configure --disable-shared --disable-profiling --build x86_64-pc-linux-gnu --host "$HOST" --with-openssl=no --enable-static-bin
|
||||||
|
# remove libatomic.la so libtool links the static libatomic.a rather than
|
||||||
|
# attempting to link libatomic.so into the static binary (breaks arm32 builds)
|
||||||
|
rm -f /root/$CROSS-cross/$CROSS/lib/libatomic.la
|
||||||
make
|
make
|
||||||
|
|
||||||
# verify no external shared library links
|
# verify no external shared library links
|
||||||
libcheck src/iperf3
|
libcheck src/iperf3
|
||||||
# copy iperf3 binary to mounted dir
|
# copy iperf3 binary to mounted dir
|
||||||
cp src/iperf3 "/io/iperf3_\$ARCH"
|
cp src/iperf3 "/io/iperf3_$ARCH"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x compile-iperf3.sh
|
chmod +x compile-iperf3.sh
|
||||||
|
|
||||||
- name: Compile iperf3 binary
|
- name: Compile iperf3 binary
|
||||||
run: |
|
run: |
|
||||||
ARCH="${{ matrix.arch }}"
|
|
||||||
CROSS="${{ matrix.cross }}"
|
|
||||||
HOST="${{ matrix.host }}"
|
|
||||||
|
|
||||||
# Use musl cross-compilation for all architectures
|
# Use musl cross-compilation for all architectures
|
||||||
docker run --rm -v $(pwd):/io --env ARCH=$ARCH --env CROSS=$CROSS --env HOST=$HOST --env VERSION="${{ needs.check-release.outputs.latest-version }}" phusion/holy-build-box-64:latest bash /io/compile-iperf3.sh
|
docker run --rm -v $(pwd):/io --env ARCH=${{ matrix.arch }} --env CROSS=${{ matrix.cross }} --env HOST=${{ matrix.host }} --env VERSION="${{ needs.check-release.outputs.latest-version }}" phusion/holy-build-box-64:latest bash /io/compile-iperf3.sh
|
||||||
|
|
||||||
- name: Verify binary
|
- name: Verify binary
|
||||||
run: |
|
run: |
|
||||||
ARCH="${{ matrix.arch }}"
|
ls -la iperf3_${{ matrix.arch }}
|
||||||
ls -la iperf3_$ARCH
|
file iperf3_${{ matrix.arch }}
|
||||||
file iperf3_$ARCH
|
|
||||||
|
|
||||||
- name: Upload binary as artifact
|
- name: Upload binary as artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -135,8 +131,6 @@ jobs:
|
|||||||
name: iperf3_${{ matrix.arch }}
|
name: iperf3_${{ matrix.arch }}
|
||||||
path: iperf3_${{ matrix.arch }}
|
path: iperf3_${{ matrix.arch }}
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
# Allow arm builds to fail as ARM 32-bit has known compilation issues with newer versions
|
|
||||||
continue-on-error: ${{ matrix.arch == 'arm' }}
|
|
||||||
|
|
||||||
virustotal-scan:
|
virustotal-scan:
|
||||||
needs: [check-release, build]
|
needs: [check-release, build]
|
||||||
@@ -172,14 +166,13 @@ jobs:
|
|||||||
echo "|--------|--------|-----------|------------|------------|----------------|" >> scan_results.md
|
echo "|--------|--------|-----------|------------|------------|----------------|" >> scan_results.md
|
||||||
|
|
||||||
ALL_CLEAN=true
|
ALL_CLEAN=true
|
||||||
SCAN_DATA=""
|
|
||||||
|
|
||||||
for binary in scan-binaries/iperf3_*; do
|
for binary in scan-binaries/iperf3_*; do
|
||||||
filename=$(basename "$binary")
|
filename=$(basename "$binary")
|
||||||
echo "Uploading $filename to VirusTotal..."
|
echo "Uploading $filename to VirusTotal..."
|
||||||
|
|
||||||
# Upload to VirusTotal
|
# Upload to VirusTotal
|
||||||
upload_response=$(curl -s --request POST \
|
upload_response=$(curl -4 --retry 5 --retry-delay 2 --connect-timeout 15 -s --request POST \
|
||||||
--url https://www.virustotal.com/api/v3/files \
|
--url https://www.virustotal.com/api/v3/files \
|
||||||
--header 'accept: application/json' \
|
--header 'accept: application/json' \
|
||||||
--header 'content-type: multipart/form-data' \
|
--header 'content-type: multipart/form-data' \
|
||||||
@@ -200,8 +193,6 @@ jobs:
|
|||||||
echo "${filename}:${analysis_id}" >> analysis_ids.txt
|
echo "${filename}:${analysis_id}" >> analysis_ids.txt
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "all_clean_upload=$ALL_CLEAN" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Wait 2 minutes for scans to complete
|
# Wait 2 minutes for scans to complete
|
||||||
echo "Waiting 2 minutes for VirusTotal scans to complete..."
|
echo "Waiting 2 minutes for VirusTotal scans to complete..."
|
||||||
sleep 120
|
sleep 120
|
||||||
@@ -210,13 +201,12 @@ jobs:
|
|||||||
id: get-results
|
id: get-results
|
||||||
run: |
|
run: |
|
||||||
ALL_CLEAN=true
|
ALL_CLEAN=true
|
||||||
SCAN_SUMMARY=""
|
|
||||||
|
|
||||||
while IFS=':' read -r filename analysis_id; do
|
while IFS=':' read -r filename analysis_id; do
|
||||||
echo "Retrieving results for $filename (ID: $analysis_id)..."
|
echo "Retrieving results for $filename (ID: $analysis_id)..."
|
||||||
|
|
||||||
# Get scan results
|
# Get scan results
|
||||||
result_response=$(curl -s --request GET \
|
result_response=$(curl -4 --retry 5 --retry-delay 2 --connect-timeout 15 -s --request GET \
|
||||||
--url "https://www.virustotal.com/api/v3/analyses/$analysis_id" \
|
--url "https://www.virustotal.com/api/v3/analyses/$analysis_id" \
|
||||||
--header 'accept: application/json' \
|
--header 'accept: application/json' \
|
||||||
--header "x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}")
|
--header "x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}")
|
||||||
@@ -257,13 +247,15 @@ jobs:
|
|||||||
- name: Create scan summary
|
- name: Create scan summary
|
||||||
id: scan-summary
|
id: scan-summary
|
||||||
run: |
|
run: |
|
||||||
RESULTS=$(cat scan_results.md)
|
|
||||||
ALL_CLEAN="${{ steps.get-results.outputs.all_clean }}"
|
ALL_CLEAN="${{ steps.get-results.outputs.all_clean }}"
|
||||||
|
|
||||||
# Escape newlines for GitHub output
|
# Pass the scan results through as a multi-line output (heredoc delimiter
|
||||||
RESULTS_ESCAPED=$(echo "$RESULTS" | sed ':a;N;$!ba;s/\n/\\n/g')
|
# syntax) so the markdown table renders correctly in the release body
|
||||||
|
{
|
||||||
echo "results=$RESULTS_ESCAPED" >> $GITHUB_OUTPUT
|
echo "results<<RESULTS_EOF"
|
||||||
|
cat scan_results.md
|
||||||
|
echo "RESULTS_EOF"
|
||||||
|
} >> $GITHUB_OUTPUT
|
||||||
echo "all-clean=$ALL_CLEAN" >> $GITHUB_OUTPUT
|
echo "all-clean=$ALL_CLEAN" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Upload scan results as artifact
|
- name: Upload scan results as artifact
|
||||||
@@ -280,9 +272,6 @@ jobs:
|
|||||||
if: needs.check-release.outputs.should-build == 'true' && needs.virustotal-scan.outputs.all-clean == 'true'
|
if: needs.check-release.outputs.should-build == 'true' && needs.virustotal-scan.outputs.all-clean == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -303,6 +292,13 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Download upstream source tarball
|
||||||
|
run: |
|
||||||
|
# Attach the exact upstream source these binaries were built from
|
||||||
|
# (iperf3 is BSD-3-Clause; retain the copyright notice with distribution)
|
||||||
|
curl -L --retry 5 --retry-delay 2 --connect-timeout 15 "https://github.com/esnet/iperf/archive/${{ needs.check-release.outputs.latest-version }}.tar.gz" -o "release-assets/iperf-${{ needs.check-release.outputs.latest-version }}.tar.gz"
|
||||||
|
ls -la release-assets/
|
||||||
|
|
||||||
- name: Generate SHA256 checksums
|
- name: Generate SHA256 checksums
|
||||||
run: |
|
run: |
|
||||||
cd release-assets
|
cd release-assets
|
||||||
@@ -330,7 +326,7 @@ jobs:
|
|||||||
path: vt-results
|
path: vt-results
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: iperf3-${{ needs.check-release.outputs.latest-version }}
|
tag_name: iperf3-${{ needs.check-release.outputs.latest-version }}
|
||||||
name: iperf3 ${{ needs.check-release.outputs.latest-version }} Static Binaries
|
name: iperf3 ${{ needs.check-release.outputs.latest-version }} Static Binaries
|
||||||
@@ -358,10 +354,14 @@ jobs:
|
|||||||
sha256sum -c iperf3-checksums.sha256
|
sha256sum -c iperf3-checksums.sha256
|
||||||
```
|
```
|
||||||
|
|
||||||
For usage in YABS script, place these binaries in the `bin/iperf/` directory.
|
**License & Source:**
|
||||||
|
iperf3 is licensed under [BSD-3-Clause](https://github.com/esnet/iperf/blob/master/LICENSE) (© ESnet / LBL).
|
||||||
|
These are unofficial static builds produced by CI for use by [YABS](https://github.com/masonr/yet-another-bench-script);
|
||||||
|
the exact upstream source is attached as `iperf-${{ needs.check-release.outputs.latest-version }}.tar.gz`.
|
||||||
files: |
|
files: |
|
||||||
release-assets/iperf3_*
|
release-assets/iperf3_*
|
||||||
release-assets/iperf3-checksums.sha256
|
release-assets/iperf3-checksums.sha256
|
||||||
|
release-assets/*.tar.gz
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
env:
|
env:
|
||||||
|
|||||||
74
.github/workflows/monitor-releases.yml
vendored
74
.github/workflows/monitor-releases.yml
vendored
@@ -1,74 +0,0 @@
|
|||||||
name: Monitor External Releases for Updates
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
# Check every hour for new releases
|
|
||||||
- cron: '0 * * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
monitor-releases:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Check fio releases
|
|
||||||
id: check-fio
|
|
||||||
run: |
|
|
||||||
# Get latest fio release
|
|
||||||
LATEST_FIO=$(curl -s https://api.github.com/repos/axboe/fio/releases/latest | jq -r '.tag_name')
|
|
||||||
echo "Latest fio: $LATEST_FIO"
|
|
||||||
|
|
||||||
# Check if we already have this version
|
|
||||||
if ! gh release view "fio-$LATEST_FIO" --repo ${{ github.repository }} >/dev/null 2>&1; then
|
|
||||||
echo "New fio version found: $LATEST_FIO"
|
|
||||||
echo "trigger-fio=true" >> $GITHUB_OUTPUT
|
|
||||||
echo "fio-version=$LATEST_FIO" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "fio $LATEST_FIO already exists"
|
|
||||||
echo "trigger-fio=false" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Check iperf3 releases
|
|
||||||
id: check-iperf3
|
|
||||||
run: |
|
|
||||||
# Get latest iperf3 release
|
|
||||||
LATEST_IPERF3=$(curl -s https://api.github.com/repos/esnet/iperf/releases/latest | jq -r '.tag_name')
|
|
||||||
echo "Latest iperf3: $LATEST_IPERF3"
|
|
||||||
|
|
||||||
# Check if we already have this version
|
|
||||||
if ! gh release view "iperf3-$LATEST_IPERF3" --repo ${{ github.repository }} >/dev/null 2>&1; then
|
|
||||||
echo "New iperf3 version found: $LATEST_IPERF3"
|
|
||||||
echo "trigger-iperf3=true" >> $GITHUB_OUTPUT
|
|
||||||
echo "iperf3-version=$LATEST_IPERF3" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "iperf3 $LATEST_IPERF3 already exists"
|
|
||||||
echo "trigger-iperf3=false" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Trigger fio build workflow
|
|
||||||
if: steps.check-fio.outputs.trigger-fio == 'true'
|
|
||||||
run: |
|
|
||||||
echo "Triggering fio build for version ${{ steps.check-fio.outputs.fio-version }}"
|
|
||||||
gh workflow run build-fio.yml --repo ${{ github.repository }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Trigger iperf3 build workflow
|
|
||||||
if: steps.check-iperf3.outputs.trigger-iperf3 == 'true'
|
|
||||||
run: |
|
|
||||||
echo "Triggering iperf3 build for version ${{ steps.check-iperf3.outputs.iperf3-version }}"
|
|
||||||
gh workflow run build-iperf3.yml --repo ${{ github.repository }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Summary
|
|
||||||
run: |
|
|
||||||
echo "## Release Monitoring Summary" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- fio: ${{ steps.check-fio.outputs.trigger-fio == 'true' && 'New version triggered build' || 'No new version' }}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- iperf3: ${{ steps.check-iperf3.outputs.trigger-iperf3 == 'true' && 'New version triggered build' || 'No new version' }}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
21
README.md
21
README.md
@@ -7,15 +7,18 @@ Logo design by [Dian Pratama](https://github.com/dianp)
|
|||||||
|
|
||||||
This script automates the execution of the best benchmarking tools in the industry. Included are several tests to check the performance of critical areas of a server: disk performance with [fio](https://github.com/axboe/fio), network performance with [iperf3](https://github.com/esnet/iperf), and CPU/memory performance with [Geekbench](https://www.geekbench.com/). The script is designed to not require any external dependencies to be installed nor elevated privileges to run. If there are any features that you would like to see added, feel free to submit an issue describing your feature request or fork the project and submit a PR!
|
This script automates the execution of the best benchmarking tools in the industry. Included are several tests to check the performance of critical areas of a server: disk performance with [fio](https://github.com/axboe/fio), network performance with [iperf3](https://github.com/esnet/iperf), and CPU/memory performance with [Geekbench](https://www.geekbench.com/). The script is designed to not require any external dependencies to be installed nor elevated privileges to run. If there are any features that you would like to see added, feel free to submit an issue describing your feature request or fork the project and submit a PR!
|
||||||
|
|
||||||
|
View Daily and Historical 📊 **[YABS Usage Stats Here](https://stats.yabs.sh/)** 📈 ([source](https://github.com/masonr/yabs-stats)).
|
||||||
|
|
||||||
### **What's New With YABS?**
|
### **What's New With YABS?**
|
||||||
|
* [24 Jul 2026](https://github.com/masonr/yet-another-bench-script) - [Geekbench 7](https://www.geekbench.com/) is now available via the `-7` flag (Geekbench 6 remains the default).
|
||||||
|
* [04 Jul 2026](https://stats.yabs.sh/) - Check out YABS usage stats here -> https://stats.yabs.sh/
|
||||||
* [27 Feb 2023](https://github.com/masonr/yet-another-bench-script/commit/06eaa2ab3b32355bec8278c51c4be93b3662a96d) - Newly released [Geekbench 6](https://www.geekbench.com/) is added as the default Geekbench test.
|
* [27 Feb 2023](https://github.com/masonr/yet-another-bench-script/commit/06eaa2ab3b32355bec8278c51c4be93b3662a96d) - Newly released [Geekbench 6](https://www.geekbench.com/) is added as the default Geekbench test.
|
||||||
* [26 Feb 2023](https://github.com/masonr/yet-another-bench-script/commit/f075baf59c3057983fff0a30ea0c746b5ea88d91) - Network information added to YABS output using [ip-api](https://ip-api.com/).
|
* [26 Feb 2023](https://github.com/masonr/yet-another-bench-script/commit/f075baf59c3057983fff0a30ea0c746b5ea88d91) - Network information added to YABS output using [ip-api](https://ip-api.com/).
|
||||||
* [15 Aug 2022](https://github.com/masonr/yet-another-bench-script/commit/ae24e70fbf7a4848e81a70cf829ec44e060e63d5) - Added JSON output/upload support to export or auto-upload of YABS results for sharing.
|
|
||||||
|
|
||||||
## How to Run
|
## How to Run
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -sL https://yabs.sh | bash
|
curl -sL yabs.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
@@ -32,10 +35,10 @@ wget -qO- yabs.sh | bash
|
|||||||
|
|
||||||
**Windows Users**: This script can be run on Windows systems by using [Windows Subsystem for Linux v2 (WSL 2)](https://learn.microsoft.com/en-us/windows/wsl/about). WSLv1 will not run the script and binaries correctly.
|
**Windows Users**: This script can be run on Windows systems by using [Windows Subsystem for Linux v2 (WSL 2)](https://learn.microsoft.com/en-us/windows/wsl/about). WSLv1 will not run the script and binaries correctly.
|
||||||
|
|
||||||
### Flags (Skipping Tests, Reducing iperf Locations, Geekbench 4/5/6, etc.)
|
### Flags (Skipping Tests, Reducing iperf Locations, Geekbench 4/5/6/7, etc.)
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -sL https://yabs.sh | bash -s -- -flags
|
curl -sL yabs.sh | bash -s -- -flags
|
||||||
```
|
```
|
||||||
|
|
||||||
| Flag | Description |
|
| Flag | Description |
|
||||||
@@ -49,8 +52,9 @@ curl -sL https://yabs.sh | bash -s -- -flags
|
|||||||
| -r | Reduces the number of iperf locations (Scaleway/Clouvider LON+NYC) to lessen bandwidth usage |
|
| -r | Reduces the number of iperf locations (Scaleway/Clouvider LON+NYC) to lessen bandwidth usage |
|
||||||
| -4 | Runs a Geekbench 4 test and disables the Geekbench 6 test |
|
| -4 | Runs a Geekbench 4 test and disables the Geekbench 6 test |
|
||||||
| -5 | Runs a Geekbench 5 test and disables the Geekbench 6 test |
|
| -5 | Runs a Geekbench 5 test and disables the Geekbench 6 test |
|
||||||
|
| -7 | Runs a Geekbench 7 test and disables the Geekbench 6 test |
|
||||||
| -9 | Runs both the Geekbench 4 and 5 tests instead of the Geekbench 6 test |
|
| -9 | Runs both the Geekbench 4 and 5 tests instead of the Geekbench 6 test |
|
||||||
| -6 | Re-enables the Geekbench 6 test if any of the following were used: -4, -5, or -9 (-6 flag must be last to not be overridden) |
|
| -6 | Re-enables the Geekbench 6 test if any of the following were used: -4, -5, -7, or -9 (-6 flag must be last to not be overridden) |
|
||||||
| -j | Prints a JSON representation of the results to the screen |
|
| -j | Prints a JSON representation of the results to the screen |
|
||||||
| -w \<filename\> | Writes the JSON results to a file using the file name provided |
|
| -w \<filename\> | Writes the JSON results to a file using the file name provided |
|
||||||
| -s \<url\> | Sends a JSON representation of the results to the designated URL(s) (see section below) |
|
| -s \<url\> | Sends a JSON representation of the results to the designated URL(s) (see section below) |
|
||||||
@@ -73,8 +77,9 @@ Sites supporting submission of YABS JSON results:
|
|||||||
|
|
||||||
| Website | Example Command |
|
| Website | Example Command |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [YABSdb](https://yabsdb.com/) | `curl -sL https://yabs.sh \| bash -s -- -s "https://yabsdb.com/add"` |
|
| [YABSdb](https://yabsdb.com/) | `curl -sL yabs.sh \| bash -s -- -s "https://yabsdb.com/add"` |
|
||||||
| [VPSBenchmarks](https://www.vpsbenchmarks.com/yabs/get_started) | `curl -sL https://yabs.sh \| bash -s -- -s https://www.vpsbenchmarks.com/yabs/upload` |
|
| [VPSBenchmarks](https://www.vpsbenchmarks.com/yabs/get_started) | `curl -sL yabs.sh \| bash -s -- -s https://www.vpsbenchmarks.com/yabs/upload` |
|
||||||
|
| [ServerVerify](https://serververify.com/benchmarks) | (sign up for account) |
|
||||||
|
|
||||||
Example JSON output: [example.json](bin/example.json).
|
Example JSON output: [example.json](bin/example.json).
|
||||||
|
|
||||||
@@ -82,7 +87,7 @@ Example JSON output: [example.json](bin/example.json).
|
|||||||
|
|
||||||
* **[fio](https://github.com/axboe/fio)** - the most comprehensive I/O testing software available, fio grants the ability to evaluate disk performance in a variety of methods with a variety of options. Four random read and write fio disk tests are conducted as part of this script with 4k, 64k, 512k, and 1m block sizes. The tests are designed to evaluate disk throughput in near-real world (using random) scenarios with a 50/50 split (50% reads and 50% writes per test).
|
* **[fio](https://github.com/axboe/fio)** - the most comprehensive I/O testing software available, fio grants the ability to evaluate disk performance in a variety of methods with a variety of options. Four random read and write fio disk tests are conducted as part of this script with 4k, 64k, 512k, and 1m block sizes. The tests are designed to evaluate disk throughput in near-real world (using random) scenarios with a 50/50 split (50% reads and 50% writes per test).
|
||||||
* **[iperf3](https://github.com/esnet/iperf)** - the industry standard for testing download and upload speeds to various locations. This script utilizes iperf3 with 8 parallel threads and tests both download and upload speeds. If an iperf server is busy after 5 tries, the speed test for that location/direction is skipped.
|
* **[iperf3](https://github.com/esnet/iperf)** - the industry standard for testing download and upload speeds to various locations. This script utilizes iperf3 with 8 parallel threads and tests both download and upload speeds. If an iperf server is busy after 5 tries, the speed test for that location/direction is skipped.
|
||||||
* **[Geekbench](https://www.geekbench.com/)** - Geekbench is a benchmarking program that measures system performance, which is widely used in the tech community. The web URL is displayed to be able to see complete test and individual benchmark results and allow comparison to other geekbench'd systems. The claim URL to add the Geekbench result to your Geekbench profile is written to a file in the directory that this script is executed from. By default, Geekbench 6 is the only Geekbench test performed, however, Geekbench 4 and/or 5 can also be toggled on by passing the appropriate flag.
|
* **[Geekbench](https://www.geekbench.com/)** - Geekbench is a benchmarking program that measures system performance, which is widely used in the tech community. The web URL is displayed to be able to see complete test and individual benchmark results and allow comparison to other geekbench'd systems. The claim URL to add the Geekbench result to your Geekbench profile is written to a file in the directory that this script is executed from. By default, Geekbench 6 is the only Geekbench test performed, however, Geekbench 4, 5, and/or 7 can also be toggled on by passing the appropriate flag.
|
||||||
|
|
||||||
### Security Notice
|
### Security Notice
|
||||||
|
|
||||||
|
|||||||
62
yabs.sh
62
yabs.sh
@@ -1,18 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Yet Another Bench Script by Mason Rowe
|
# Yet Another Bench Script by Mason Rowe
|
||||||
# Initial Oct 2019; Last update Jul 2026
|
# Initial Oct 2019; Last update Sep 2026
|
||||||
|
|
||||||
# Disclaimer: This project is a work in progress. Any errors or suggestions should be
|
# Disclaimer: This project is a work in progress. Any errors or suggestions should be
|
||||||
# relayed to me via the GitHub project page linked below.
|
# relayed to me via the GitHub project page linked below.
|
||||||
#
|
#
|
||||||
# Purpose: The purpose of this script is to quickly gauge the performance of a Linux-
|
# Purpose: The purpose of this script is to quickly gauge the performance of a Linux-
|
||||||
# based server by benchmarking network performance via iperf3, CPU and
|
# based server by benchmarking network performance via iperf3, CPU and
|
||||||
# overall system performance via Geekbench 4/5/6, and random disk
|
# overall system performance via Geekbench 4/5/6/7, and random disk
|
||||||
# performance via fio. The script is designed to not require any dependencies
|
# performance via fio. The script is designed to not require any dependencies
|
||||||
# - either compiled or installed - nor admin privileges to run.
|
# - either compiled or installed - nor admin privileges to run.
|
||||||
|
|
||||||
YABS_VERSION="v2026-07-03"
|
YABS_VERSION="v2026-09-17"
|
||||||
|
|
||||||
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
|
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
|
||||||
echo -e '# Yet-Another-Bench-Script #'
|
echo -e '# Yet-Another-Bench-Script #'
|
||||||
@@ -59,11 +59,11 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# flags to skip certain performance tests
|
# flags to skip certain performance tests
|
||||||
unset PREFER_BIN SKIP_FIO SKIP_IPERF SKIP_GEEKBENCH SKIP_NET PRINT_HELP REDUCE_NET GEEKBENCH_4 GEEKBENCH_5 GEEKBENCH_6 DD_FALLBACK IPERF_DL_FAIL JSON JSON_SEND JSON_RESULT JSON_FILE IPERF_SERVERS
|
unset PREFER_BIN SKIP_FIO SKIP_IPERF SKIP_GEEKBENCH SKIP_NET PRINT_HELP REDUCE_NET GEEKBENCH_4 GEEKBENCH_5 GEEKBENCH_6 GEEKBENCH_7 DD_FALLBACK IPERF_DL_FAIL JSON JSON_SEND JSON_RESULT JSON_FILE IPERF_SERVERS
|
||||||
GEEKBENCH_6="True" # gb6 test enabled by default
|
GEEKBENCH_6="True" # gb6 test enabled by default
|
||||||
|
|
||||||
# get any arguments that were passed to the script and set the associated skip flags (if applicable)
|
# get any arguments that were passed to the script and set the associated skip flags (if applicable)
|
||||||
while getopts 'bfdignhr4596jw:s:p:' flag; do
|
while getopts 'bfdignhr45796jw:s:p:' flag; do
|
||||||
case "${flag}" in
|
case "${flag}" in
|
||||||
b) PREFER_BIN="True" ;;
|
b) PREFER_BIN="True" ;;
|
||||||
f) SKIP_FIO="True" ;;
|
f) SKIP_FIO="True" ;;
|
||||||
@@ -75,6 +75,7 @@ while getopts 'bfdignhr4596jw:s:p:' flag; do
|
|||||||
r) REDUCE_NET="True" ;;
|
r) REDUCE_NET="True" ;;
|
||||||
4) GEEKBENCH_4="True" && unset GEEKBENCH_6 ;;
|
4) GEEKBENCH_4="True" && unset GEEKBENCH_6 ;;
|
||||||
5) GEEKBENCH_5="True" && unset GEEKBENCH_6 ;;
|
5) GEEKBENCH_5="True" && unset GEEKBENCH_6 ;;
|
||||||
|
7) GEEKBENCH_7="True" && unset GEEKBENCH_6 ;;
|
||||||
9) GEEKBENCH_4="True" && GEEKBENCH_5="True" && unset GEEKBENCH_6 ;;
|
9) GEEKBENCH_4="True" && GEEKBENCH_5="True" && unset GEEKBENCH_6 ;;
|
||||||
6) GEEKBENCH_6="True" ;;
|
6) GEEKBENCH_6="True" ;;
|
||||||
j) JSON+="j" ;;
|
j) JSON+="j" ;;
|
||||||
@@ -144,8 +145,9 @@ if [ -n "$PRINT_HELP" ]; then
|
|||||||
echo -e " to lessen bandwidth usage"
|
echo -e " to lessen bandwidth usage"
|
||||||
echo -e " -4 : use geekbench 4 instead of geekbench 6"
|
echo -e " -4 : use geekbench 4 instead of geekbench 6"
|
||||||
echo -e " -5 : use geekbench 5 instead of geekbench 6"
|
echo -e " -5 : use geekbench 5 instead of geekbench 6"
|
||||||
|
echo -e " -7 : use geekbench 7 instead of geekbench 6"
|
||||||
echo -e " -9 : use both geekbench 4 AND geekbench 5 instead of geekbench 6"
|
echo -e " -9 : use both geekbench 4 AND geekbench 5 instead of geekbench 6"
|
||||||
echo -e " -6 : use geekbench 6 in addition to 4 and/or 5 (only needed if -4, -5, or -9 are set; -6 must come last)"
|
echo -e " -6 : use geekbench 6 in addition to 4, 5, and/or 7 (only needed if -4, -5, -7, or -9 are set; -6 must come last)"
|
||||||
echo -e " -j : print jsonified YABS results at conclusion of test"
|
echo -e " -j : print jsonified YABS results at conclusion of test"
|
||||||
echo -e " -w <filename> : write jsonified YABS results to disk using file name provided"
|
echo -e " -w <filename> : write jsonified YABS results to disk using file name provided"
|
||||||
echo -e " -s <url> : send jsonified YABS results to URL"
|
echo -e " -s <url> : send jsonified YABS results to URL"
|
||||||
@@ -165,6 +167,7 @@ if [ -n "$PRINT_HELP" ]; then
|
|||||||
[[ -n $GEEKBENCH_4 ]] && echo -e " running geekbench 4"
|
[[ -n $GEEKBENCH_4 ]] && echo -e " running geekbench 4"
|
||||||
[[ -n $GEEKBENCH_5 ]] && echo -e " running geekbench 5"
|
[[ -n $GEEKBENCH_5 ]] && echo -e " running geekbench 5"
|
||||||
[[ -n $GEEKBENCH_6 ]] && echo -e " running geekbench 6"
|
[[ -n $GEEKBENCH_6 ]] && echo -e " running geekbench 6"
|
||||||
|
[[ -n $GEEKBENCH_7 ]] && echo -e " running geekbench 7"
|
||||||
[[ -n $IPERF_SERVERS ]] && echo -e " -p, using custom iperf servers: $IPERF_SERVERS"
|
[[ -n $IPERF_SERVERS ]] && echo -e " -p, using custom iperf servers: $IPERF_SERVERS"
|
||||||
echo -e
|
echo -e
|
||||||
echo -e "Local Binary Check:"
|
echo -e "Local Binary Check:"
|
||||||
@@ -940,7 +943,7 @@ if [ -z "$SKIP_IPERF" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# launch_geekbench
|
# launch_geekbench
|
||||||
# Purpose: This method is designed to run the Primate Labs' Geekbench 4/5/6 Cross-Platform Benchmark utility
|
# Purpose: This method is designed to run the Primate Labs' Geekbench 4/5/6/7 Cross-Platform Benchmark utility
|
||||||
# Parameters:
|
# Parameters:
|
||||||
# 1. VERSION - indicates which Geekbench version to run
|
# 1. VERSION - indicates which Geekbench version to run
|
||||||
function launch_geekbench {
|
function launch_geekbench {
|
||||||
@@ -963,8 +966,8 @@ function launch_geekbench {
|
|||||||
GB_URL="https://cdn.geekbench.com/Geekbench-4.4.4-Linux.tar.gz"
|
GB_URL="https://cdn.geekbench.com/Geekbench-4.4.4-Linux.tar.gz"
|
||||||
[[ "$ARCH" == *"x86"* ]] && GB_CMD="geekbench_x86_32" || GB_CMD="geekbench4"
|
[[ "$ARCH" == *"x86"* ]] && GB_CMD="geekbench_x86_32" || GB_CMD="geekbench4"
|
||||||
GB_RUN="True"
|
GB_RUN="True"
|
||||||
elif [[ $VERSION == *5* || $VERSION == *6* ]]; then # Geekbench v5/6
|
elif [[ $VERSION == *5* || $VERSION == *6* || $VERSION == *7* ]]; then # Geekbench v5/6/7
|
||||||
if [[ $ARCH = *x86* && $GEEKBENCH_4 == *False* ]]; then # don't run Geekbench 5 if on 32-bit arch
|
if [[ $ARCH = *x86* && $GEEKBENCH_4 == *False* ]]; then # don't run Geekbench 5/6/7 if on 32-bit arch
|
||||||
echo -e "\nGeekbench $VERSION cannot run on 32-bit architectures. Re-run with -4 flag to use"
|
echo -e "\nGeekbench $VERSION cannot run on 32-bit architectures. Re-run with -4 flag to use"
|
||||||
echo -e "Geekbench 4, which can support 32-bit architectures. Skipping Geekbench $VERSION."
|
echo -e "Geekbench 4, which can support 32-bit architectures. Skipping Geekbench $VERSION."
|
||||||
elif [[ $ARCH = *x86* && $GEEKBENCH_4 == *True* ]]; then
|
elif [[ $ARCH = *x86* && $GEEKBENCH_4 == *True* ]]; then
|
||||||
@@ -974,10 +977,14 @@ function launch_geekbench {
|
|||||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-5.5.1-LinuxARMPreview.tar.gz" \
|
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-5.5.1-LinuxARMPreview.tar.gz" \
|
||||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-5.5.1-Linux.tar.gz"
|
|| GB_URL="https://cdn.geekbench.com/Geekbench-5.5.1-Linux.tar.gz"
|
||||||
GB_CMD="geekbench5"
|
GB_CMD="geekbench5"
|
||||||
else # Geekbench v6
|
elif [[ $VERSION == *6* ]]; then # Geekbench v6
|
||||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-6.7.1-LinuxARMPreview.tar.gz" \
|
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-6.7.1-LinuxARMPreview.tar.gz" \
|
||||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-6.7.1-Linux.tar.gz"
|
|| GB_URL="https://cdn.geekbench.com/Geekbench-6.7.1-Linux.tar.gz"
|
||||||
GB_CMD="geekbench6"
|
GB_CMD="geekbench6"
|
||||||
|
else # Geekbench v7
|
||||||
|
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-7.0.0-LinuxARMPreview.tar.gz" \
|
||||||
|
|| GB_URL="https://cdn.geekbench.com/Geekbench-7.0.0-Linux.tar.gz"
|
||||||
|
GB_CMD="geekbench7"
|
||||||
fi
|
fi
|
||||||
GB_RUN="True"
|
GB_RUN="True"
|
||||||
fi
|
fi
|
||||||
@@ -998,7 +1005,8 @@ function launch_geekbench {
|
|||||||
test -f "geekbench.license" && "$GEEKBENCH_PATH/$GB_CMD" --unlock "$(cat geekbench.license)" > /dev/null 2>&1
|
test -f "geekbench.license" && "$GEEKBENCH_PATH/$GB_CMD" --unlock "$(cat geekbench.license)" > /dev/null 2>&1
|
||||||
|
|
||||||
# run the Geekbench test and grep the test results URL given at the end of the test
|
# run the Geekbench test and grep the test results URL given at the end of the test
|
||||||
GEEKBENCH_TEST=$("$GEEKBENCH_PATH/$GB_CMD" --upload 2>/dev/null | grep "https://browser")
|
GEEKBENCH_OUTPUT=$("$GEEKBENCH_PATH/$GB_CMD" --upload 2>/dev/null)
|
||||||
|
GEEKBENCH_TEST=$(echo "$GEEKBENCH_OUTPUT" | grep "https://browser")
|
||||||
|
|
||||||
# ensure the test ran successfully
|
# ensure the test ran successfully
|
||||||
if [ -z "$GEEKBENCH_TEST" ]; then
|
if [ -z "$GEEKBENCH_TEST" ]; then
|
||||||
@@ -1010,7 +1018,7 @@ function launch_geekbench {
|
|||||||
# Geekbench test failed to download because host lacks IPv4 (cdn.geekbench.com = IPv4 only)
|
# Geekbench test failed to download because host lacks IPv4 (cdn.geekbench.com = IPv4 only)
|
||||||
echo -e "\r\033[0KGeekbench releases can only be downloaded over IPv4. FTP the Geekbench files and run manually."
|
echo -e "\r\033[0KGeekbench releases can only be downloaded over IPv4. FTP the Geekbench files and run manually."
|
||||||
elif [[ $VERSION != *4* && $TOTAL_RAM_RAW -le 1048576 ]]; then
|
elif [[ $VERSION != *4* && $TOTAL_RAM_RAW -le 1048576 ]]; then
|
||||||
# Geekbench 5/6 test failed with low memory (<=1GB)
|
# Geekbench 5/6/7 test failed with low memory (<=1GB)
|
||||||
echo -e "\r\033[0KGeekbench test failed and low memory was detected. Add at least 1GB of SWAP or use GB4 instead (higher compatibility with low memory systems)."
|
echo -e "\r\033[0KGeekbench test failed and low memory was detected. Add at least 1GB of SWAP or use GB4 instead (higher compatibility with low memory systems)."
|
||||||
elif [[ $ARCH != *x86* ]]; then
|
elif [[ $ARCH != *x86* ]]; then
|
||||||
# if the Geekbench test failed for any other reason, exit cleanly and print error message
|
# if the Geekbench test failed for any other reason, exit cleanly and print error message
|
||||||
@@ -1020,14 +1028,26 @@ function launch_geekbench {
|
|||||||
# if the Geekbench test succeeded, parse the test results URL
|
# if the Geekbench test succeeded, parse the test results URL
|
||||||
GEEKBENCH_URL=$(echo -e "$GEEKBENCH_TEST" | head -1 | awk '{ print $1 }')
|
GEEKBENCH_URL=$(echo -e "$GEEKBENCH_TEST" | head -1 | awk '{ print $1 }')
|
||||||
GEEKBENCH_URL_CLAIM=$(echo -e "$GEEKBENCH_TEST" | tail -1 | awk '{ print $1 }')
|
GEEKBENCH_URL_CLAIM=$(echo -e "$GEEKBENCH_TEST" | tail -1 | awk '{ print $1 }')
|
||||||
# sleep a bit to wait for results to be made available on the geekbench website
|
|
||||||
sleep 10
|
|
||||||
# parse the public results page for the single and multi core geekbench scores
|
|
||||||
[[ $VERSION == *4* ]] && GEEKBENCH_SCORES=$($DL_CMD "$GEEKBENCH_URL" | grep "span class='score'") || \
|
|
||||||
GEEKBENCH_SCORES=$($DL_CMD "$GEEKBENCH_URL" | grep "div class='score'")
|
|
||||||
|
|
||||||
GEEKBENCH_SCORES_SINGLE=$(echo "$GEEKBENCH_SCORES" | awk -v FS="(>|<)" '{ print $3 }' | head -n 1)
|
# newer Geekbench 6/7 releases print the single and multi-core scores to stdout
|
||||||
GEEKBENCH_SCORES_MULTI=$(echo "$GEEKBENCH_SCORES" | awk -v FS="(>|<)" '{ print $3 }' | tail -n 1)
|
# in the "Benchmark Summary" section; parse them directly from the test output
|
||||||
|
if [[ $VERSION == *6* || $VERSION == *7* ]]; then
|
||||||
|
GEEKBENCH_SCORES_SINGLE=$(echo "$GEEKBENCH_OUTPUT" | grep "Single-Core Score" | awk '{ print $NF }')
|
||||||
|
GEEKBENCH_SCORES_MULTI=$(echo "$GEEKBENCH_OUTPUT" | grep "Multi-Core Score" | awk '{ print $NF }')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if the scores were not found in the test output (i.e. Geekbench 4/5 or older
|
||||||
|
# 6/7 releases), fetch and parse the public results page for them instead
|
||||||
|
if [[ -z "$GEEKBENCH_SCORES_SINGLE" || -z "$GEEKBENCH_SCORES_MULTI" ]]; then
|
||||||
|
# sleep a bit to wait for results to be made available on the geekbench website
|
||||||
|
sleep 10
|
||||||
|
# parse the public results page for the single and multi core geekbench scores
|
||||||
|
[[ $VERSION == *4* ]] && GEEKBENCH_SCORES=$($DL_CMD "$GEEKBENCH_URL" | grep "span class='score'") || \
|
||||||
|
GEEKBENCH_SCORES=$($DL_CMD "$GEEKBENCH_URL" | grep "div class='score'")
|
||||||
|
|
||||||
|
GEEKBENCH_SCORES_SINGLE=$(echo "$GEEKBENCH_SCORES" | awk -v FS="(>|<)" '{ print $3 }' | head -n 1)
|
||||||
|
GEEKBENCH_SCORES_MULTI=$(echo "$GEEKBENCH_SCORES" | awk -v FS="(>|<)" '{ print $3 }' | tail -n 1)
|
||||||
|
fi
|
||||||
|
|
||||||
# print the Geekbench results
|
# print the Geekbench results
|
||||||
echo -en "\r\033[0K"
|
echo -en "\r\033[0K"
|
||||||
@@ -1064,6 +1084,10 @@ if [ -z "$SKIP_GEEKBENCH" ]; then
|
|||||||
if [[ $GEEKBENCH_6 == *True* ]]; then
|
if [[ $GEEKBENCH_6 == *True* ]]; then
|
||||||
launch_geekbench 6
|
launch_geekbench 6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $GEEKBENCH_7 == *True* ]]; then
|
||||||
|
launch_geekbench 7
|
||||||
|
fi
|
||||||
[[ -n $JSON ]] && [[ "${JSON_RESULT: -1}" == ',' ]] && JSON_RESULT="${JSON_RESULT%,}"
|
[[ -n $JSON ]] && [[ "${JSON_RESULT: -1}" == ',' ]] && JSON_RESULT="${JSON_RESULT%,}"
|
||||||
[[ -n $JSON ]] && JSON_RESULT+="]"
|
[[ -n $JSON ]] && JSON_RESULT+="]"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user