Skip to content
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

feat: update computeplan status #827

Merged
merged 7 commits into from
Mar 5, 2024

Conversation

guilhem-barthes
Copy link
Contributor

@guilhem-barthes guilhem-barthes commented Feb 20, 2024

Description

Fixes FL-1422

How has this been tested?

CI Substra/substra-tests#320

Checklist

  • changelog was updated with notable changes
  • documentation was updated

Copy link

linear bot commented Feb 20, 2024

@guilhem-barthes guilhem-barthes changed the title Feat/update computeplan status feat: update computeplan status Feb 20, 2024
@guilhem-barthes guilhem-barthes force-pushed the feat/update-computeplan-status branch 2 times, most recently from c3cb2f1 to 6b8b76a Compare February 26, 2024 15:09
@guilhem-barthes guilhem-barthes marked this pull request as ready for review February 27, 2024 09:30
@guilhem-barthes guilhem-barthes requested a review from a team as a code owner February 27, 2024 09:30
Copy link
Member

@ThibaultFy ThibaultFy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comment, thanks for the PR :)

backend/api/management/commands/generate_fixtures.py Outdated Show resolved Hide resolved
backend/api/management/commands/generate_fixtures.py Outdated Show resolved Hide resolved
compute_plan_status = self.Status.PLAN_STATUS_CREATED
elif stats["waiting_builder_slot_count"] == stats["task_count"]:
compute_plan_status = self.Status.PLAN_STATUS_CREATED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could group the two in the same if.

Also, the self.Status.PLAN_STATUS_TODO was completely removed. Is that on purpose ? If yes, why ?

Copy link
Contributor Author

@guilhem-barthes guilhem-barthes Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I will merge it if you think it is cleaner!

So for the status changes:

  • EMPTY and WAITING have been merged into CREATED which states only the existence of CP (EMPTY being just CREATED with 0 tasks)
  • WAITING reflected having one task in WAITING. This became in our new task model WAITING_FOR_PARENTS, which happen after the build (which would be classified has doing, because it is actually working on a task). With product, we didn't think that the compute plan status needed the granularity of compute tasks (i.e. needed 3 types of waiting, which could be reached by a CP at the same time).
  • TODO was a reflection of a compute task being ready to be ran (built + execution). For compute task statuses, this status became WAITING_FOR_EXECUTOR_SLOT. This is not the first action done on the task and a compute plan could also have tasks in different waiting states at the same time (therefore what todo would mean? One task has to be built? executed? etc). This also refers to the previous point about waiting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so you mean that the case stats["doing_count"] == 0 and stats["done_count"] == 0: is in fact that a task is WAITING_FOR_EXECUTOR_SLOT, so the CP should still be in DOING ?

Copy link
Contributor Author

@guilhem-barthes guilhem-barthes Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because BUILDING is part of doing. That's why we renamed DOING in EXECUTING, because DOING encompasses BUILDING and EXECUTING. I don't think we could reach a state where we have neither BUILDING or EXECUTING with a compute plan in DOING

You are raising an interesting point, I think I should revert renaming doing_count to executing_count and adding BUILDING as part of it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After second thoughts, it seems like we should keep executing_count as these metrics refers to task statuses (explicitely providing a count for each status) rather than a compute task one

backend/api/models/computeplan.py Show resolved Hide resolved
@guilhem-barthes guilhem-barthes requested review from ThibaultFy and removed request for ThibaultFy March 1, 2024 13:12
Copy link
Member

@ThibaultFy ThibaultFy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the work :p

@guilhem-barthes guilhem-barthes merged commit 0a3f17b into main Mar 5, 2024
8 checks passed
@guilhem-barthes guilhem-barthes deleted the feat/update-computeplan-status branch March 5, 2024 08:54
guilhem-barthes added a commit that referenced this pull request Mar 5, 2024
* chore: rename ComputeTask `DOING` to `EXECUTING`

Signed-off-by: Guilhem Barthés <[email protected]>

* feat: replace ComputePlan `EMPTY`, `TODO` & `WAITING`by `CREATED`

Signed-off-by: Guilhem Barthés <[email protected]>

* docs: changelog

Signed-off-by: Guilhem Barthés <[email protected]>

* chore: remove duplicate

Signed-off-by: Guilhem Barthés <[email protected]>

* chore: rename `create_created_cp` to `create_cp`

Signed-off-by: Guilhem Barthés <[email protected]>

* chore: refactor `update_status`

Signed-off-by: Guilhem Barthés <[email protected]>

* chore: separate migrations

Signed-off-by: Guilhem Barthés <[email protected]>

---------

Signed-off-by: Guilhem Barthés <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants