From 26771da6701ab445ded743bc4e941f3230467491 Mon Sep 17 00:00:00 2001 From: Jiahao Wang Date: Tue, 21 Apr 2026 10:28:00 +0000 Subject: [PATCH 1/4] guest: add nginx configuration fix Add nginx-fix/default.conf for working nginx benchmark. Copy nginx-fix/default.conf to /etc/nginx/http.d/ This ensures the nginx app benchmark can run successfully in the guest rootfs. Signed-off-by: Jiahao Wang --- guest/rootfs/Containerfile | 2 ++ guest/rootfs/nginx-fix/default.conf | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 guest/rootfs/nginx-fix/default.conf diff --git a/guest/rootfs/Containerfile b/guest/rootfs/Containerfile index d58075c..8514343 100644 --- a/guest/rootfs/Containerfile +++ b/guest/rootfs/Containerfile @@ -49,6 +49,8 @@ RUN apk add --no-cache \ COPY --from=builder /rootfs-extras/ / +COPY nginx-fix/default.conf /etc/nginx/http.d/default.conf + COPY lingbench/ /lingbench/ RUN chmod +x /lingbench/boot-marker.sh /lingbench/run.sh /lingbench/oneshot.sh diff --git a/guest/rootfs/nginx-fix/default.conf b/guest/rootfs/nginx-fix/default.conf new file mode 100644 index 0000000..d4d8ce2 --- /dev/null +++ b/guest/rootfs/nginx-fix/default.conf @@ -0,0 +1,11 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + + root /var/lib/nginx/html; + index index.html; + + location / { + return 200 'Hello from nginx'; + } +} From 2810994c35b9586175e646432bc8a7284eb962d0 Mon Sep 17 00:00:00 2001 From: Jiahao Wang Date: Tue, 21 Apr 2026 10:28:00 +0000 Subject: [PATCH 2/4] lingbench: add SPDX header to project files Adds the required SPDX copyright header to all project files. Signed-off-by: Jiahao Wang --- guest/rootfs/Containerfile | 4 ++++ guest/rootfs/lingbench/boot-marker.sh | 4 ++++ guest/rootfs/lingbench/oneshot.sh | 4 ++++ guest/rootfs/lingbench/run.sh | 4 ++++ src/cli.rs | 2 +- src/lib/config.rs | 2 +- src/lib/kernel.rs | 2 +- src/lib/lib.rs | 2 +- src/lib/rootfs.rs | 2 +- src/lib/util.rs | 2 +- src/main.rs | 2 +- 11 files changed, 23 insertions(+), 7 deletions(-) diff --git a/guest/rootfs/Containerfile b/guest/rootfs/Containerfile index 8514343..4457722 100644 --- a/guest/rootfs/Containerfile +++ b/guest/rootfs/Containerfile @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + # lingbench guest rootfs — multi-stage # # Stage 1 builds benchmarks that aren't packaged by Alpine. diff --git a/guest/rootfs/lingbench/boot-marker.sh b/guest/rootfs/lingbench/boot-marker.sh index b94cfa6..d342927 100644 --- a/guest/rootfs/lingbench/boot-marker.sh +++ b/guest/rootfs/lingbench/boot-marker.sh @@ -1,4 +1,8 @@ #!/bin/sh +# SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + # Emit a boot-complete marker to the serial console. The host-side # runner watches ttyS0 for this exact line and timestamps it to derive # guest-ready latency (boot time). diff --git a/guest/rootfs/lingbench/oneshot.sh b/guest/rootfs/lingbench/oneshot.sh index bb582bd..4769682 100644 --- a/guest/rootfs/lingbench/oneshot.sh +++ b/guest/rootfs/lingbench/oneshot.sh @@ -1,4 +1,8 @@ #!/bin/sh +# SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + # lingbench one-shot benchmark runner. # # Reads `lingbench.scenario=` (and optional `lingbench.args=`, diff --git a/guest/rootfs/lingbench/run.sh b/guest/rootfs/lingbench/run.sh index 12fbeb9..14f0de5 100644 --- a/guest/rootfs/lingbench/run.sh +++ b/guest/rootfs/lingbench/run.sh @@ -1,4 +1,8 @@ #!/bin/sh +# SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + # lingbench in-guest benchmark dispatcher. # # Invoked by the host-side runner (over vsock, ssh, or the serial diff --git a/src/cli.rs b/src/cli.rs index 395a2d0..870030e 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 LingCage +// SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 diff --git a/src/lib/config.rs b/src/lib/config.rs index 5503d54..97e3adf 100644 --- a/src/lib/config.rs +++ b/src/lib/config.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 LingCage +// SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 diff --git a/src/lib/kernel.rs b/src/lib/kernel.rs index acf9ef9..a364647 100644 --- a/src/lib/kernel.rs +++ b/src/lib/kernel.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 LingCage +// SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 diff --git a/src/lib/lib.rs b/src/lib/lib.rs index 9aeca7d..449a8f1 100644 --- a/src/lib/lib.rs +++ b/src/lib/lib.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 LingCage +// SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 diff --git a/src/lib/rootfs.rs b/src/lib/rootfs.rs index 9357da6..cab55ff 100644 --- a/src/lib/rootfs.rs +++ b/src/lib/rootfs.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 LingCage +// SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 diff --git a/src/lib/util.rs b/src/lib/util.rs index 2792f38..d24c4da 100644 --- a/src/lib/util.rs +++ b/src/lib/util.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 LingCage +// SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 diff --git a/src/main.rs b/src/main.rs index a0375fc..4d63da8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 LingCage +// SPDX-FileCopyrightText: Copyright (c) 2026 LingCage. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 From 13a7c55c8ba6638b3fe5196e16f27776c52586e3 Mon Sep 17 00:00:00 2001 From: Jiahao Wang Date: Tue, 21 Apr 2026 10:28:00 +0000 Subject: [PATCH 3/4] guest: disable network tests in run.sh Network tests (net-iperf3-tcp, net-iperf3-udp) are disabled, because they require a host-side server with bridge configuration that is not available in the current test environment. Signed-off-by: Jiahao Wang --- guest/rootfs/lingbench/run.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/guest/rootfs/lingbench/run.sh b/guest/rootfs/lingbench/run.sh index 14f0de5..b824790 100644 --- a/guest/rootfs/lingbench/run.sh +++ b/guest/rootfs/lingbench/run.sh @@ -38,9 +38,9 @@ block I/O (virtio-blk): io-randwrite fio 4k randwrite, iodepth 32, 10s io-seqread fio 1M seqread, iodepth 16, 10s -network (virtio-net, requires host-side server): - net-iperf3-tcp iperf3 TCP_STREAM for 10s - net-iperf3-udp iperf3 UDP_STREAM for 10s +network (DISABLED - requires host-side server + bridge config): +# net-iperf3-tcp iperf3 TCP_STREAM for 10s +# net-iperf3-udp iperf3 UDP_STREAM for 10s application: app-redis redis-benchmark against a local redis @@ -91,12 +91,12 @@ case "$scenario" in --direct=1 --runtime=10 --time_based --group_reporting ;; - net-iperf3-tcp) - iperf3 -c "${1:?host ip required}" -t 10 - ;; - net-iperf3-udp) - iperf3 -c "${1:?host ip required}" -u -b 0 -t 10 - ;; +# net-iperf3-tcp) +# iperf3 -c "${1:?host ip required}" -t 10 +# ;; +# net-iperf3-udp) +# iperf3 -c "${1:?host ip required}" -u -b 0 -t 10 +# ;; app-redis) redis-server --daemonize yes --save '' --logfile /tmp/redis.log From 302586fa5c2300d45218920d3a818185275bc319 Mon Sep 17 00:00:00 2001 From: Jiahao Wang Date: Tue, 21 Apr 2026 10:28:00 +0000 Subject: [PATCH 4/4] guest: add 'all' scenario to run all benchmarks Adds a new 'all' scenario that runs all available benchmarks (excluding network tests) in sequence. Signed-off-by: Jiahao Wang --- guest/rootfs/lingbench/run.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/guest/rootfs/lingbench/run.sh b/guest/rootfs/lingbench/run.sh index b824790..fb924a5 100644 --- a/guest/rootfs/lingbench/run.sh +++ b/guest/rootfs/lingbench/run.sh @@ -47,6 +47,10 @@ application: app-nginx wrk against a local nginx app-memcached memcached stats smoke test +all: + all run all scenarios above in sequence (excludes network tests) + + Any scenario can be prefixed with `time` externally; this script only runs the workload and writes its native output to stdout. EOF @@ -111,6 +115,17 @@ case "$scenario" in wrk -t2 -c64 -d10s http://127.0.0.1/ nginx -s stop 2>/dev/null || true ;; + all) + # Run all scenarios in sequence (excludes network tests) + for scenario in cpu-sysbench cpu-coremark cpu-stress mem-sysbench meminfo io-randread io-randwrite io-seqread app-redis app-nginx app-memcached; do + echo "" + echo "========================================" + echo "[LingBench] Running: $scenario" + echo "========================================" + sh "$0" "$scenario" + done + ;; + app-memcached) memcached -u nobody -d -P /tmp/memcached.pid sleep 0.2