Commit 75ec9678 authored by gerald2545's avatar gerald2545
Browse files

correct mem getter

add ssl config to jflow if set in application.properties
parent 4ff8e152
......@@ -32,6 +32,10 @@ server_socket_port = 8080
date_format = %d/%m/%Y
# debug
debug = False
#optional : key for jflow server ssl configuration
ssl_certificate = certificate.crt
ssl_certificate_chain = certificate_chain.crt
ssl_private_key = private_key.key
[email]
# if you want an email to be sent at the end of the workflow execution
......
......@@ -63,6 +63,7 @@ class Component(object):
# in case of SGE, parse the cpu and memory parameter
self.__cpu=None
self.__memory=None
self.__memory_per_cpu=None
type, options, limit_submission = self.config_reader.get_batch()
if type.lower() == "sge" :
try:
......@@ -80,11 +81,15 @@ class Component(object):
except: pass
elif type.lower() == "slurm" :
try:
self.__cpu = int(re.match( r'.*-c\s+(\w+)\s+(\d+)\s?.*', self.batch_options).group(2))
self.__cpu = int(re.match( r'.*-c\s+(\d+).*', self.batch_options).group(1))
except: pass
try:
self.__memory = re.match( r'.*--mem=(\d+\S+)\s?.*', self.batch_options).group(1)
except: pass
try:
self.__memory_per_cpu = re.match( r'.*--mem-per-cpu=(\d+\S+)\s?.*', self.batch_options).group(1)
except: pass
def get_prefix(self):
return self.__prefix
......@@ -99,6 +104,9 @@ class Component(object):
def get_memory(self):
return self.__memory
def get_memory_per_cpu(self):
return self.__memory_per_cpu
def is_dynamic(self):
return len(self.get_dynamic_outputs()) != 0
......
......@@ -115,7 +115,12 @@ class JFlowConfigReader(object):
return [self.reader.get("global", "server_socket_host"), int(self.reader.get("global", "server_socket_port"))]
except:
return ["127.0.0.1", 8080]
def get_ssl_files(self):
try:
return [self.reader.get("global", "ssl_certificate"), self.reader.get("global", "ssl_certificate_chain"),self.reader.get("global", "ssl_private_key")]
except:
return []
def get_email_options(self):
try: smtps = self.reader.get("email", "smtp_server")
except: smtps = None
......
......@@ -162,6 +162,12 @@ class JFlowServer (object):
cherrypy.config.update({'server.socket_host': socket_opts[0],
'server.socket_port': socket_opts[1]})
if len(ssl_opts)==3:
cherrypy.config.update({'server.ssl_module': 'builtin',
'server.ssl_certificate': ssl_opts[0],
'server.ssl_certificate_chain': ssl_opts[1],
'server.ssl_private_key': ssl_opts[2]})
# start the server
cherrypy.quickstart(server_class(), config=config)
......
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