[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 12:45:24 -06:00
committed by GitHub
parent 71274954d1
commit 0c0b0d0a73
37 changed files with 361 additions and 135 deletions
+6 -4
View File
@@ -67,8 +67,9 @@ WaitResult AbstractRayRuntime::Wait(const std::vector<ObjectID> &ids, int num_ob
ObjectID AbstractRayRuntime::Call(RemoteFunctionPtrHolder &fptr,
std::shared_ptr<msgpack::sbuffer> args) {
InvocationSpec invocationSpec;
invocationSpec.task_id =
TaskID::ForFakeTask(); // TODO(Guyang Song): make it from different task
// TODO(Guyang Song): make it from different task
invocationSpec.task_id = TaskID::ForFakeTask();
invocationSpec.name = "";
invocationSpec.actor_id = ActorID::Nil();
invocationSpec.args = args;
invocationSpec.func_offset =
@@ -87,8 +88,9 @@ ObjectID AbstractRayRuntime::CallActor(const RemoteFunctionPtrHolder &fptr,
const ActorID &actor,
std::shared_ptr<msgpack::sbuffer> args) {
InvocationSpec invocationSpec;
invocationSpec.task_id =
TaskID::ForFakeTask(); // TODO(Guyang Song): make it from different task
// TODO(Guyang Song): make it from different task
invocationSpec.task_id = TaskID::ForFakeTask();
invocationSpec.name = "";
invocationSpec.actor_id = actor;
invocationSpec.args = args;
invocationSpec.func_offset =
@@ -11,6 +11,7 @@ namespace api {
class InvocationSpec {
public:
TaskID task_id;
std::string name;
ActorID actor_id;
int actor_counter;
/// Remote function offset from base address.
@@ -30,8 +30,10 @@ ObjectID LocalModeTaskSubmitter::Submit(const InvocationSpec &invocation, TaskTy
std::unordered_map<std::string, double> required_resources;
std::unordered_map<std::string, double> required_placement_resources;
TaskSpecBuilder builder;
builder.SetCommonTaskSpec(invocation.task_id, rpc::Language::CPP, functionDescriptor,
local_mode_ray_tuntime_.GetCurrentJobID(),
std::string task_name =
invocation.name.empty() ? functionDescriptor->DefaultTaskName() : invocation.name;
builder.SetCommonTaskSpec(invocation.task_id, task_name, rpc::Language::CPP,
functionDescriptor, local_mode_ray_tuntime_.GetCurrentJobID(),
local_mode_ray_tuntime_.GetCurrentTaskId(), 0,
local_mode_ray_tuntime_.GetCurrentTaskId(), address, 1,
required_resources, required_placement_resources,
+4 -3
View File
@@ -29,8 +29,8 @@ class DefaultWorker {
"", // driver_name
"", // stdout_file
"", // stderr_file
std::bind(&DefaultWorker::ExecuteTask, this, _1, _2, _3, _4, _5, _6,
_7), // task_execution_callback
std::bind(&DefaultWorker::ExecuteTask, this, _1, _2, _3, _4, _5, _6, _7,
_8), // task_execution_callback
nullptr, // check_signals
nullptr, // gc_collect
nullptr, // spill_objects
@@ -51,7 +51,8 @@ class DefaultWorker {
void RunTaskExecutionLoop() { CoreWorkerProcess::RunTaskExecutionLoop(); }
private:
Status ExecuteTask(TaskType task_type, const RayFunction &ray_function,
Status ExecuteTask(TaskType task_type, const std::string task_name,
const RayFunction &ray_function,
const std::unordered_map<std::string, double> &required_resources,
const std::vector<std::shared_ptr<RayObject>> &args,
const std::vector<ObjectID> &arg_reference_ids,