Commit 0e544151 authored by Philip ABBET's avatar Philip ABBET
Browse files

Change the way volumes are mounted into docker images

parent 25f9ba9c
Pipeline #12115 failed with stage
in 14 minutes and 12 seconds
...@@ -306,37 +306,42 @@ class Agent(object): ...@@ -306,37 +306,42 @@ class Agent(object):
volumes = {} volumes = {}
if not configuration.proxy_mode: if not configuration.proxy_mode:
for name, details in configuration.data['inputs'].items(): volumes[configuration.cache] = {
if 'database' in details: 'bind': '/cache',
continue 'mode': 'rw',
}
basename = os.path.join(configuration.cache, details['path'])
filenames = glob.glob(basename + '*.data') # for name, details in configuration.data['inputs'].items():
filenames.extend(glob.glob(basename + '*.data.checksum')) # if 'database' in details:
filenames.extend(glob.glob(basename + '*.data.index')) # continue
filenames.extend(glob.glob(basename + '*.data.index.checksum')) #
# basename = os.path.join(configuration.cache, details['path'])
for filename in filenames: # filenames = glob.glob(basename + '*.data')
volumes[filename] = { # filenames.extend(glob.glob(basename + '*.data.checksum'))
'bind': os.path.join('/cache', filename.replace(configuration.cache + '/', '')), # filenames.extend(glob.glob(basename + '*.data.index'))
'mode': 'ro', # filenames.extend(glob.glob(basename + '*.data.index.checksum'))
} #
# for filename in filenames:
if 'result' in configuration.data: # volumes[filename] = {
outputs_config = { # 'bind': os.path.join('/cache', filename.replace(configuration.cache + '/', '')),
'result': configuration.data['result'] # 'mode': 'ro',
} # }
else: #
outputs_config = configuration.data['outputs'] # if 'result' in configuration.data:
# outputs_config = {
for name, details in outputs_config.items(): # 'result': configuration.data['result']
basename = os.path.join(configuration.cache, details['path']) # }
dirname = os.path.dirname(basename) # else:
# outputs_config = configuration.data['outputs']
volumes[dirname] = { #
'bind': os.path.join('/cache', dirname.replace(configuration.cache + '/', '')), # for name, details in outputs_config.items():
'mode': 'rw', # basename = os.path.join(configuration.cache, details['path'])
} # dirname = os.path.dirname(basename)
#
# volumes[dirname] = {
# 'bind': os.path.join('/cache', dirname.replace(configuration.cache + '/', '')),
# 'mode': 'rw',
# }
self.process = dock.Popen( self.process = dock.Popen(
host, host,
......
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