Skip to content

Compute worker - Avoid duplicating submission files #1874

Closed

Description

@Didayolo

Original problem:

Solution:

But then it broke results submission competitions. We are still using the previous version of the compute workers to avoid the problem.

TODO

The current idea to fix this

Instead of doing the copy during ingestion program, we do it during scoring program. This way, the files are not saved in the storage as part of the ingestion output, because they are added to it after, only temporarily. No need for updating existing competitions. We may need to make changes in order to access the submission during scoring program execution.

Activity

  1. added
    Enhancement
    P1
    Post-it
    on Jun 12, 2025
  2. Didayolo commented on Jun 12, 2025

    @Didayolo
    MemberAuthor

    @ihsaan-ullah I still need to put more details here but basically we have this issue to share information about the problem

  3. ihsaan-ullah commented on Jun 14, 2025

    @ihsaan-ullah
    Collaborator

    I checked in detail and tried to access submission in scoring but this is not possible. This is not a mistake but a design decision someone took so that during scoring you don't have access to the submission files.

    It all starts from this line of code where submission data is passed only when running ingestion.

    If you want to check, you will find scoring program files in place of submission files in compute worker while scoring.

    We can discuss this more in the next meeting to decide what to do next

  4. Didayolo commented on Jun 16, 2025

    @Didayolo
    MemberAuthor

    OK. Probably we can have the duplication only for results submissions. That would already be a win. Also it looks like it was the original intent of the code in compute_worker.py with the arguments kind='program' and can_be_output=True.


    EDIT: we changed our mind, see "current solution" on the main post of the issue.

  5. self-assigned this
    on Jun 19, 2025
  6. Didayolo commented on Feb 6, 2026

    @Didayolo
    MemberAuthor

    TODO: Perform the copy during scoring (instead of during ingestion)

    It is not clear actually. The copy is performed there (function _run_program_directory):

                # Display a warning in logs when there is no metadata file in submission/program dir
                if kind == "program":
                    logger.warning(
                        "Program directory missing metadata, assuming it's going to be handled by ingestion"
                    )
                    # Copy submission files into prediction output
                    # This is useful for results submissions but wrongly uses storage
                    shutil.copytree(program_dir, self.output_dir)
                    return

    But kind == "program" seems to indicate that we are inside scoring program:

            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"),
                self._run_program_directory(ingestion_program_dir, kind="ingestion"),
                self.watch_detailed_results(),
                loop=loop,
                return_exceptions=True,
            )

    In the other hand, we observed that the copy goes into the ingestion output... To be sorted out.

  7. ihsaan-ullah commented on Feb 6, 2026

    @ihsaan-ullah
    Collaborator

    But kind == "program" seems to indicate that we are inside scoring program:

    NOTE: "program" is used for both submission and scoring program.

    Everytime a submission runs, the function _run_program_directory is called twice

    self._run_program_directory(program_dir, kind="program"),
    self._run_program_directory(ingestion_program_dir, kind="ingestion"),

    The design is confusing and the naming is not good. This could be improved.

  8. Didayolo commented on Feb 6, 2026

    @Didayolo
    MemberAuthor

    OK, I guess we should discuss this during a meeting.

    Just to clarify, even if here "program" means submission, isn't the second line (kind="ingestion") for running ingestion program? Then the first is not for the scoring program? I'm completely confused.

  9. ihsaan-ullah commented on Feb 6, 2026

    @ihsaan-ullah
    Collaborator

    Just to clarify, even if here "program" means submission, isn't the second line (kind="ingestion") for running ingestion program? Then the first is not for the scoring program? I'm completely confused.

    When a scoring submission is executed, the function call with kind=ingestion does nothing. The second call for kind = program executes the scoring program.

    I can explain this in our next meeting

  10. Didayolo commented on Feb 24, 2026

    @Didayolo
    MemberAuthor

    This code line sends either the submission or the scoring program:

    run_args['program_data'] = make_url_sassy(

    Then kind='program' is either the submission or scoring program.
    kind='ingestion' runs ingestion program or does nothing in case we are in the scoring.

    We basically need to sort this out, always passing the submission path, and running either scoring or ingestion depending which is relevant.

    Then we do not need copy anymore.

  11. ObadaS commented on Jul 29, 2026

    @ObadaS
    Collaborator

    Closing since #2303 fixed this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugEnhancementP1Post-it

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions