Skip to content

Commit

Permalink
[87] Create tool to manage benchmark runs (#94)
Browse files Browse the repository at this point in the history
* Removed reference to digital ocean in run manager

* Minor changes to fly job template

* Fixed a tractor crash

* Removed debug

* Fix path to problem file

* Removed sneaky ;

* .

* Removed . from tractor run name in case that is the issue

* fix path to tractor alf file

* Made path to alf file absoulte

* .

* .

* Add back the ; because it wasn't sneaky it was maybe required

* .

* Remove debug
  • Loading branch information
erp12 committed Oct 18, 2017
1 parent 81f93b4 commit 6fc2f5f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 deletions.
9 changes: 3 additions & 6 deletions run_manager/conf.py
@@ -1,10 +1,7 @@

import os

# FLY
FLY_PYSHGP_PATH = '/home/erp12/pyshgp'
FLY_PYSHGP_PATH = os.getcwd()
FLY_JOB_TEMPLATE = FLY_PYSHGP_PATH + '/run_manager/fly-template.alf'
FLY_PYTHON_HOME = '/home/erp12/anaconda3/bin/python'
FLY_LOG_PATH = '/home/erp12/gp_runs/pyshgp'

# DIGITIAL OCEAN
# DO_TOKEN = os.environ['DO_TOKEN']
FLY_LOG_PATH = '/home/erp12/runs/pyshgp'
8 changes: 4 additions & 4 deletions run_manager/fly-template.alf
@@ -1,9 +1,9 @@
Job -title {job_name} -subtasks {{
Task -title {task_name} -cmds {{
RemoteCmd {{/bin/sh -c {{
echo "Starting Pysh Run"
cd {pyshgp_path};
{run_line}
}}}} -service {{linux}}
echo "Starting Pysh Run";
cd {pyshgp_path};
{run_line};
}}}} -service {{linux}}
}}
}}
21 changes: 11 additions & 10 deletions run_manager/fly.py
Expand Up @@ -24,8 +24,9 @@ def get_log_file(problem_file: str) -> str:

def get_python_call(problem_file: str) -> str:
# log = get_log_file(problem_file)
python_call = '{py} {file}'
return python_call.format(py=FLY_PYTHON_HOME, file=problem_file)
python_call = '{py} {pyshgp}/{file}'
return python_call.format(
py=FLY_PYTHON_HOME, pyshgp=FLY_PYSHGP_PATH, file=problem_file)


def start_fly_run(job_name: str, problem_file: str):
Expand All @@ -37,18 +38,18 @@ def start_fly_run(job_name: str, problem_file: str):
task_name=job_name,
pyshgp_path=FLY_PYSHGP_PATH,
run_line=run_line)
with open('pysh_job.alf', 'w') as f:
with open('run_manager/pysh_job.alf', 'w') as f:
f.write(job_cmd)
os.system(' '.join([
'/opt/pixar/tractor-blade-1.7.2/python/bin/python2.6',
'/opt/pixar/tractor-blade-1.7.2/tractor-spool.py',
'--engine=fly:8000',
'pysh_job.alf'
]))
os.system(' '.join(
['/opt/pixar/tractor-blade-1.7.2/python/bin/python2.6',
'/opt/pixar/tractor-blade-1.7.2/tractor-spool.py',
'--engine=fly:8000',
FLY_PYSHGP_PATH + '/run_manager/pysh_job.alf']))


def start_n_fly_runs(problem_file, n_runs):
problem_name = problem_file.split('/')[-1]
problem_filename = problem_file.split('/')[-1]
problem_name = problem_filename.split('.')[0]
batch_hash = str(uuid.uuid4())[:8]
for i in range(n_runs):
job_name = 'pyshgp_{prob}_{n}_{hash}'.format(
Expand Down
10 changes: 1 addition & 9 deletions run_manager/run_manager.py
Expand Up @@ -5,11 +5,6 @@

def get_cli_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'machine',
type=str,
choices=['fly', 'digital_ocean']
)
parser.add_argument(
'file',
type=str,
Expand All @@ -25,7 +20,4 @@ def get_cli_args():
if __name__ == "__main__":
cli_args = get_cli_args()

if cli_args.machine == 'fly':
start_n_fly_runs(cli_args.file, cli_args.n)
# elif cli_args.machine == 'digital_ocean':
# start_n_DO_runs(cli_args.file, cli_args.n)
start_n_fly_runs(cli_args.file, cli_args.n)

0 comments on commit 6fc2f5f

Please sign in to comment.