dashboardclient

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: Apache-2.0, BSD-2-Clause, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Multi-application URL paths
	ServeDetailsPath = "/api/serve/applications/"
	APITypeParam     = "declarative"
	DeployPathV2     = "/api/serve/applications/"
	// Job URL paths
	JobPath = "/api/jobs/"
)
View Source
var ErrAgain = errors.New("EAGAIN")

ErrAgain EAGAIN means "there is no data available right now, try again later" https://stackoverflow.com/questions/4058368/what-does-eagain-mean

Functions

func ConvertRayJobToReq

func ConvertRayJobToReq(rayJob *rayv1.RayJob) (*utiltypes.RayJobRequest, error)

func UnmarshalRuntimeEnvYAML

func UnmarshalRuntimeEnvYAML(runtimeEnvYAML string) (utiltypes.RuntimeEnvType, error)

Types

type JobInfoCache added in v1.6.0

type JobInfoCache struct {
	JobInfo   *utiltypes.RayJobInfo
	Err       error
	UpdatedAt *time.Time
}

type RayDashboardCacheClient added in v1.6.0

type RayDashboardCacheClient struct {
	// contains filtered or unexported fields
}

func (*RayDashboardCacheClient) DeleteJob added in v1.6.0

func (r *RayDashboardCacheClient) DeleteJob(ctx context.Context, jobName string) error

func (*RayDashboardCacheClient) GetJobInfo added in v1.6.0

func (r *RayDashboardCacheClient) GetJobInfo(ctx context.Context, jobId string) (*utiltypes.RayJobInfo, error)

func (*RayDashboardCacheClient) GetJobLog added in v1.6.0

func (r *RayDashboardCacheClient) GetJobLog(ctx context.Context, jobName string) (*string, error)

func (*RayDashboardCacheClient) GetMultiApplicationStatus added in v1.6.0

func (r *RayDashboardCacheClient) GetMultiApplicationStatus(ctx context.Context) (map[string]*utiltypes.ServeApplicationStatus, error)

func (*RayDashboardCacheClient) GetServeDetails added in v1.6.0

func (r *RayDashboardCacheClient) GetServeDetails(ctx context.Context) (*utiltypes.ServeDetails, error)

func (*RayDashboardCacheClient) InitClient added in v1.6.0

func (r *RayDashboardCacheClient) InitClient(ctx context.Context, namespacedName types.NamespacedName, client RayDashboardClientInterface)

func (*RayDashboardCacheClient) ListJobs added in v1.6.0

func (*RayDashboardCacheClient) StopJob added in v1.6.0

func (r *RayDashboardCacheClient) StopJob(ctx context.Context, jobName string) error

func (*RayDashboardCacheClient) SubmitJob added in v1.6.0

func (r *RayDashboardCacheClient) SubmitJob(ctx context.Context, rayJob *rayv1.RayJob) (string, error)

func (*RayDashboardCacheClient) SubmitJobReq added in v1.6.0

func (r *RayDashboardCacheClient) SubmitJobReq(ctx context.Context, request *utiltypes.RayJobRequest) (string, error)

func (*RayDashboardCacheClient) UpdateDeployments added in v1.6.0

func (r *RayDashboardCacheClient) UpdateDeployments(ctx context.Context, configJson []byte) error

type RayDashboardClient

type RayDashboardClient struct {
	// contains filtered or unexported fields
}

func (*RayDashboardClient) ConvertServeDetailsToApplicationStatuses

func (r *RayDashboardClient) ConvertServeDetailsToApplicationStatuses(serveDetails *utiltypes.ServeDetails) (map[string]*utiltypes.ServeApplicationStatus, error)

func (*RayDashboardClient) DeleteJob

func (r *RayDashboardClient) DeleteJob(ctx context.Context, jobName string) error

func (*RayDashboardClient) GetJobInfo

func (r *RayDashboardClient) GetJobInfo(ctx context.Context, jobId string) (*utiltypes.RayJobInfo, error)

Note that RayJobInfo and error can't be nil at the same time. Please make sure if the Ray job with JobId can't be found. Return a BadRequest error.

func (*RayDashboardClient) GetJobLog

func (r *RayDashboardClient) GetJobLog(ctx context.Context, jobName string) (*string, error)

Get Job Log

func (*RayDashboardClient) GetMultiApplicationStatus

func (r *RayDashboardClient) GetMultiApplicationStatus(ctx context.Context) (map[string]*utiltypes.ServeApplicationStatus, error)

func (*RayDashboardClient) GetServeDetails

func (r *RayDashboardClient) GetServeDetails(ctx context.Context) (*utiltypes.ServeDetails, error)

GetServeDetails gets details on all declarative applications on the Ray cluster.

func (*RayDashboardClient) InitClient

func (r *RayDashboardClient) InitClient(client *http.Client, dashboardURL string, authToken string)

func (*RayDashboardClient) ListJobs

func (*RayDashboardClient) StopJob

func (r *RayDashboardClient) StopJob(ctx context.Context, jobName string) (err error)

func (*RayDashboardClient) SubmitJob

func (r *RayDashboardClient) SubmitJob(ctx context.Context, rayJob *rayv1.RayJob) (jobId string, err error)

func (*RayDashboardClient) SubmitJobReq

func (r *RayDashboardClient) SubmitJobReq(ctx context.Context, request *utiltypes.RayJobRequest) (jobId string, err error)

func (*RayDashboardClient) UpdateDeployments

func (r *RayDashboardClient) UpdateDeployments(ctx context.Context, configJson []byte) error

UpdateDeployments update the deployments in the Ray cluster.

type RayDashboardClientInterface

type RayDashboardClientInterface interface {
	UpdateDeployments(ctx context.Context, configJson []byte) error
	// V2/multi-app Rest API
	GetServeDetails(ctx context.Context) (*utiltypes.ServeDetails, error)
	GetMultiApplicationStatus(context.Context) (map[string]*utiltypes.ServeApplicationStatus, error)
	GetJobInfo(ctx context.Context, jobId string) (*utiltypes.RayJobInfo, error)
	ListJobs(ctx context.Context) (*[]utiltypes.RayJobInfo, error)
	SubmitJob(ctx context.Context, rayJob *rayv1.RayJob) (string, error)
	SubmitJobReq(ctx context.Context, request *utiltypes.RayJobRequest) (string, error)
	GetJobLog(ctx context.Context, jobName string) (*string, error)
	StopJob(ctx context.Context, jobName string) error
	DeleteJob(ctx context.Context, jobName string) error
}

type Task added in v1.6.0

type Task func(taskCTX context.Context) bool

Task defines a unit of work for the worker pool and the return value indicate if it should re-queue or not.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL