Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Cindy Zhang <[email protected]>
  • Loading branch information
zcin committed Jun 5, 2023
1 parent fe29409 commit d2372cd
Show file tree
Hide file tree
Showing 17 changed files with 837 additions and 422 deletions.
40 changes: 26 additions & 14 deletions apiserver/pkg/model/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,10 @@ func PopulateServeConfig(serveConfigSpecs []v1alpha1.ServeConfigSpec) []*api.Ser

func PoplulateRayServiceStatus(serviceName string, serviceStatus v1alpha1.RayServiceStatuses, events []v1.Event) *api.RayServiceStatus {
status := &api.RayServiceStatus{
ApplicationStatus: serviceStatus.ActiveServiceStatus.ApplicationStatus.Status,
ApplicationMessage: serviceStatus.ActiveServiceStatus.ApplicationStatus.Message,
ServeDeploymentStatus: PopulateServeDeploymentStatus(serviceStatus.ActiveServiceStatus.ServeStatuses),
RayServiceEvents: PopulateRayServiceEvent(serviceName, events),
RayClusterName: serviceStatus.ActiveServiceStatus.RayClusterName,
RayClusterState: string(serviceStatus.ActiveServiceStatus.RayClusterStatus.State),
RayServiceEvents: PopulateRayServiceEvent(serviceName, events),
RayClusterName: serviceStatus.ActiveServiceStatus.RayClusterName,
RayClusterState: string(serviceStatus.ActiveServiceStatus.RayClusterStatus.State),
ServeApplicationStatus: PopulateServeApplicationStatus(serviceStatus.ActiveServiceStatus.Applications),
}
status.ServiceEndpoint = map[string]string{}
for name, port := range serviceStatus.ActiveServiceStatus.RayClusterStatus.Endpoints {
Expand All @@ -382,17 +380,31 @@ func PoplulateRayServiceStatus(serviceName string, serviceStatus v1alpha1.RaySer
return status
}

func PopulateServeDeploymentStatus(serveDeploymentStatuses []v1alpha1.ServeDeploymentStatus) []*api.ServeDeploymentStatus {
deploymentStatus := make([]*api.ServeDeploymentStatus, 0)
for _, serveDeploymentStatus := range serveDeploymentStatuses {
func PopulateServeApplicationStatus(serveApplicationStatuses map[string]v1alpha1.AppStatus) []*api.ServeApplicationStatus {
appStatuses := make([]*api.ServeApplicationStatus, 0)
for appName, appStatus := range serveApplicationStatuses {
ds := &api.ServeApplicationStatus{
Name: appName,
Status: appStatus.Status,
Message: appStatus.Message,
ServeDeploymentStatus: PopulateServeDeploymentStatus(appStatus.Deployments),
}
appStatuses = append(appStatuses, ds)
}
return appStatuses
}

func PopulateServeDeploymentStatus(serveDeploymentStatuses map[string]v1alpha1.ServeDeploymentStatus) []*api.ServeDeploymentStatus {
deploymentStatuses := make([]*api.ServeDeploymentStatus, 0)
for deploymentName, deploymentStatus := range serveDeploymentStatuses {
ds := &api.ServeDeploymentStatus{
DeploymentName: serveDeploymentStatus.Name,
Status: serveDeploymentStatus.Status,
Message: serveDeploymentStatus.Message,
DeploymentName: deploymentName,
Status: deploymentStatus.Status,
Message: deploymentStatus.Message,
}
deploymentStatus = append(deploymentStatus, ds)
deploymentStatuses = append(deploymentStatuses, ds)
}
return deploymentStatus
return deploymentStatuses
}

func PopulateRayServiceEvent(serviceName string, events []v1.Event) []*api.RayServiceEvent {
Expand Down
140 changes: 71 additions & 69 deletions helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12144,6 +12144,8 @@ spec:
required:
- importPath
type: object
serveConfigV2:
type: object
serviceUnhealthySecondThreshold:
format: int32
type: integer
Expand All @@ -12153,21 +12155,44 @@ spec:
properties:
activeServiceStatus:
properties:
appStatus:
applicationStatuses:
additionalProperties:
properties:
healthLastUpdateTime:
description: Keep track of how long the service is healthy.
format: date-time
type: string
lastUpdateTime:
format: date-time
type: string
message:
type: string
serveDeploymentStatuses:
additionalProperties:
description: ServeDeploymentStatus defines the current
state of a Serve deployment
properties:
healthLastUpdateTime:
description: Keep track of how long the service is
healthy.
format: date-time
type: string
lastUpdateTime:
format: date-time
type: string
message:
type: string
status:
description: Name, Status, Message are from Ray Dashboard
and represent a Serve deployment's state.
type: string
type: object
type: object
status:
type: string
type: object
description: 'Important: Run "make" to regenerate code after modifying
this file'
properties:
healthLastUpdateTime:
description: Keep track of how long the service is healthy.
format: date-time
type: string
lastUpdateTime:
format: date-time
type: string
message:
type: string
status:
type: string
type: object
dashboardStatus:
description: DashboardStatus defines the current states of Ray
Expand Down Expand Up @@ -12241,10 +12266,18 @@ spec:
state of cluster Important: Run "make" to regenerat'
type: string
type: object
serveDeploymentStatuses:
items:
description: ServeDeploymentStatus defines the current state
of a Serve deployment
type: object
observedGeneration:
description: observedGeneration is the most recent generation observed
for this RayService.
format: int64
type: integer
pendingServiceStatus:
description: Pending Service Status indicates a RayCluster will be
created or is being created.
properties:
applicationStatuses:
additionalProperties:
properties:
healthLastUpdateTime:
description: Keep track of how long the service is healthy.
Expand All @@ -12255,40 +12288,32 @@ spec:
type: string
message:
type: string
name:
description: Name, Status, Message are from Ray Dashboard
and represent a Serve deployment's state.
type: string
serveDeploymentStatuses:
additionalProperties:
description: ServeDeploymentStatus defines the current
state of a Serve deployment
properties:
healthLastUpdateTime:
description: Keep track of how long the service is
healthy.
format: date-time
type: string
lastUpdateTime:
format: date-time
type: string
message:
type: string
status:
description: Name, Status, Message are from Ray Dashboard
and represent a Serve deployment's state.
type: string
type: object
type: object
status:
description: 'TODO: change status type to enum'
type: string
type: object
type: array
type: object
observedGeneration:
description: observedGeneration is the most recent generation observed
for this RayService.
format: int64
type: integer
pendingServiceStatus:
description: Pending Service Status indicates a RayCluster will be
created or is being created.
properties:
appStatus:
description: 'Important: Run "make" to regenerate code after modifying
this file'
properties:
healthLastUpdateTime:
description: Keep track of how long the service is healthy.
format: date-time
type: string
lastUpdateTime:
format: date-time
type: string
message:
type: string
status:
type: string
type: object
dashboardStatus:
description: DashboardStatus defines the current states of Ray
Expand Down Expand Up @@ -12362,29 +12387,6 @@ spec:
state of cluster Important: Run "make" to regenerat'
type: string
type: object
serveDeploymentStatuses:
items:
description: ServeDeploymentStatus defines the current state
of a Serve deployment
properties:
healthLastUpdateTime:
description: Keep track of how long the service is healthy.
format: date-time
type: string
lastUpdateTime:
format: date-time
type: string
message:
type: string
name:
description: Name, Status, Message are from Ray Dashboard
and represent a Serve deployment's state.
type: string
status:
description: 'TODO: change status type to enum'
type: string
type: object
type: array
type: object
serviceStatus:
description: ServiceStatus indicates the current RayService status.
Expand Down
Loading

0 comments on commit d2372cd

Please sign in to comment.