Skip to content
Snippets Groups Projects
Commit c3035a58 authored by Philip ABBET's avatar Philip ABBET
Browse files

Optimization: cache the discovery of docker images

parent e263080b
No related branches found
No related tags found
No related merge requests found
...@@ -1365,7 +1365,7 @@ class JobSplit(models.Model): ...@@ -1365,7 +1365,7 @@ class JobSplit(models.Model):
self.end(result) self.end(result)
def process(self, cache=settings.CACHE_ROOT): def process(self, cache=settings.CACHE_ROOT, docker_images_cache=None):
'''Process assigned job splits using beat.core '''Process assigned job splits using beat.core
This task executes the user algorithm on a subprocess. It also serves This task executes the user algorithm on a subprocess. It also serves
...@@ -1419,7 +1419,7 @@ class JobSplit(models.Model): ...@@ -1419,7 +1419,7 @@ class JobSplit(models.Model):
try: try:
if JobSplit.host is None: if JobSplit.host is None:
JobSplit.host = Host() JobSplit.host = Host(images_cache=docker_images_cache)
JobSplit.host.setup(raise_on_errors=not(getattr(settings, 'TEST_CONFIGURATION', False))) JobSplit.host.setup(raise_on_errors=not(getattr(settings, 'TEST_CONFIGURATION', False)))
self.executor = beat.core.execution.Executor(settings.PREFIX, config, self.executor = beat.core.execution.Executor(settings.PREFIX, config,
......
...@@ -115,4 +115,4 @@ def main(user_input=None): ...@@ -115,4 +115,4 @@ def main(user_input=None):
signal.signal(signal.SIGTERM, handler) signal.signal(signal.SIGTERM, handler)
signal.signal(signal.SIGINT, handler) signal.signal(signal.SIGINT, handler)
split.process() split.process(docker_images_cache='/tmp/beat_docker_images.json')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment