From 4bec653fe9c404b09d30882283541ea18b8b6fc2 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 15 Sep 2022 18:04:37 +0200 Subject: Add warp --- scenarios/fragments/warp.py | 11 +++++++++++ scenarios/garage-warp | 32 ++++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/scenarios/fragments/warp.py b/scenarios/fragments/warp.py index e69de29..bf3f4d6 100644 --- a/scenarios/fragments/warp.py +++ b/scenarios/fragments/warp.py @@ -0,0 +1,11 @@ +import os +from os.path import exists +from pathlib import Path +from fragments import shared, garage + +warp_bin = Path(os.path.dirname(__file__)) / "../../benchmarks/warp/warp" + +def on_garage(params="mixed"): + shared.log(f"launching warp {warp_bin}") + shared.exec(f"{warp_bin} {params} --host={os.environ['IP']}:3900 --access-key={garage.key.access_key_id} --secret-key={garage.key.secret_access_key}") + shared.log(f"execution done") diff --git a/scenarios/garage-warp b/scenarios/garage-warp index 0f00580..6b7bbc1 100755 --- a/scenarios/garage-warp +++ b/scenarios/garage-warp @@ -1,13 +1,33 @@ #!/usr/bin/env python3 from fragments import garage, warp, shared +import sys +garage_version_flavor = { + "garage-v0.7": "v0.7.3", + "garage-v0.8": "89b8087ba81c508ba382aa6c9cb6bb3afa6a43c8" +} +garage_version = garage_version_flavor["garage-v0.7"] +warp_bench_flavor = { + "warp-fast": "mixed --obj.size 5M --objects 200 --duration=1m", + "warp-default": "mixed" +} +warp_bench = warp_bench_flavor["warp-fast"] -if shared.id() == 1: - garage.deploy_coord() - warp.on_garage() - garage.delete_key() - garage.destroy() -else +for flavor in sys.argv[1:]: + if flavor in garage_version_flavor: + garage_version = garage_version_flavor[flavor] + if flavor in warp_bench_flavor: + warp_bench = warp_bench_flavor[flavor] +if shared.id() == 1: + garage.deploy_coord(version=garage_version) + warp.on_garage(params=warp_bench) + garage.delete_key() + garage.destroy() +else: + garage.deploy_follow(version=garage_version) + garage.sync_on_key_down() + garage.destroy() +shared.log("bye") -- cgit v1.2.3