Skip to content

Fix the resource key representation before sending graphs (#2716)#2733

Merged
mrocklin merged 5 commits intodask:masterfrom
Spiegel0:issue-2716-resources
Jun 3, 2019
Merged

Fix the resource key representation before sending graphs (#2716)#2733
mrocklin merged 5 commits intodask:masterfrom
Spiegel0:issue-2716-resources

Conversation

@Spiegel0
Copy link
Copy Markdown
Contributor

Convert resource key tuples to a string representation before they are submitted to the scheduler.

The commit is intended demonstrate a quick-fix of #2716. I'm not sure whether it breaks something else because I wasn't able to successfully run all test-cases, yet.

Convert resource key toples to a string representation before they are
submitted to the scheduler. The commit is intended to fix dask#2716.
@mrocklin
Copy link
Copy Markdown
Member

Thanks for the PR @Spiegel0 ! It would be good to include a test in this PR that would have failed before this fix. There is some information here: http://distributed.dask.org/en/latest/develop.html#writing-tests

Perhaps something like the following, with the example that you shared in the original issue filled in.

@gen_cluster(client=True)
def test_resources_str(c, s, a, b):
    a.set_resources({"MyRes": 1000})
    df = ...
    df.persist(resouces=...)
    yield wait(df)

    ts = s.tasks[tokey(df.__dask_keys__()[0])]
    assert ts.resources == 

@Spiegel0
Copy link
Copy Markdown
Contributor Author

You are right, a test case would be very beneficial. Thank you for providing me the code snippet! I currently don't have access to my development environment but I'll try to implement the test case on Monday or Tuesday. (I guess its a good opportunity to get started with the Dask distributed internals.) I'll let you know as soon as I have the test case ready.

Spiegel0 added 4 commits June 3, 2019 11:22
The test case persists the result of a tiny DataFrame operation
and checks the resource restrictions.
Convert resource key toples to a string representation before they are
submitted to the scheduler. The commit is intended to fix dask#2716.
@jakirkham
Copy link
Copy Markdown
Member

Would you have another chance to take a look, @mrocklin? Looks like there is now a test case. Travis CI is passing (with the exception of Python 2.7, which we may not care about here). AppVeyor is failing, but it is unclear (at least to me) if the failures are related.

@mrocklin
Copy link
Copy Markdown
Member

mrocklin commented Jun 3, 2019

Looks good. Merging. Thanks @Spiegel0 !

@mrocklin mrocklin merged commit 861536c into dask:master Jun 3, 2019
@Spiegel0
Copy link
Copy Markdown
Contributor Author

Spiegel0 commented Jun 3, 2019

Thank you very much for the assistance and for merging the PR @mrocklin, @jakirkham and @TomAugspurger!

@Spiegel0 Spiegel0 deleted the issue-2716-resources branch June 3, 2019 17:01
muammar added a commit to muammar/distributed that referenced this pull request Jun 12, 2019
* upstream/master: (58 commits)
  Add unknown pytest markers (dask#2764)
  Delay lookup of allowed failures. (dask#2761)
  Change address -> worker in ColumnDataSource for nbytes plot (dask#2755)
  Remove module state in Prometheus Handlers (dask#2760)
  Add stress test for UCX (dask#2759)
  Add nanny logs (dask#2744)
  Move some of the adaptive logic into the scheduler (dask#2735)
  Add SpecCluster.new_worker_spec method (dask#2751)
  Worker dashboard fixes (dask#2747)
  Add async context managers to scheduler/worker classes (dask#2745)
  Fix the resource key representation before sending graphs (dask#2716) (dask#2733)
  Allow user to configure whether workers are daemon. (dask#2739)
  Pin pytest >=4 with pip in appveyor and python 3.5 (dask#2737)
  Add Experimental UCX Comm (dask#2591)
  Close nannies gracefully (dask#2731)
  add kwargs to progressbars (dask#2638)
  Add back LocalCluster.__repr__. (dask#2732)
  Move bokeh module to dashboard (dask#2724)
  Close clusters at exit (dask#2730)
  Add SchedulerPlugin TaskState example (dask#2622)
  ...
muammar added a commit to muammar/distributed that referenced this pull request Jul 18, 2019
* upstream/master: (43 commits)
  Add unknown pytest markers (dask#2764)
  Delay lookup of allowed failures. (dask#2761)
  Change address -> worker in ColumnDataSource for nbytes plot (dask#2755)
  Remove module state in Prometheus Handlers (dask#2760)
  Add stress test for UCX (dask#2759)
  Add nanny logs (dask#2744)
  Move some of the adaptive logic into the scheduler (dask#2735)
  Add SpecCluster.new_worker_spec method (dask#2751)
  Worker dashboard fixes (dask#2747)
  Add async context managers to scheduler/worker classes (dask#2745)
  Fix the resource key representation before sending graphs (dask#2716) (dask#2733)
  Allow user to configure whether workers are daemon. (dask#2739)
  Pin pytest >=4 with pip in appveyor and python 3.5 (dask#2737)
  Add Experimental UCX Comm (dask#2591)
  Close nannies gracefully (dask#2731)
  add kwargs to progressbars (dask#2638)
  Add back LocalCluster.__repr__. (dask#2732)
  Move bokeh module to dashboard (dask#2724)
  Close clusters at exit (dask#2730)
  Add SchedulerPlugin TaskState example (dask#2622)
  ...
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.

3 participants