From 5a500ea86af7f63262919beb8f824a7717bcdc8a Mon Sep 17 00:00:00 2001 From: Tyler Gu Date: Mon, 9 Oct 2023 03:10:16 -0500 Subject: [PATCH] Fix image preload Signed-off-by: Tyler Gu --- acto/post_process/simple_crash_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/acto/post_process/simple_crash_test.py b/acto/post_process/simple_crash_test.py index 5a6314499c..b4a3643406 100644 --- a/acto/post_process/simple_crash_test.py +++ b/acto/post_process/simple_crash_test.py @@ -5,6 +5,7 @@ import os import queue import re +import subprocess import sys import threading import time @@ -150,6 +151,15 @@ def post_process(self, workdir: str, num_workers: int = 1): cluster.configure_cluster(self.config.num_nodes, self.config.kubernetes_version) deploy = Deploy(DeployMethod.YAML, self.config.deploy.file, self.config.deploy.init).new() + # Build an archive to be preloaded + images_archive = os.path.join(workdir, 'images.tar') + if len(self.context['preload_images']) > 0: + # first make sure images are present locally + for image in self.context['preload_images']: + subprocess.run(['docker', 'pull', image]) + subprocess.run(['docker', 'image', 'save', '-o', images_archive] + + list(self.context['preload_images'])) + ################## Operation sequence crash test ###################### workqueue = multiprocessing.Queue() for trial, steps in self._trial_to_steps.items():