@@ -40,15 +40,19 @@ void BuildCommonTaskSpec(
4040 const std::unordered_map<std::string, double > &required_resources,
4141 const std::unordered_map<std::string, double > &required_placement_resources,
4242 const BundleID &bundle_id, bool placement_group_capture_child_tasks,
43- const std::string debugger_breakpoint, const std::string &serialized_runtime_env,
43+ const std::string debugger_breakpoint,
44+ const Priority &priority,
45+ const std::string &serialized_runtime_env,
4446 const std::vector<std::string> &runtime_env_uris,
4547 const std::string &concurrency_group_name = " " ) {
4648 // Build common task spec.
4749 builder.SetCommonTaskSpec (
4850 task_id, name, function.GetLanguage (), function.GetFunctionDescriptor (), job_id,
4951 current_task_id, task_index, caller_id, address, num_returns, required_resources,
5052 required_placement_resources, bundle_id, placement_group_capture_child_tasks,
51- debugger_breakpoint, serialized_runtime_env, runtime_env_uris,
53+ debugger_breakpoint,
54+ priority,
55+ serialized_runtime_env, runtime_env_uris,
5256 concurrency_group_name);
5357 // Set task arguments.
5458 for (const auto &arg : args) {
@@ -681,7 +685,7 @@ CoreWorker::CoreWorker(const CoreWorkerOptions &options, const WorkerID &worker_
681685 std::move (lease_policy), memory_store_, task_manager_, local_raylet_id,
682686 RayConfig::instance ().worker_lease_timeout_milliseconds (), actor_creator_,
683687 /* get_task_priority=*/ [](const TaskSpecification &spec) {
684- return Priority ();
688+ return spec. GetPriority ();
685689 },
686690 RayConfig::instance ().max_tasks_in_flight_per_worker (),
687691 boost::asio::steady_timer (io_service_));
@@ -1671,9 +1675,11 @@ std::vector<rpc::ObjectReference> CoreWorker::SubmitTask(
16711675 rpc_address_, function, args, task_options.num_returns ,
16721676 constrained_resources, required_resources, placement_options,
16731677 placement_group_capture_child_tasks, debugger_breakpoint,
1678+ Priority (),
16741679 task_options.serialized_runtime_env , task_options.runtime_env_uris );
16751680 builder.SetNormalTaskSpec (max_retries, retry_exceptions);
16761681 TaskSpecification task_spec = builder.Build ();
1682+ // priority = task_manager_->GenerateTaskPriority(task_spec);
16771683 RAY_LOG (DEBUG) << " Submit task " << task_spec.DebugString ();
16781684 std::vector<rpc::ObjectReference> returned_refs;
16791685 if (options_.is_local_mode ) {
@@ -1683,6 +1689,7 @@ std::vector<rpc::ObjectReference> CoreWorker::SubmitTask(
16831689 CurrentCallSite (), max_retries);
16841690 io_service_.post (
16851691 [this , task_spec]() {
1692+ // (Jae) This is the reason why tasks are not placed with priority
16861693 RAY_UNUSED (direct_task_submitter_->SubmitTask (task_spec));
16871694 },
16881695 " CoreWorker.SubmitTask" );
@@ -1727,6 +1734,7 @@ Status CoreWorker::CreateActor(const RayFunction &function,
17271734 new_placement_resources, actor_creation_options.placement_options ,
17281735 actor_creation_options.placement_group_capture_child_tasks ,
17291736 " " , /* debugger_breakpoint */
1737+ Priority (),
17301738 actor_creation_options.serialized_runtime_env ,
17311739 actor_creation_options.runtime_env_uris );
17321740
@@ -1911,6 +1919,7 @@ std::vector<rpc::ObjectReference> CoreWorker::SubmitActorTask(
19111919 required_resources, std::make_pair (PlacementGroupID::Nil (), -1 ),
19121920 true , /* placement_group_capture_child_tasks */
19131921 " " , /* debugger_breakpoint */
1922+ Priority (),
19141923 " {}" , /* serialized_runtime_env */
19151924 {}, /* runtime_env_uris */
19161925 task_options.concurrency_group_name );
@@ -1923,6 +1932,7 @@ std::vector<rpc::ObjectReference> CoreWorker::SubmitActorTask(
19231932
19241933 // Submit task.
19251934 TaskSpecification task_spec = builder.Build ();
1935+ std::vector<ObjectID> task_deps;
19261936 std::vector<rpc::ObjectReference> returned_refs;
19271937 if (options_.is_local_mode ) {
19281938 returned_refs = ExecuteTaskLocalMode (task_spec, actor_id);
0 commit comments