Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
d0397a57
Commit
d0397a57
authored
Oct 09, 2018
by
Samuel GAIST
Browse files
Merge branch 'improve_cleanup' into 'master'
Implement temporary resources cleanup See merge request
!36
parents
88b17e54
0eb75803
Pipeline
#24137
passed with stages
in 27 minutes and 39 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/core/environments.py
View file @
d0397a57
...
...
@@ -77,4 +77,5 @@ def enumerate_packages(host, environment_name):
'version'
:
information
[
1
]
})
host
.
rm
(
container
)
return
packages
beat/core/execution/base.py
View file @
d0397a57
...
...
@@ -152,6 +152,7 @@ class BaseExecutor(object):
self
.
data_sinks
=
[]
self
.
errors
=
[]
self
.
data
=
data
self
.
debug
=
False
# Check that the cache path exists
if
not
os
.
path
.
exists
(
self
.
cache
):
...
...
beat/core/execution/docker.py
View file @
d0397a57
...
...
@@ -34,6 +34,7 @@ Execution utilities
"""
import
os
import
shutil
import
requests
import
simplejson
import
zmq
...
...
@@ -230,6 +231,7 @@ class DockerExecutor(RemoteExecutor):
#----- (If necessary) Instantiate the docker container that provide the databases
databases_container
=
None
databases_configuration_path
=
None
datasets_uid
=
self
.
data
.
pop
(
'datasets_uid'
,
None
)
network_name
=
self
.
data
.
pop
(
'network_name'
,
'bridge'
)
...
...
@@ -423,4 +425,9 @@ class DockerExecutor(RemoteExecutor):
self
.
message_handler
.
destroy
()
self
.
message_handler
=
None
if
not
self
.
debug
:
if
databases_configuration_path
:
shutil
.
rmtree
(
databases_configuration_path
)
shutil
.
rmtree
(
configuration_path
)
return
retval
beat/core/execution/subprocess.py
View file @
d0397a57
...
...
@@ -37,6 +37,7 @@ Execution utilities
from
__future__
import
absolute_import
import
os
import
shutil
import
requests
import
zmq
import
sys
...
...
@@ -245,6 +246,7 @@ class SubprocessExecutor(RemoteExecutor):
#----- (If necessary) Instantiate the subprocess that provide the databases
databases_process
=
None
databases_configuration_path
=
None
database_port
=
utils
.
find_free_port
()
if
len
(
self
.
databases
)
>
0
:
...
...
@@ -370,4 +372,9 @@ class SubprocessExecutor(RemoteExecutor):
self
.
message_handler
.
destroy
()
self
.
message_handler
=
None
if
not
self
.
debug
:
if
databases_configuration_path
:
shutil
.
rmtree
(
databases_configuration_path
)
shutil
.
rmtree
(
configuration_path
)
return
retval
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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