Runtime core container settings come from manifest
import docker
import fnmatch
+import json
import requests
import shlex
@@ -220,14 +221,15 @@ class PluginHelper:
chdir(cwd)
# set docker settings for container
- vent_template = Template(template_path)
- status = vent_template.section('docker')
+ manifest = Template(self.manifest)
+ status = manifest.option(section, 'docker')
self.logger.info(status)
tool_d[c_name] = {'image': image_name,
'name': c_name}
if status[0]:
- for option in status[1]:
- options = option[1]
+ options_dict = json.loads(status[1])
+ for option in options_dict:
+ options = options_dict[option]
# check for commands to evaluate
if '`' in options:
cmds = options.split('`')
@@ -244,20 +246,21 @@ class PluginHelper:
options = "".join(cmds)
# store options set for docker
try:
- tool_d[c_name][option[0]] = literal_eval(options)
+ tool_d[c_name][option] = literal_eval(options)
except Exception as e: # pragma: no cover
self.logger.error("unable to store the options set for docker: " + str(e))
- tool_d[c_name][option[0]] = options
+ tool_d[c_name][option] = options
if 'labels' not in tool_d[c_name]:
tool_d[c_name]['labels'] = {}
# get the service uri info
- status = vent_template.section('service')
+ status = manifest.option(section, 'service')
self.logger.info(status)
if status[0]:
- for option in status[1]:
- tool_d[c_name]['labels'][option[0]] = option[1]
+ options_dict = json.loads(status[1])
+ for option in options_dict:
+ tool_d[c_name]['labels'][option] = options_dict[option]
# get network mappings
if 'network_mode' in tool_d[c_name]:
@@ -265,11 +268,12 @@ class PluginHelper:
pass
# check for gpu settings
- status = vent_template.section('gpu')
+ status = manifest.option(section, 'gpu')
self.logger.info(status)
if status[0]:
- for option in status[1]:
- tool_d[c_name]['labels']['gpu.'+option[0]] = option[1]
+ options_dict = json.loads(status[1])
+ for option in options_dict:
+ tool_d[c_name]['labels']['gpu.'+option] = options_dict[option]
# get temporary name for links, etc.
plugin_c = Template(template=self.manifest)
@@ -324,12 +328,13 @@ class PluginHelper:
tool_d[c_name]['log_config'] = log_config
# add label for priority
- status = vent_template.section('settings')
+ status = manifest.option(section, 'settings')
self.logger.info(status)
if status[0]:
- for option in status[1]:
- if option[0] == 'priority':
- tool_d[c_name]['labels']['vent.priority'] = option[1]
+ options_dict = json.loads(status[1])
+ for option in options_dict:
+ if option == 'priority':
+ tool_d[c_name]['labels']['vent.priority'] = options_dict[option]
# only start tools that have been built
if s[section]['built'] != 'yes':
