-
Notifications
You must be signed in to change notification settings - Fork 683
[history server] [collector] Fix collector 4241 review comments #4325
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
base: master
Are you sure you want to change the base?
Changes from 11 commits
15f7e42
982bb27
e86b654
13e9c3f
851454c
4c1e835
9439ffc
9489298
f80e45b
de4fac6
989654e
836cfed
c9195e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package utils | ||
|
|
||
| import "time" | ||
|
|
||
| // Ray session directory related constants. | ||
| const ( | ||
| RAY_SESSIONDIR_LOGDIR_NAME = "logs" | ||
| RAY_SESSIONDIR_METADIR_NAME = "meta" | ||
| ) | ||
|
|
||
| // Local Ray runtime paths. | ||
| const ( | ||
| RaySessionLatestPath = "/tmp/ray/session_latest" | ||
| RayNodeIDPath = "/tmp/ray/raylet_node_id" | ||
| ) | ||
|
|
||
| // OSS meta file keys used by history server. | ||
| const ( | ||
| RayMetaFile_BasicInfo = "ack__basicinfo" | ||
|
|
||
| RayMetaFile_NodeSummaryKey = "restful__nodes_view_summary" | ||
| RayMetaFile_Node_Prefix = "restful__nodes_" | ||
| RayMetaFile_JOBTASK_DETAIL_Prefix = "restful__api__v0__tasks_detail_job_id_" | ||
| RayMetaFile_JOBTASK_SUMMARIZE_BY_FUNC_NAME_Prefix = "restful__api__v0__tasks_summarize_by_func_name_job_id_" | ||
| RayMetaFile_JOBTASK_SUMMARIZE_BY_LINEAGE_Prefix = "restful__api__v0__tasks_summarize_by_lineage_job_id_" | ||
| RayMetaFile_JOBDATASETS_Prefix = "restful__api__data__datasets_job_id_" | ||
| RayMetaFile_NodeLogs_Prefix = "restful__api__v0__logs_node_id_" | ||
| RayMetaFile_ClusterStatus = "restful__api__cluster_status" | ||
| RayMetaFile_LOGICAL_ACTORS = "restful__logical__actors" | ||
| RayMetaFile_ALLTASKS_DETAIL = "restful__api__v0__tasks_detail" | ||
| RayMetaFile_Events = "restful__events" | ||
| RayMetaFile_PlacementGroups = "restful__api__v0__placement_groups_detail" | ||
| RayMetaFile_ClusterSessionName = "static__api__cluster_session_name" | ||
| RayMetaFile_Jobs = "restful__api__jobs" | ||
| RayMetaFile_Applications = "restful__api__serve__applications" | ||
| ) | ||
|
|
||
| // Ray history server log file name. | ||
| const RayHistoryServerLogName = "historyserver-ray.log" | ||
|
|
||
| const ( | ||
| // DefaultMaxRetryAttempts controls how many times we retry reading | ||
| // local Ray metadata files (e.g. session dir, node id) before failing. | ||
| DefaultMaxRetryAttempts = 3 | ||
| // DefaultInitialRetryDelay is the base delay before the first retry. | ||
| // Subsequent retries use an exponential backoff based on this value. | ||
| DefaultInitialRetryDelay = 5 * time.Second | ||
| ) | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -17,15 +17,15 @@ limitations under the License. | |||
| package utils | ||||
|
|
||||
| type ClusterInfo struct { | ||||
| Name string `json:"name"` | ||||
| Namespace string `json:"namespace"` | ||||
| SessionName string `json:"sessionName"` | ||||
| CreateTime string `json:"createTime"` | ||||
| CreateTimeStamp int64 `json:"createTimeStamp"` | ||||
| Name string `json:"name"` | ||||
| Namespace string `json:"namespace"` | ||||
| SessionName string `json:"sessionName"` | ||||
| CreationTime string `json:"creationTime"` | ||||
| CreationTimestamp int64 `json:"creationTimestamp"` | ||||
|
Comment on lines
+23
to
+24
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. I think kuberay/historyserver/pkg/utils/types.go Line 31 in 7b2acae
If this feels redundant, we can discuss which one to keep to improve maintainability. Original discussion: #4241 (comment) |
||||
| } | ||||
|
|
||||
| type ClusterInfoList []ClusterInfo | ||||
|
|
||||
| func (a ClusterInfoList) Len() int { return len(a) } | ||||
| func (a ClusterInfoList) Swap(i, j int) { a[i], a[j] = a[j], a[i] } | ||||
| func (a ClusterInfoList) Less(i, j int) bool { return a[i].CreateTimeStamp > a[j].CreateTimeStamp } // Sort descending | ||||
| func (a ClusterInfoList) Less(i, j int) bool { return a[i].CreationTimestamp > a[j].CreationTimestamp } // Sort descending | ||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to clarify where these env vars will be used.