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

chore: centralize wait task in substrasdk #147

Merged
merged 5 commits into from
Jun 30, 2023

Conversation

guilhem-barthes
Copy link
Contributor

@guilhem-barthes guilhem-barthes commented Jun 27, 2023

Related issue

Summary

Centralize wait_task and wait_compute_plan, and re-use the implementation added in substra through the other components.

Notes

Fixes FL-1052

Please check if the PR fulfills these requirements

  • If necessary, the changelog has been updated
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • The commit message follows the conventional commit specification

@linear
Copy link

linear bot commented Jun 27, 2023

FL-1052 move `wait_task` & `wait_compute_plan`

Context

Currently we have 3 imlementations to wait for compute tasks/ compute plans:

Specification

Acceptance criteria

Having these features defined once in substra and the previous implementations removed.

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.

thx a lot :D did you try that it work in local mode too ?

@@ -142,7 +141,7 @@ def test_pypi_dependency(
function_key = self._register_function(dummy_algo_class(), algo_deps, client, session_dir)

train_task = self._register_train_task(function_key, numpy_datasets[0], constant_samples[0], client)
utils.wait(client, train_task)
client.wait_task(train_task.key, raises=True)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
client.wait_task(train_task.key, raises=True)
client.wait_task(train_task.key)

Nitpicking but raises=True is the default

Copy link
Contributor Author

@guilhem-barthes guilhem-barthes Jun 28, 2023

Choose a reason for hiding this comment

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

I was thinking about that, but knowing that this is used instead of the assert, if we change the default, these tests will stop testing anything silently. But if you consider this is not a risk, happy to revert it!

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense ! lets keep it this way :)

tests/settings.py Show resolved Hide resolved
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.

LGTM thanks !

@@ -142,7 +141,7 @@ def test_pypi_dependency(
function_key = self._register_function(dummy_algo_class(), algo_deps, client, session_dir)

train_task = self._register_train_task(function_key, numpy_datasets[0], constant_samples[0], client)
utils.wait(client, train_task)
client.wait_task(train_task.key, raises=True)
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense ! lets keep it this way :)

Signed-off-by: Guilhem Barthes <guilhem.barthes@owkin.com>
…ient.wait_xxx` in tests

Signed-off-by: Guilhem Barthes <guilhem.barthes@owkin.com>
Signed-off-by: Guilhem Barthes <guilhem.barthes@owkin.com>
Signed-off-by: Guilhem Barthes <guilhem.barthes@owkin.com>
Signed-off-by: Guilhem Barthes <guilhem.barthes@owkin.com>
@guilhem-barthes guilhem-barthes force-pushed the chore/centralize-wait_task-in-substrasdk branch from 7af0e75 to b61f8d5 Compare June 30, 2023 13:24
@guilhem-barthes guilhem-barthes merged commit 15442f6 into main Jun 30, 2023
@guilhem-barthes guilhem-barthes deleted the chore/centralize-wait_task-in-substrasdk branch June 30, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants