From 87a0501a80df15d22502cd7e7fc9334826cedd4f Mon Sep 17 00:00:00 2001 From: TheoLisin Date: Wed, 29 Nov 2023 12:08:12 +0000 Subject: [PATCH] pull base layers --- agent/worker/agent.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/agent/worker/agent.py b/agent/worker/agent.py index 54a5728..1d7b05b 100644 --- a/agent/worker/agent.py +++ b/agent/worker/agent.py @@ -488,6 +488,11 @@ def inf_loop(self): sly.function_wrapper_external_logger, self.task_clear_old_data, self.logger ) ) + self.thread_list.append( + self.thread_pool.submit( + sly.function_wrapper_external_logger, self.update_base_layers, self.logger + ) + ) if constants.DISABLE_TELEMETRY() is None: self.thread_list.append( self.thread_pool.submit( @@ -546,3 +551,14 @@ def task_clear_old_data(self): # raise e image_cleaner.remove_idle_images() time.sleep(day) + + def update_base_layers(self): + self.logger.info("Start background task: pulling `supervisely/base-py-sdk:latest`") + sly.docker_utils.docker_pull_if_needed( + self.docker_api, + "supervisely/base-py-sdk:latest", + policy=sly.docker_utils.PullPolicy.ALWAYS, + logger=self.logger, + progress=False, + ) + self.logger.info("Background task finished: `supervisely/base-py-sdk:latest` has been pulled.")