-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this ukbench script measures the peak RSS of an OSv unikernel for Firecracker and QEMU (helloworld). Signed-off-by: Hugo Lefeuvre <hugo.lefeuvre@manchester.ac.uk>
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,26 @@ | ||
diff --git a/scripts/firecracker.py b/scripts/firecracker.py | ||
index d0b24071..b26f6cd7 100755 | ||
--- a/scripts/firecracker.py | ||
+++ b/scripts/firecracker.py | ||
@@ -237,7 +237,7 @@ def start_firecracker_with_no_api(firecracker_path, firecracker_config_json): | ||
api_file.write(bytes(firecracker_config_json, 'utf-8')) | ||
api_file.flush() | ||
stty_save() | ||
- return subprocess.Popen([firecracker_path, "--no-api", "--config-file", api_file.name], | ||
+ return subprocess.Popen(['/usr/bin/time', '-f', 'Firecracker maxRSS: %M', firecracker_path, "--no-api", "--config-file", api_file.name], | ||
stdout=sys.stdout, stderr=subprocess.STDOUT), api_file.name | ||
|
||
|
||
diff --git a/scripts/run.py b/scripts/run.py | ||
index c7464bda..d9cdbeaf 100755 | ||
--- a/scripts/run.py | ||
+++ b/scripts/run.py | ||
@@ -272,7 +272,7 @@ def start_osv_qemu(options): | ||
|
||
qemu_env['OSV_BRIDGE'] = options.bridge | ||
qemu_path = options.qemu_path or ('qemu-system-%s' % options.arch) | ||
- cmdline = [qemu_path] + args | ||
+ cmdline = ['/usr/bin/time', '-f', 'QEMU maxRSS: %M', qemu_path] + args | ||
if options.dry_run: | ||
print(format_args(cmdline)) | ||
else: |
This file contains 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,46 @@ | ||
params: | ||
- name: TEST | ||
type: string | ||
only: ["Hello"] | ||
|
||
inputs: | ||
- source: osv-memusage.patch | ||
destination: /root/osv-memusage.patch | ||
- source: /etc/resolv.conf | ||
destination: /etc/resolv.conf | ||
- source: /etc/environment | ||
destination: /etc/environment | ||
|
||
outputs: | ||
- path: /results.txt | ||
|
||
runs: | ||
- name: run | ||
image: hlefeuvre/osv | ||
cores: 1 | ||
devices: | ||
- /dev/kvm | ||
- /dev/net/tun | ||
capabilities: | ||
- CAP_NET_ADMIN | ||
cmd: | ||
| | ||
set -xe | ||
for env in $( cat /etc/environment ); do \ | ||
export $(echo $env | sed -e 's/"//g'); \ | ||
done | ||
|
||
env | ||
|
||
touch /results.txt | ||
|
||
apt update && apt install -y time | ||
|
||
cd /root/osv/ | ||
git apply --ignore-space-change /root/osv-memusage.patch | ||
|
||
script -c '/root/osv/scripts/run.py' -f /tmp/out | ||
cat /tmp/out | grep "QEMU maxRSS: " >> /results.txt | ||
script -c '/root/osv/scripts/firecracker.py' -f /tmp/out | ||
cat /tmp/out | grep "Firecracker maxRSS: " >> /results.txt |