From c1884de02a1e60c508f99ecd99ab270b59898f77 Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Mon, 5 May 2025 17:22:20 +0500 Subject: [PATCH] code removed that was copying submission files to predictions dir --- compute_worker/compute_worker.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/compute_worker/compute_worker.py b/compute_worker/compute_worker.py index 4742e90f8..85a2cbe06 100644 --- a/compute_worker/compute_worker.py +++ b/compute_worker/compute_worker.py @@ -583,7 +583,14 @@ def _get_host_path(self, *paths): return path - async def _run_program_directory(self, program_dir, kind, can_be_output=False): + async def _run_program_directory(self, program_dir, kind): + """ + Function responsible for running program directory + + Args: + - program_dir : can be either ingestion program or program/submission + - kind : either `program` or `ingestion` + """ # If the directory doesn't even exist, move on if not os.path.exists(program_dir): logger.info(f"{program_dir} not found, no program to execute") @@ -597,13 +604,11 @@ async def _run_program_directory(self, program_dir, kind, can_be_output=False): elif os.path.exists(os.path.join(program_dir, "metadata")): metadata_path = 'metadata' else: - if can_be_output: + # Display a warning in logs when there is no metadata file in submission/program dir + if kind == "program": logger.info( - "Program directory missing metadata, assuming it's going to be handled by ingestion " - "program so move it to output" + "Program directory missing metadata, assuming it's going to be handled by ingestion" ) - # Copying so that we don't move a code submission w/out a metadata command - shutil.copytree(program_dir, self.output_dir) return else: raise SubmissionException("Program directory missing 'metadata.yaml/metadata'") @@ -815,7 +820,7 @@ def start(self): logger.info("Running scoring program, and then ingestion program") loop = asyncio.new_event_loop() gathered_tasks = asyncio.gather( - self._run_program_directory(program_dir, kind='program', can_be_output=True), + self._run_program_directory(program_dir, kind='program'), self._run_program_directory(ingestion_program_dir, kind='ingestion'), self.watch_detailed_results(), loop=loop,