memgraph/tests/distributed/card_fraud/apollo_runs.py
Matej Ferencevic 2924746f20 Remove PostgreSQL
Reviewers: buda, teon.banek

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1326
2018-03-28 15:38:54 +02:00

45 lines
1.4 KiB
Python
Executable File

#!/usr/bin/env python3
import json
import os
import re
import subprocess
from card_fraud import NUM_MACHINES, BINARIES
# paths
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
WORKSPACE_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, "..", "..", "..", ".."))
OUTPUT_DIR_REL = os.path.join(os.path.relpath(SCRIPT_DIR, WORKSPACE_DIR), "output")
# generate runs
runs = []
binaries = list(map(lambda x: os.path.join("..", "..", "build_release", x), BINARIES))
for i in range(NUM_MACHINES):
name = "master" if i == 0 else "worker" + str(i)
additional = ["master.py"] if i == 0 else []
outfile_paths = ["\\./" + OUTPUT_DIR_REL + "/.+"] if i == 0 else []
if i == 0:
cmd = "master.py --machines-num {0} --test-suite card_fraud " \
"--test card_fraud".format(NUM_MACHINES)
else:
cmd = "jail_service.py"
runs.append({
"name": "distributed__card_fraud__" + name,
"cd": "..",
"supervisor": cmd,
"infiles": binaries + [
"common.py",
"jail_service.py",
"card_fraud/card_fraud.py",
"card_fraud/snapshots/worker_" + str(i),
] + additional,
"outfile_paths": outfile_paths,
"parallel_run": "distributed__card_fraud",
"slave_group": "remote_4c32g",
"enable_network": True,
})
print(json.dumps(runs, indent=4, sort_keys=True))