-
Notifications
You must be signed in to change notification settings - Fork 698
[Feat] [history server] Add node endpoint #4436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JiangJiaWei1103
wants to merge
48
commits into
ray-project:master
Choose a base branch
from
JiangJiaWei1103:epic-4374/add-node-endpoint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 22 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
8b84e0e
feat: Add node endpoint /nodes POC
JiangJiaWei1103 fd5e8ff
docs: Clarify router nodes
JiangJiaWei1103 7dc3f85
feat: Support dashboard API-compatible response
JiangJiaWei1103 d093b88
refactor: Clean event processing logic
JiangJiaWei1103 25f87bf
refactor: Extract lifecycle dedup and sorting helper
JiangJiaWei1103 7f5a5b6
feat: Support more node fields
JiangJiaWei1103 8d7ff9a
Support local dev outside cluster (should be reverted)
JiangJiaWei1103 0a1a558
test: Add e2e tests for /nodes endpoint for both live and dead
JiangJiaWei1103 73809f4
feat: Support base64 to hex conversion
JiangJiaWei1103 46bee4e
feat: Support /nodes/node_id endpoint with shared formatters
JiangJiaWei1103 bbbccd8
docs: Remove redundant comments
JiangJiaWei1103 eb542fb
test: Add e2e tests for /nodes/node_id endpoint for both live and dead
JiangJiaWei1103 147da88
Revert "Support local dev outside cluster (should be reverted)"
JiangJiaWei1103 492a011
fix: Use test namespace instead of default
JiangJiaWei1103 06240b6
fix: Check empty node ID before conversion
JiangJiaWei1103 ae4a75a
fix: Fix deepcopy to prevent race conditions
JiangJiaWei1103 f9a39a2
Merge branch 'my-master' into epic-4374/add-node-endpoint
JiangJiaWei1103 2589818
Support local dev outside cluster (should be reverted)
JiangJiaWei1103 05926f1
feat: Add more fields
JiangJiaWei1103 450c50d
test: Add new test fields
JiangJiaWei1103 6d2a660
feat: Add storeStats
JiangJiaWei1103 965c368
feat: Add resource string
JiangJiaWei1103 6f72a63
Revert "Support local dev outside cluster (should be reverted)"
JiangJiaWei1103 03c21d3
fix: Follow iter order by using slice not map
JiangJiaWei1103 e582fe5
Merge branch 'my-master' into epic-4374/add-node-endpoint
JiangJiaWei1103 16f490d
docs: Add docs
JiangJiaWei1103 bee9a4f
test: Add back log file e2e tests
JiangJiaWei1103 357d774
fix: Handle NODE_LIFECYCLE_EVENT without any state transitions
JiangJiaWei1103 6d2dc71
Merge branch 'my-master' into epic-4374/add-node-endpoint
JiangJiaWei1103 721a4d7
fix: Fix merging def conflicts
JiangJiaWei1103 f8574cd
refactor: Add a helper to get node by node id
JiangJiaWei1103 00fa74e
Remove .env
JiangJiaWei1103 325beea
fix: Construct resource string only for alive
JiangJiaWei1103 bb7b067
[history server] use sessionName in task, actor, and job endpoints (#…
Future-Outlier 72101a2
Merge remote-tracking branch 'upstream/master' into epic-4374/add-nod…
Future-Outlier 5e2afa7
fix merge bug
Future-Outlier 63e4be6
fix node endpoints
Future-Outlier ce06cdf
fix: Fix get one node summary API schema
JiangJiaWei1103 9f1cb93
update
Future-Outlier 83b474a
fix TODO
Future-Outlier 4ba9f9e
Merge branch 'my-master' into epic-4374/add-node-endpoint
JiangJiaWei1103 3788bc8
Merge branch 'my-master' into epic-4374/add-node-endpoint
JiangJiaWei1103 c9a4050
fix: Check rsc str for non-empty string
JiangJiaWei1103 79684af
fix: Avoid missing key
JiangJiaWei1103 7fcd1db
fix: Sort resource keys first
JiangJiaWei1103 9210d0d
test: Verify hostnamelist view and clean code
JiangJiaWei1103 0847170
refactor: Use existing helper to get cluster session key
JiangJiaWei1103 21b1d58
refactor: Use existing helper to get cluster session key
JiangJiaWei1103 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,52 @@ | ||
| package eventserver | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file defines the interface and processing helpers (e.g., |
||
|
|
||
| import ( | ||
| "sort" | ||
| "time" | ||
| ) | ||
|
|
||
| // StateTransition defines a common interface for state transitions. | ||
| type StateTransition interface { | ||
| GetState() string | ||
| GetTimestamp() time.Time | ||
| } | ||
|
|
||
| // StateTransitionKey is a unique key for deduplication. | ||
| type StateTransitionKey struct { | ||
| State string | ||
| Timestamp int64 | ||
| } | ||
|
|
||
| // MergeStateTransitions merges new state transitions into existing ones, avoiding duplicates and maintaining chronological order. | ||
| func MergeStateTransitions[T StateTransition](existingStateTransitions []T, newStateTransitions []T) []T { | ||
| // Build a map of existing transition keys for deduplication. | ||
| existingKeys := make(map[StateTransitionKey]bool, len(existingStateTransitions)) | ||
| for _, tr := range existingStateTransitions { | ||
| key := StateTransitionKey{ | ||
| State: tr.GetState(), | ||
| Timestamp: tr.GetTimestamp().UnixNano(), | ||
| } | ||
| existingKeys[key] = true | ||
| } | ||
|
|
||
| // Append new state transitions that haven't seen before. | ||
| mergedStateTransitions := make([]T, len(existingStateTransitions)) | ||
| copy(mergedStateTransitions, existingStateTransitions) | ||
| for _, tr := range newStateTransitions { | ||
| key := StateTransitionKey{ | ||
| State: tr.GetState(), | ||
| Timestamp: tr.GetTimestamp().UnixNano(), | ||
| } | ||
| if !existingKeys[key] { | ||
| mergedStateTransitions = append(mergedStateTransitions, tr) | ||
| existingKeys[key] = true | ||
| } | ||
| } | ||
|
|
||
| // Sort state transitions by timestamp to maintain chronological order. | ||
| sort.Slice(mergedStateTransitions, func(i, j int) bool { | ||
| return mergedStateTransitions[i].GetTimestamp().Before(mergedStateTransitions[j].GetTimestamp()) | ||
| }) | ||
|
|
||
| return mergedStateTransitions | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.