forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Progress bar to use task/summarize state-api endpoint. (ray-pr…
…oject#31577) This removes our dependency on prometheus for the progress bar but there is now a 10000 task limit per job. Updates the task summarize endpoint to accept job id as a filter Frequency of progress bar updates has increased greatly because previously, prometheus scrapes every 15 seconds. Otherwise, the UI is unchanged:
- Loading branch information
Showing
10 changed files
with
323 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
dashboard/client/src/pages/job/hook/useJobProgress.unit.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { StateApiJobProgressByTaskName, TaskProgress } from "../../../type/job"; | ||
import { TypeTaskStatus } from "../../../type/task"; | ||
import { formatSummaryToTaskProgress } from "./useJobProgress"; | ||
|
||
describe("formatSummaryToTaskProgress", () => { | ||
it("formats correctly", () => { | ||
const summary: StateApiJobProgressByTaskName = { | ||
node_id_to_summary: { | ||
cluster: { | ||
summary: { | ||
task_1: { | ||
func_or_class_name: "task_1", | ||
state_counts: { | ||
[TypeTaskStatus.FINISHED]: 1, | ||
[TypeTaskStatus.FAILED]: 2, | ||
[TypeTaskStatus.RUNNING]: 3, | ||
[TypeTaskStatus.RUNNING_IN_RAY_GET]: 4, | ||
[TypeTaskStatus.PENDING_ARGS_AVAIL]: 5, | ||
}, | ||
}, | ||
task_2: { | ||
func_or_class_name: "task_2", | ||
state_counts: { | ||
[TypeTaskStatus.FINISHED]: 100, | ||
[TypeTaskStatus.NIL]: 5, | ||
}, | ||
}, | ||
task_3: { | ||
func_or_class_name: "task_3", | ||
state_counts: { | ||
[TypeTaskStatus.RUNNING]: 1, | ||
someNewState: 1, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const expected: { name: string; progress: TaskProgress }[] = [ | ||
{ | ||
name: "task_1", | ||
progress: { | ||
numFinished: 1, | ||
numFailed: 2, | ||
numRunning: 7, | ||
numPendingArgsAvail: 5, | ||
}, | ||
}, | ||
{ | ||
name: "task_2", | ||
progress: { | ||
numFinished: 100, | ||
numUnknown: 5, | ||
}, | ||
}, | ||
{ | ||
name: "task_3", | ||
progress: { | ||
numRunning: 1, | ||
numUnknown: 1, | ||
}, | ||
}, | ||
]; | ||
|
||
expect(formatSummaryToTaskProgress(summary)).toEqual(expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.