Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
0e544151
Commit
0e544151
authored
Sep 13, 2017
by
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
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
beat/core/agent.py
View file @
0e544151
...
@@ -306,38 +306,43 @@ class Agent(object):
...
@@ -306,38 +306,43 @@ 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
basename
=
os
.
path
.
join
(
configuration
.
cache
,
details
[
'path'
])
filenames
=
glob
.
glob
(
basename
+
'*.data'
)
filenames
.
extend
(
glob
.
glob
(
basename
+
'*.data.checksum'
))
filenames
.
extend
(
glob
.
glob
(
basename
+
'*.data.index'
))
filenames
.
extend
(
glob
.
glob
(
basename
+
'*.data.index.checksum'
))
for
filename
in
filenames
:
volumes
[
filename
]
=
{
'bind'
:
os
.
path
.
join
(
'/cache'
,
filename
.
replace
(
configuration
.
cache
+
'/'
,
''
)),
'mode'
:
'ro'
,
}
if
'result'
in
configuration
.
data
:
outputs_config
=
{
'result'
:
configuration
.
data
[
'result'
]
}
else
:
outputs_config
=
configuration
.
data
[
'outputs'
]
for
name
,
details
in
outputs_config
.
items
():
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'
,
'mode'
:
'rw'
,
}
}
# for name, details in configuration.data['inputs'].items():
# if 'database' in details:
# continue
#
# basename = os.path.join(configuration.cache, details['path'])
# filenames = glob.glob(basename + '*.data')
# filenames.extend(glob.glob(basename + '*.data.checksum'))
# filenames.extend(glob.glob(basename + '*.data.index'))
# filenames.extend(glob.glob(basename + '*.data.index.checksum'))
#
# for filename in filenames:
# volumes[filename] = {
# 'bind': os.path.join('/cache', filename.replace(configuration.cache + '/', '')),
# 'mode': 'ro',
# }
#
# if 'result' in configuration.data:
# outputs_config = {
# 'result': configuration.data['result']
# }
# else:
# outputs_config = configuration.data['outputs']
#
# for name, details in outputs_config.items():
# 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
,
envkey
,
envkey
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment