Skip to content

Commit

Permalink
pipe outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
carneiro-cw committed Dec 3, 2024
1 parent f83bacf commit c88e809
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions utils/benchmark_rocks_config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def run_migration():
process = subprocess.run(

Check warning on line 23 in utils/benchmark_rocks_config/main.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

utils/benchmark_rocks_config/main.py#L23

Starting a process with a partial executable path

Check warning on line 23 in utils/benchmark_rocks_config/main.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

utils/benchmark_rocks_config/main.py#L23

subprocess call - check for execution of untrusted input.
["cargo", "run", "--release", "--bin", "rocks_migration", "--", "../../old_data/rocksdb", "../../data/rocksdb"],
env=dict(os.environ, RUST_LOG="info"),
check=True
check=True,
stdout=open("migration.log", "w")
)
print("Migration completed")

Expand All @@ -32,7 +33,8 @@ def run_stratus():
process = subprocess.Popen(

Check warning on line 33 in utils/benchmark_rocks_config/main.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

utils/benchmark_rocks_config/main.py#L33

Starting a process with a partial executable path

Check warning on line 33 in utils/benchmark_rocks_config/main.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

utils/benchmark_rocks_config/main.py#L33

subprocess call - check for execution of untrusted input.
["cargo", "run", "--release", "--bin", "stratus", "--", "--leader"],
preexec_fn=os.setsid, # Creates a new process group,
cwd="../../"
cwd="../../",
stdout=open("stratus.log", "w"),
)
print("Started stratus")
# Give it some time to start up
Expand Down Expand Up @@ -83,7 +85,7 @@ def wait_for_benchmark():

time.sleep(10) # Poll every 10 seconds

Check failure on line 86 in utils/benchmark_rocks_config/main.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

utils/benchmark_rocks_config/main.py#L86

time.sleep() call; did you mean to leave this in?

def save_results(config_file, results):
def save_results(config_file: Path, results):
"""Save the results and config to a new directory"""
# Create unique directory name based on timestamp
timestamp = time.strftime("%Y%m%d_%H%M%S")
Expand Down

0 comments on commit c88e809

Please sign in to comment.