-
Notifications
You must be signed in to change notification settings - Fork 23
Add performance test using lima and iperf3 #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+106
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| images: | ||
| - location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" | ||
| arch: "x86_64" | ||
| - location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" | ||
| arch: "aarch64" | ||
| cpus: 2 | ||
| memory: "2g" | ||
| plain: true | ||
| networks: | ||
| - socket: /var/run/socket_vmnet | ||
| provision: | ||
| - mode: system | ||
| script: | | ||
| #!/bin/bash | ||
| set -eux -o pipefail | ||
| command -v ipref3 >/dev/null 2>&1 && exit 0 | ||
| export DEBIAN_FRONTEND=noninteractive | ||
| apt-get update | ||
| apt-get install -y iperf3 | ||
| probes: | ||
| - description: "iperf installed" | ||
| script: | | ||
| #!/bin/bash | ||
| set -eux -o pipefail | ||
| if ! timeout 30s bash -c "until command -v iperf3 >/dev/null 2>&1; do sleep 3; done"; then | ||
| echo >&2 "iperf3 is not installed yet" | ||
| exit 1 | ||
| fi | ||
| hint: | | ||
| See "/var/log/cloud-init-output.log" in the guest | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| cd "$(dirname "$0")" | ||
|
|
||
| TIME=${2:-30} | ||
|
|
||
| server_address() { | ||
| limactl shell server ip -j -4 addr show dev lima0 | jq -r '.[0].addr_info[0].local' | ||
| } | ||
|
|
||
| create() { | ||
| limactl create --name server --tty=false lima.yaml & | ||
| limactl create --name client --tty=false lima.yaml & | ||
| wait | ||
| } | ||
|
|
||
| host-to-vm() { | ||
| limactl start server | ||
| nohup limactl shell server iperf3 --server --daemon | ||
| iperf3-darwin --client $(server_address) --length 1m --time $TIME | ||
| limactl stop server | ||
| } | ||
|
|
||
| host-to-vm-2() { | ||
| limactl start server & | ||
| limactl start client & | ||
| wait | ||
| nohup limactl shell server iperf3 --server --daemon | ||
|
nirs marked this conversation as resolved.
|
||
| iperf3-darwin --client $(server_address) --length 1m --time $TIME | ||
| limactl stop server | ||
| limactl stop client | ||
| } | ||
|
|
||
| vm-to-vm() { | ||
| limactl start server & | ||
| limactl start client & | ||
| wait | ||
| nohup limactl shell server iperf3 --server --daemon | ||
| addr=$(server_address) | ||
| limactl shell client iperf3 --client $addr --length 1m --time $TIME | ||
| limactl stop server | ||
| limactl stop client | ||
| } | ||
|
|
||
| delete() { | ||
| limactl delete -f server | ||
| limactl delete -f client | ||
| } | ||
|
|
||
| case $1 in | ||
| create) | ||
| create | ||
| ;; | ||
| host-to-vm) | ||
| host-to-vm | ||
| ;; | ||
| host-to-vm-2) | ||
| host-to-vm-2 | ||
| ;; | ||
| vm-to-vm) | ||
| vm-to-vm | ||
| ;; | ||
| delete) | ||
| delete | ||
| ;; | ||
| *) | ||
| echo "Usage $0 command" | ||
| echo | ||
| echo "Available commands:" | ||
| echo " create create test vms" | ||
| echo " delete delete test vms" | ||
| echo " host-to-vm [TIME] test host to vm performance" | ||
| echo " host-to-vm-2 [TIME] test host to vm performance with 1 extra vm" | ||
| echo " vm-to-vm [TIME] test vm to vm performance" | ||
| ;; | ||
| esac | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.