Skip to content

modifying to update the readme and extend test loop - #70

Merged
danbugs merged 1 commit into
hyperlight-dev:mainfrom
squillace:main
May 17, 2026
Merged

modifying to update the readme and extend test loop#70
danbugs merged 1 commit into
hyperlight-dev:mainfrom
squillace:main

Conversation

@squillace

@squillace squillace commented May 17, 2026

Copy link
Copy Markdown
Contributor

Update all example repeat loops to 10 iterations for clearer performance comparisons, point README at upstream kraftkit plat-hyperlight branch, and add cross-platform test scripts.

  • Update all example Justfiles from run-5/--repeat 4 to run-10/--repeat 9
  • Update README to clone from unikraft/kraftkit on the plat-hyperlight branch
  • Add scripts/test-examples.sh (Linux) and scripts/test-examples.ps1 (Windows) to run one example per language (C, Rust, Go, .NET, PowerShell, Shell, Python) with timing

Copilot AI review requested due to automatic review settings May 17, 2026 14:23
@squillace
squillace requested a review from danbugs May 17, 2026 14:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the example “repeat” loops (snapshot/restore runs) to 10 iterations for clearer performance comparisons, refreshes the README to point at the upstream plat-hyperlight branch, and adds a helper script to run all examples and capture timings.

Changes:

  • Update multiple example Justfiles from run-5/--repeat 4 to run-10/--repeat 9.
  • Update README instructions to clone unikraft/kraftkit on the plat-hyperlight branch.
  • Add examples/run-all-examples.sh to build/rootfs/run each example and write a summary.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
README.md Points kraftkit clone instructions at upstream unikraft/kraftkit plat-hyperlight branch.
examples/shell/Justfile Changes repeated run target to run-10 / --repeat 9.
examples/rust/Justfile Changes repeated run target to run-10 / --repeat 9 (but leaves a mismatched usage comment).
examples/python/Justfile Changes repeated run target to run-10 / --repeat 9.
examples/python-tools/Justfile Changes repeated run target to run-10 / --repeat 9.
examples/powershell/Justfile Changes repeated run target to run-10 / --repeat 9.
examples/nodejs/Justfile Changes repeated run target to run-10 / --repeat 9.
examples/go/Justfile Changes repeated run target to run-10 / --repeat 9.
examples/dotnet/Justfile Renames repeated run target to run-10 / --repeat 9 (comment still says “Run 5 times”).
examples/dotnet-nativeaot/Justfile Renames repeated run target to run-10 / --repeat 9 (comment still says “Run 5 times”).
examples/run-all-examples.sh New script to run all examples and summarize timings (currently has repeat-target mismatches and failure-handling issues).
Comments suppressed due to low confidence (1)

examples/run-all-examples.sh:114

  • Failures from run_example are not captured, and the script unconditionally prints "ALL DONE" at the end with a zero exit status. This can hide build/rootfs failures (and any run failures) when the script is used in automation. Track a global failure flag and exit non-zero if any example fails, and consider adjusting the final message to reflect partial failures.
# Examples with their repeat commands (from each Justfile)
run_example "helloworld-c"      "run-5"
run_example "rust"              "run-5"
run_example "go"                "run-10"
run_example "shell"             "run-5"
run_example "python"            "run-10"
run_example "python-tools"      "run-10"
run_example "nodejs"            "run-10"
run_example "dotnet"            "run-10"
run_example "dotnet-nativeaot"  "run-10"
run_example "powershell"        "run-10"
run_example "hostfs-posix-c"    "run-5"
run_example "hostfs-posix-py"   "run-5"
run_example "multifn-c"         ""
run_example "python-agent"      ""
run_example "networking-py"     "run-get"

echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | tee -a "$SUMMARY"
echo "✅ ALL DONE — $(date)" | tee -a "$SUMMARY"
echo "Per-example logs: results-<name>.txt"
echo "Summary: $SUMMARY"


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/rust/Justfile Outdated
#
# just run - Run once
# just run-5 - Run 5x (snapshot/restore)
# just run-5 - Run 10x (snapshot/restore)
Comment thread examples/dotnet/Justfile
Comment on lines 21 to +24

# Run 5 times via snapshot/restore
run-5:
hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 4 --memory {{memory}}
run-10:
hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 9 --memory {{memory}}
Comment on lines 21 to +24

# Run 5 times via snapshot/restore
run-5:
hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 4 --memory {{memory}}
run-10:
hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 9 --memory {{memory}}
Comment thread examples/run-all-examples.sh Outdated
Comment on lines +95 to +97
run_example "rust" "run-5"
run_example "go" "run-10"
run_example "shell" "run-5"
Comment thread examples/run-all-examples.sh Outdated
echo "▶ $name" | tee -a "$SUMMARY"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | tee -a "$SUMMARY"

cd "$SCRIPT_DIR/$name"
Comment thread examples/run-all-examples.sh Outdated
Comment on lines +28 to +35
# Build
printf " [build] running... "
local t0=$(date +%s%N)
just build < /dev/null > "$outfile" 2>&1
local rc=$?
local t1=$(date +%s%N)
local build_ms=$(( (t1 - t0) / 1000000 ))
if [ $rc -eq 0 ]; then
@danbugs

danbugs commented May 17, 2026

Copy link
Copy Markdown
Contributor

Pushed updates addressing copilot feedback and restructuring the scripts:

Justfile fixes (all examples):

  • Updated all examples to run-10 / --repeat 9 (including helloworld-c, hostfs-posix-c, hostfs-posix-py which were still on run-5)
  • Fixed stale comments in rust/Justfile (run-5run-10), dotnet/Justfile and dotnet-nativeaot/Justfile ("Run 5 times" → "Run 10 times")

Scripts restructured:

  • Removed examples/run-all-examples.sh
  • Added scripts/test-examples.sh (Linux) and scripts/test-examples.ps1 (Windows) — cross-platform equivalents
  • Scripts run one example per language (C, Rust, Go, .NET, PowerShell, Shell, Python) with per-step timing and failure tracking

Squashed into a single commit to keep history clean.

Signed-off-by: ralph squillace <ralph@squillace.com>
Signed-off-by: Danilo Chiarlone <danbugs@gmail.com>
@danbugs
danbugs merged commit c538c48 into hyperlight-dev:main May 17, 2026
74 of 76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants