|
@@ -4,30 +4,31 @@ import multiprocessing
|
|
import os
|
|
import os
|
|
|
|
|
|
home = os.path.expanduser('~')
|
|
home = os.path.expanduser('~')
|
|
|
|
+pyramid_dir = home + "/FrameworkBenchmarks/pyramid"
|
|
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py3/bin')
|
|
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py3/bin')
|
|
NCPU = multiprocessing.cpu_count()
|
|
NCPU = multiprocessing.cpu_count()
|
|
|
|
|
|
proc = None
|
|
proc = None
|
|
|
|
|
|
|
|
|
|
-def start(args):
|
|
|
|
|
|
+def start(args, logfile, errfile):
|
|
global proc
|
|
global proc
|
|
setup_util.replace_text(
|
|
setup_util.replace_text(
|
|
- "frameworkbenchmarks/models.py",
|
|
|
|
|
|
+ pyramid_dir + "/frameworkbenchmarks/models.py",
|
|
"DBHOSTNAME = 'localhost'",
|
|
"DBHOSTNAME = 'localhost'",
|
|
"DBHOSTNAME = '%s'" % args.database_host
|
|
"DBHOSTNAME = '%s'" % args.database_host
|
|
)
|
|
)
|
|
- subprocess.call(bin_dir + '/pip install -e .', cwd='pyramid', shell=True)
|
|
|
|
|
|
+ subprocess.call(bin_dir + '/pip install -e .', cwd='pyramid', shell=True, stderr=errfile, stdout=logfile)
|
|
proc = subprocess.Popen([
|
|
proc = subprocess.Popen([
|
|
bin_dir + '/gunicorn',
|
|
bin_dir + '/gunicorn',
|
|
'wsgi:app',
|
|
'wsgi:app',
|
|
'-b', "0.0.0.0:6543",
|
|
'-b', "0.0.0.0:6543",
|
|
'-w', str(NCPU*3)],
|
|
'-w', str(NCPU*3)],
|
|
- cwd='pyramid'
|
|
|
|
|
|
+ cwd='pyramid', stderr=errfile, stdout=logfile
|
|
)
|
|
)
|
|
return 0
|
|
return 0
|
|
|
|
|
|
-def stop():
|
|
|
|
|
|
+def stop(logfile, errfile):
|
|
global proc
|
|
global proc
|
|
if proc is not None:
|
|
if proc is not None:
|
|
proc.terminate()
|
|
proc.terminate()
|