Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gu <[email protected]>
  • Loading branch information
tylergu committed Nov 16, 2023
1 parent 053da18 commit 778766c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions performance_measurement/measure_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ def test_normal(
gen += 1


def generate_inputs(testrun_dir: str, input_generator: ChainInputs, config: OperatorConfig):
chain_inputs = input_generator(testrun_dir=testrun_dir, config=config)
os.makedirs(f"{testrun_dir}/inputs", exist_ok=True)
chain_inputs.serialize(f"{testrun_dir}/inputs")


def main(args):
input_generator: ChainInputs = None
condition_1_func: ConditionFuncType = None
Expand All @@ -134,10 +140,6 @@ def main(args):
del config["monkey_patch"]
config = OperatorConfig(**config)

chain_inputs = input_generator(testrun_dir=args.input_dir, config=config)
os.makedirs(f"{args.workdir_path}/inputs", exist_ok=True)
chain_inputs.serialize(f"{args.workdir_path}/inputs")

# Run the Anvil performance test
if "anvil" in args.phase:
anvil_workdir = f"{args.workdir_path}/anvil"
Expand Down
2 changes: 2 additions & 0 deletions performance_measurement/rabbitmq_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def serialize(self, output_dir: str):
reference_input_dir = os.path.join(output_dir, "reference")
os.makedirs(anvil_input_dir, exist_ok=True)
os.makedirs(reference_input_dir, exist_ok=True)
print(f"Serializing to {output_dir}")
prev_replicas = 3
for input in self.all_inputs:
print(f"{input['trial']}")
Expand All @@ -31,6 +32,7 @@ def serialize(self, output_dir: str):
del input["input"]["spec"]["claims"]
patch = jsonpatch.JsonPatch.from_diff(previous_input, input["input"])
if patch:
print(patch)
with open(os.path.join(anvil_input_dir, f'input-{index:03d}.yaml'), 'w') as f:
yaml.dump(input["input"], f)
with open(os.path.join(reference_input_dir, f'input-{index:03d}.yaml'), 'w') as f:
Expand Down

0 comments on commit 778766c

Please sign in to comment.