Commit 5a60f8f1 authored by Alain Takoudjou's avatar Alain Takoudjou

Merge branch 'slaprunner-paas' into slaprunner-layout

Conflicts:
	slapos/runner/static/js/scripts/process.js
	slapos/runner/utils.py
parents 47997b66 34b80fc2
......@@ -35,7 +35,10 @@ import sys
import time
import traceback
from erp5.util import taskdistribution
from erp5.util.testnode import Utils
try:
from erp5.util.testnode import Utils
except ImportError:
pass
def importFrom(name):
"""
......
......@@ -48,7 +48,7 @@ class Config:
"""
Set options given by parameters.
"""
self.configuration_file_path = os.path.abspath(os.environ.get('CONFIG_FILE_PATH'))
self.configuration_file_path = os.path.abspath(os.environ.get('RUNNER_CONFIG'))
# Load configuration file
configuration_parser = ConfigParser.SafeConfigParser()
......
......@@ -130,7 +130,7 @@ function bindRun() {
} else {
if (!isRunning()) {
setCookie("slapgridCMD", "Software");
window.location.href = $SCRIPT_ROOT + "/viewLog";
window.location.href = $SCRIPT_ROOT + "/viewLog?logfile=software.log";
}
}
return false;
......@@ -142,7 +142,7 @@ function bindRun() {
if (!isRunning()) {
setCookie("slapgridCMD", "Instance");
if (window.location.pathname === "/viewLog")
window.location.href = $SCRIPT_ROOT + "/viewLog";
window.location.href = $SCRIPT_ROOT + "/viewLog?logfile=instance.log";
}
}
return false;
......@@ -166,6 +166,8 @@ function updateStatus(elt, val) {
break;
case "running":
$(src).children('p').text("Processing");
processType = elt;
getRunningState()
break;
}
// in case of failure
......@@ -251,7 +253,7 @@ function runProcess(urlfor, data) {
}
}
setInterval('GetStateRegularly()', 800);
setInterval('GetStateRegularly()', 5000);
function GetStateRegularly() {
getRunningState();
}
......
......@@ -263,7 +263,7 @@ def removeProxyDb(config):
def isSoftwareRunning(config=None):
"""
Return True if slapos is still running and false if slapgrid if not
Return True if slapos is still running and false if slapos if not
"""
# XXX-Marco what is 'config' for?
return isRunning('slapos')
......@@ -282,13 +282,15 @@ def runSoftwareWithLock(config, lock=True):
os.mkdir(config['software_root'])
stopProxy(config)
startProxy(config)
logfile = open(config['software_log'], 'w')
# XXX Hackish and unreliable
if os.path.exists(config['software_log']):
os.remove(config['software_log'])
if not updateProxy(config):
return False
slapgrid = Popen([config['slapos'], 'node', 'software', '--all',
'--cfg', config['slapos_cfg'], '--pidfile', slapgrid_pid,
'--verbose', '--logfile', config['software_log']],
stdout=logfile, name='slapos')
name='slapgrid-sr')
if lock:
slapgrid.wait()
#Saves the current compile software for re-use
......@@ -370,13 +372,15 @@ def runInstanceWithLock(config, lock=True):
slapgrid_pid = os.path.join(config['run_dir'], 'slapgrid-cp.pid')
startProxy(config)
logfile = open(config['instance_log'], 'w')
# XXX Hackish and unreliable
if os.path.exists(config['instance_log']):
os.remove(config['instance_log'])
if not (updateProxy(config) and requestInstance(config)):
return False
slapgrid = Popen([config['slapos'], 'node', 'instance', '--all',
'--cfg', config['slapos_cfg'], '--pidfile', slapgrid_pid,
'--verbose', '--logfile', config['instance_log']],
stdout=logfile, name='slapos')
name='slapgrid-cp')
if lock:
slapgrid.wait()
return ( True if slapgrid.returncode == 0 else False )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment