aboutsummaryrefslogtreecommitdiff
path: root/scenarios
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-09-19 14:16:08 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-09-19 14:16:08 +0200
commit549c548e7cc8f99da37b931b6aa991093f097fd7 (patch)
tree732b76f19b20a667ccb00119d7a34f8db674fcef /scenarios
parentbd6a1253999e05fb77fe74e51ddfea507b5d7361 (diff)
downloadmknet-549c548e7cc8f99da37b931b6aa991093f097fd7.tar.gz
mknet-549c548e7cc8f99da37b931b6aa991093f097fd7.zip
Commit WIP
Diffstat (limited to 'scenarios')
-rwxr-xr-xscenarios/clean2
-rw-r--r--scenarios/fragments/garage.py7
-rw-r--r--scenarios/fragments/s3concurrent.py4
-rwxr-xr-xscenarios/garage-s3concurrent8
4 files changed, 13 insertions, 8 deletions
diff --git a/scenarios/clean b/scenarios/clean
index 325edec..9d23543 100755
--- a/scenarios/clean
+++ b/scenarios/clean
@@ -4,5 +4,7 @@ import os
from fragments import garage, shared
garage.destroy()
+if len(shared.storage_path) > 8 and shared.id() == 1:
+ shared.exec(f"rm -r {shared.storage_path}")
shared.log("clean done")
diff --git a/scenarios/fragments/garage.py b/scenarios/fragments/garage.py
index c1e09d0..8699655 100644
--- a/scenarios/fragments/garage.py
+++ b/scenarios/fragments/garage.py
@@ -120,11 +120,13 @@ _cluster_info = None
def cluster_info():
global _cluster_info
if _cluster_info is not None: return _cluster_info
+ shared.log("fetch cluster info")
while True:
- time.sleep(1)
node_files = glob.glob(f"{shared.storage_path}/**/node_info", recursive=True)
- if len(node_files) == shared.count(): break
+ if len(node_files) >= shared.count(): break
+ shared.log(f"found {len(node_files)} over {shared.count()}, wait 1 sec.")
+ time.sleep(1)
_cluster_info = [ json.loads(Path(f).read_text()) for f in node_files ]
return _cluster_info
@@ -132,6 +134,7 @@ def cluster_info():
def connect():
cinf = cluster_info()
+ shared.log("start connections...")
ret = nodes.add_node([n['node_addr'] for n in cinf])
for st in ret:
if not st.success:
diff --git a/scenarios/fragments/s3concurrent.py b/scenarios/fragments/s3concurrent.py
index 1431e0b..f1cb96d 100644
--- a/scenarios/fragments/s3concurrent.py
+++ b/scenarios/fragments/s3concurrent.py
@@ -3,7 +3,7 @@ from os.path import exists
from pathlib import Path
from fragments import shared, garage
-s3bin = Path(os.path.dirname(__file__)) / "../../benchmarks/s3lat/s3lat"
+s3bin = Path(os.path.dirname(__file__)) / "../../benchmarks/s3concurrent/s3concurrent"
def on_garage():
os.environ['AWS_ACCESS_KEY_ID'] = garage.key.access_key_id
@@ -11,6 +11,6 @@ def on_garage():
os.environ['ENDPOINT'] = "localhost:3900"
out = Path(shared.storage_path) / "s3concurrent.csv"
- shared.log(f"launching s3lat ({s3bin})")
+ shared.log(f"launching s3concurrent ({s3bin})")
shared.exec(f"{s3bin} > {out}")
shared.log(f"execution done, output written to {out}")
diff --git a/scenarios/garage-s3concurrent b/scenarios/garage-s3concurrent
index 5aaa4f4..f2b7128 100755
--- a/scenarios/garage-s3concurrent
+++ b/scenarios/garage-s3concurrent
@@ -1,10 +1,10 @@
#!/usr/bin/env python3
-from fragments import garage, s3concurrent, shared
+from fragments import garage, s3concurrent, shared, flavor
import sys
-for flavor in sys.argv[1:]:
- if flavor in garage.version_flavor:
- garage.version = garage.version_flavor[flavor]
+for fl in sys.argv[1:]:
+ if fl in flavor.garage:
+ garage.version = flavor.garage[fl]
if shared.id() == 1:
garage.deploy_coord(version=garage.version)