Render tasks that are not schedulable on the dashboard. (#7034)

This commit is contained in:
SangBin Cho
2020-02-10 14:23:06 -08:00
committed by GitHub
parent 3f99be8dad
commit 1e690673d8
7 changed files with 181 additions and 20 deletions
+1
View File
@@ -72,6 +72,7 @@ message GetNodeStatsReply {
repeated ViewData view_data = 2;
uint32 num_workers = 3;
repeated TaskSpec infeasible_tasks = 4;
repeated TaskSpec ready_tasks = 5;
}
// Service for inter-node-manager communication.
+17 -2
View File
@@ -3132,9 +3132,24 @@ void NodeManager::HandleGetNodeStats(const rpc::GetNodeStatsRequest &request,
worker_stats->set_pid(driver->Pid());
worker_stats->set_is_driver(true);
}
// NOTE(sang): Currently reporting only infeasible/ready ActorCreationTask
// because Ray dashboard only renders actorCreationTask as of Feb 3 2020.
// TODO(sang): Support dashboard for non-ActorCreationTask.
for (const auto task : local_queues_.GetTasks(TaskState::INFEASIBLE)) {
auto infeasible_task = reply->add_infeasible_tasks();
infeasible_task->ParseFromString(task.GetTaskSpecification().Serialize());
if (task.GetTaskSpecification().IsActorCreationTask()) {
auto infeasible_task = reply->add_infeasible_tasks();
infeasible_task->ParseFromString(task.GetTaskSpecification().Serialize());
}
}
// Report tasks that are not scheduled because
// resources are occupied by other actors/tasks.
// NOTE(sang): This solution is a workaround. It can be replaced by creating a new state
// like PENDING_UNTIL_RESOURCE_AVAILABLE.
for (const auto task : local_queues_.GetTasks(TaskState::READY)) {
if (task.GetTaskSpecification().IsActorCreationTask()) {
auto ready_task = reply->add_ready_tasks();
ready_task->ParseFromString(task.GetTaskSpecification().Serialize());
}
}
// Ensure we never report an empty set of metrics.
if (!recorded_metrics_) {