Skip to content

Commit

Permalink
pull base layers
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLisin committed Nov 29, 2023
1 parent c1a54a2 commit 87a0501
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions agent/worker/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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.")

0 comments on commit 87a0501

Please sign in to comment.