Migrating submissions from old phase to new phase

Ready for functional review/QA/staging!

- [x] Use leaderboard entry as submission to move, if no leaderboard entry grab latest
- [x] `auto_migration` phase flag
- [x] `http://domain.com//competitions/check_phase_migrations` url, pinged every 3 hours
What I was really asking is why you think it should be True. My own take is that setting it to False seems right. All submissions have been queued, therefore the migration is done even though the evaluation is not Finished. Keep in mind that they may never reach the Finished state as they may instead fail.

 

The important thing is that if a participant comes to the submission table after phase_migrated has been set to True, then there is already one entry in the submission table. It doesn’t matter that entry #1 has already completed or not.

 

 

From: Eric Carmichael [mailto:notifications@github.com] 
Sent: Tuesday, June 17, 2014 5:01 PM
To: codalab/codalab
Cc: cpoulain
Subject: Re: [codalab] Migrating submissions from old phase to new phase (#452)

 

In codalab/apps/web/models.py:

> +
> +                new_submission = CompetitionSubmission.objects.create(
> +                    participant=participant,
> +                    file=submission.file,
> +                    phase=current_phase
> +                )
> +
> +                evaluate_submission(new_submission.pk, current_phase.is_scoring_only)
> +        except PhaseLeaderBoard.DoesNotExist:
> +            pass
> +
> +        current_phase.is_migrated = True
> +        current_phase.save()
> +
> +        # TODO: ONLY IF SUCCESSFUL
> +        self.is_migrating = False # this should really be True until evaluate_submission tasks are all the way completed

I couldn't think of a decent way to tell when all of the submissions were done at the time.

I thought about it for a bit and in my latest commit <https://github.com/Tivix/codalab/commit/b89865428f03883cc7b1d5a6e6d0a9141ac28478>  I think I've made this quite a bit more robust. If previous phase has no submissions -> marked completed. When all submissions are in FINISHED state -> migration marked completed.

—
Reply to this email directly or view it on GitHub <https://github.com/codalab/codalab/pull/452/files#r13893624> .  <https://github.com/notifications/beacon/3453398__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxODY2ODg2NywiZGF0YSI6eyJpZCI6MzM3NTMzNjZ9fQ==--a972720706ca4972e6bfd020a40a0b3f343770e0.gif>