[Core] Added support for submission-time task names. (#10449)

* Added support for submission-time task names.

* Suggestions from code review: add missing consts

Co-authored-by: SangBin Cho <rkooo567@gmail.com>

* Add num_returns arg to actor method options docstring example.

* Add process name line and proctitle assertion to submission-time task name section of advanced docs.

* Add submission-time task name --> proctitle test for Python worker.

* Added Python actor options tests for num_returns and name.

* Added Java test for submission-time task names.

* Add dashboard image to task name docs section.

* Move to fstrings.

Co-authored-by: SangBin Cho <rkooo567@gmail.com>
This commit is contained in:
Clark Zinzow
2020-09-03 11:45:24 -07:00
committed by GitHub
co-authored by SangBin Cho
parent 71274954d1
commit 0c0b0d0a73
37 changed files with 361 additions and 135 deletions
+20
View File
@@ -51,6 +51,26 @@ And vary the number of return values for tasks (and actor methods too):
assert ray.get(id1) == 0
assert ray.get(id2) == 1
And specify a name for tasks (and actor methods too) at task submission time:
.. code-block:: python
import setproctitle
@ray.remote
def f(x):
assert setproctitle.getproctitle() == "ray::special_f"
return x + 1
obj = f.options(name="special_f").remote(3)
assert ray.get(obj) == 4
This name will appear as the task name in the machine view of the dashboard, will appear
as the worker process name when this task is executing (if a Python task), and will
appear as the task name in the logs.
.. image:: images/task_name_dashboard.png
Dynamic Custom Resources
------------------------
Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB