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

Remove update_graph_hlg #7502

Closed
wants to merge 4 commits into from
Closed

Conversation

fjetter
Copy link
Member

@fjetter fjetter commented Jan 26, 2023

This removes the two methods update_graph and update_graph_hlg handlers. Now there is only one handler. A subsequent PR will consolidate the two methods.
I took the liberty of adding type annotations which makes the change larger than absolutely necessary but I think it's worth it.

Copy link
Member Author

@fjetter fjetter left a comment

Choose a reason for hiding this comment

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

I chose to add an underscore to the update_graph methods. I doubt we will guarantee any API stability for this moving forward. Definitely not in the short term while working on HLG serialization

Comment on lines 1369 to 1373
async def test_update_graph_culls(s, a, b):
s.update_graph(
# FIXME: Migrate to new API
s._update_graph_plain_tasks(
tasks={
"x": dumps_task((inc, 1)),
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only place where actual functionality of update_graph was tested so I kept the original API call around. The functionality this is testing is interesting enough to be preserved since update_graph performs culling as well on top of whatever we're implementing in HLGs, etc.
I chose to keep it for now since I don't know yet what to do with it

cc @rjzamora in case you were not aware. Doesn't change too much about HLGs but this is interesting nonetheless, I believe

Comment on lines -722 to -727
dsk = {("x-%d" % i): (inc, i) for i in range(20)}
s.update_graph(
tasks=valmap(dumps_task, dsk),
keys=list(dsk),
dependencies={k: set() for k in dsk},
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Most update_graph invocations where very old tests that were written at a time where the client was not what it is today. I migrated to a more modern version of these tests but kept functionality as is.

@@ -142,35 +140,20 @@ async def test_multi_progressbar_widget(c, s, a, b):


@mock_widget()
@gen_cluster()
async def test_multi_progressbar_widget_after_close(s, a, b):
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is a bit odd and I couldn't make sense of the suffix _after_close. One thing that is unique about this test is that it tests the multiprogress bars explicitly with intermediate keys so I adjusted accordingly

Copy link
Member Author

Choose a reason for hiding this comment

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

Keeps failing. After some thought I'm not even sure if this is possible. I'll remove the test

Comment on lines -471 to -478
c._send_to_scheduler(
{
"op": "update-graph",
"tasks": {},
"keys": [stringify(self.key)],
"client": c.id,
}
)
Copy link
Member Author

Choose a reason for hiding this comment

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

From what I can tell this is not serving any purpose. The future itself lets the scheduler know that it is interested with a client_desires_keys so this is redundant and the only non-test invocation of the old API

Comment on lines -928 to -966
@gen_cluster()
async def test_filtered_communication(s, a, b):
c = await connect(s.address)
f = await connect(s.address)
await c.write({"op": "register-client", "client": "c", "versions": {}})
await f.write({"op": "register-client", "client": "f", "versions": {}})
await c.read()
await f.read()

assert set(s.client_comms) == {"c", "f"}

await c.write(
{
"op": "update-graph",
"tasks": {"x": dumps_task((inc, 1)), "y": dumps_task((inc, "x"))},
"dependencies": {"x": [], "y": ["x"]},
"client": "c",
"keys": ["y"],
}
)

await f.write(
{
"op": "update-graph",
"tasks": {
"x": dumps_task((inc, 1)),
"z": dumps_task((operator.add, "x", 10)),
},
"dependencies": {"x": [], "z": ["x"]},
"client": "f",
"keys": ["z"],
}
)
(msg,) = await c.read()
assert msg["op"] == "key-in-memory"
assert msg["key"] == "y"
(msg,) = await f.read()
assert msg["op"] == "key-in-memory"
assert msg["key"] == "z"
Copy link
Member Author

Choose a reason for hiding this comment

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

This was introduced in #108 and is long outdated.
We have plenty of these tests in test_client.py, e.g. test_multiple_clients

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this is worth being tested on a lower level

@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2023

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

       24 files  ±  0         24 suites  ±0   10h 32m 54s ⏱️ + 30m 17s
  3 327 tests  -   2    3 221 ✔️  -   2     105 💤 ±  0  1 ±0 
39 229 runs   - 23  37 350 ✔️  - 11  1 878 💤  - 12  1 ±0 

For more details on these failures, see this check.

Results for commit 5682371. ± Comparison against base commit 0161991.

♻️ This comment has been updated with latest results.

@fjetter
Copy link
Member Author

fjetter commented Jan 27, 2023

Tests look good. The only failure is test_set_lifetime_stagger_via_env_var which is likely caused by slow process startup times it seems.

@fjetter
Copy link
Member Author

fjetter commented Mar 10, 2023

#7564

@fjetter fjetter closed this Mar 10, 2023
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.

1 participant