From 0dc16e5e8071adb7599c7b2fd357206e50d35cde Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 23 Sep 2022 23:20:10 +0200 Subject: [PATCH] Support minio warp --- scenarios/fragments/warp.py | 11 ++++++++--- scenarios/garage-warp | 2 +- scenarios/minio-warp | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100755 scenarios/minio-warp diff --git a/scenarios/fragments/warp.py b/scenarios/fragments/warp.py index 0c5acc8..553645d 100644 --- a/scenarios/fragments/warp.py +++ b/scenarios/fragments/warp.py @@ -1,12 +1,17 @@ import os from os.path import exists from pathlib import Path -from fragments import shared, garage, flavor +from fragments import shared, garage, flavor, minio warp_bin = Path(os.path.dirname(__file__)) / "../../benchmarks/warp/warp" bench = flavor.warp["warp-fast"] -def on_garage(params="mixed"): +def common(port, ak, sk): + out = Path(shared.storage_path) / "warp.csv" 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.exec(f"{warp_bin} {bench} --host=[{os.environ['IP']}]:{port} --analyze.out={out} --access-key={ak} --secret-key={sk}") shared.log(f"execution done") + +def on_garage(): common(3900, garage.key.access_key_id, garage.key.secret_access_key) +def on_minio(): common(9000, minio.access_key, minio.secret_key) + diff --git a/scenarios/garage-warp b/scenarios/garage-warp index 6fd689f..d099e3a 100755 --- a/scenarios/garage-warp +++ b/scenarios/garage-warp @@ -10,7 +10,7 @@ for fl in sys.argv[1:]: if shared.id() == 1: garage.deploy_coord() - warp.on_garage(params=warp.bench) + warp.on_garage() garage.delete_key() garage.destroy() else: diff --git a/scenarios/minio-warp b/scenarios/minio-warp new file mode 100755 index 0000000..9fcc32f --- /dev/null +++ b/scenarios/minio-warp @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +from fragments import minio, warp, shared, flavor +import sys + +for fl in sys.argv[1:]: + if fl in flavor.minio: + minio.version = flavor.minio[fl] + if fl in flavor.warp: + warp.bench = flavor.warp[fl] + +if shared.id() == 1: + minio.deploy_coord() + warp.on_minio() + minio.delete_sync_bucket() + minio.destroy() +else: + minio.deploy_follow() + minio.sync_on_bucket_down() + minio.destroy() +shared.log("bye")