Skip to content

Commit

Permalink
Merge pull request 2i2c-org#194 from 2i2c-org/pull-first
Browse files Browse the repository at this point in the history
Pull evaluator image on startup, don't wait for first evaluation
  • Loading branch information
yuvipanda authored Nov 22, 2024
2 parents b7aaade + 181aef8 commit 8521870
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frx_challenges/web/management/commands/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ async def pull_image(self):
logger.info(f"Not pulling {self.image}, it already exists")

async def start_evaluation(self, input_uri):
await self.pull_image()

os.makedirs(settings.SUBMISSIONS_RESULTS_DIR, exist_ok=True)
results_dir = tempfile.mkdtemp(prefix=settings.SUBMISSIONS_RESULTS_DIR)
Expand Down Expand Up @@ -178,6 +177,8 @@ async def process_running_evaluation(

async def ahandle(self):
evaluator = DockerEvaluator()
# Pull image if needed when the evaluator starts
await evaluator.pull_image()
while True:
# Get the Evaluations that have not been started yet
unstarted_evaluations = Evaluation.objects.select_related("version").filter(
Expand Down

0 comments on commit 8521870

Please sign in to comment.