diff options
Diffstat (limited to 'scenarios')
-rwxr-xr-x | scenarios/clean | 2 | ||||
-rw-r--r-- | scenarios/fragments/garage.py | 7 | ||||
-rw-r--r-- | scenarios/fragments/s3concurrent.py | 4 | ||||
-rwxr-xr-x | scenarios/garage-s3concurrent | 8 |
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) |