-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental functions for resuming a task run #910
Conversation
Can you point me towards how to created automated tests? In particular, I think |
Surely! Here's a good example of an operator test you could build from. The flow you'd look to build would likely need to:
|
Great! I'll likely take a stab at it over the weekend. |
Just like any other unit test. I tend to use |
Hi - I have a new unit test created, where it's the exact copy of
I see that |
@ajyl Sorry I missed this for so long... The issue is that Mephisto in these tests expects to be running the tasks to completion in order to shutdown. If you've increased the number of assignments without any other changes, that means that the task isn't complete by the time it shuts down. |
Hi @JackUrb! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
5ea9892
to
7c052aa
Compare
b3dcb56
to
8ca310b
Compare
8ca310b
to
b262670
Compare
21c3bb3
to
555bbe5
Compare
101edc5
to
b68e93c
Compare
Overview
This PR acts as a starting point for implementing the path of resuming incomplete or interrupted
TaskRun
s. It creates two new experimental functions (denoted with anEXP_
prefix) that power the functionality. The basic flow is to:TaskRun
, and use it to initialize aCrowdProvider
,Architect
, andBlueprint
Unit
s.Assignment
s, then force-reset their incomplete units fromEXPIRED
toCREATED
,launch_unit
s flow.Implementation
The first portion is a version of
Operator.launch_task_run_or_die
, which instead of creating a new task run from a given config, loads a task run from ID and steals its config. It then establishes the same type of local state that an operator would have normally and tries to execute the run.The second part is
TaskLauncher.EXP_resume_assignments
, which replaces thecreate_assignments
step and instead looks for existing assignments that have incomplete units. It moves those incomplete units (either by expiration or (+soft) rejection) to the CREATED state, and stores them locally so that thelaunch_units
call from theOperator
only relaunches these particular units.Testing
No testing yet
TODO
main
: it's experimental. Some people can use it, but I'd like to standardize pre-releasing functionality that may unblock people (or lead them to contribute the remaining parts to bring to core functionality)TODO to move to core
SharedTaskState
for instance is going to struggle to resume properly, but it's possible we have a script wrapper that restores screening unit validator, onboarding functions, etc.