Documentation ¶
Index ¶
- Constants
- func ExtractErrorForCLI(err error, isDebugMode bool) error
- func GetContainerByName(containers []corev1.Container, name string) (corev1.Container, int, bool)
- func GetNodeHostIP(node *corev1.Node) (net.IP, error)
- func HasCustomCode(err error, code CustomCode) bool
- func IsNotFound(err error) bool
- func IsUserErrorCodeMatch(err error, code codes.Code) bool
- func LogError(err error)
- func NewComputeTemplate(runtime *api.ComputeTemplate) (*corev1.ConfigMap, error)
- func ParseTimeOrFatal(value string) time.Time
- func TerminateIfError(err error)
- func UpdateRayServiceWorkerGroupSpecs(updateSpecs []*api.WorkerGroupUpdateSpec, ...) []rayv1api.WorkerGroupSpec
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type APICode
- type ClientOptions
- type CustomCode
- type CustomError
- type FakeTime
- type RayCluster
- type RayJob
- type RayService
- type RealTime
- type TimeInterface
- type UserError
- func NewAlreadyExistError(messageFormat string, a ...interface{}) *UserError
- func NewBadRequestError(err error, externalFormat string, a ...interface{}) *UserError
- func NewInternalServerError(err error, internalMessageFormat string, a ...interface{}) *UserError
- func NewInvalidInputError(messageFormat string, a ...interface{}) *UserError
- func NewInvalidInputErrorWithDetails(err error, externalMessage string) *UserError
- func NewNotFoundError(err error, externalMessageFormat string, a ...interface{}) *UserError
- func NewPermissionDeniedError(err error, externalFormat string, a ...interface{}) *UserError
- func NewResourceNotFoundError(resourceType string, resourceName string) *UserError
- func NewResourcesNotFoundError(resourceTypesFormat string, resourceNames ...interface{}) *UserError
- func NewUnauthenticatedError(err error, externalFormat string, a ...interface{}) *UserError
- func NewUserError(err error, internalMessage string, externalMessage string) *UserError
- func NewUserErrorWithSingleMessage(err error, message string) *UserError
- func (e *UserError) Cause() error
- func (e *UserError) Error() string
- func (e *UserError) ErrorStringWithoutStackTrace() string
- func (e *UserError) ExternalMessage() string
- func (e *UserError) ExternalStatusCode() codes.Code
- func (e *UserError) GRPCStatus() *status.Status
- func (e *UserError) Log()
- func (e *UserError) String() string
Constants ¶
const ( // Label keys RayClusterNameLabelKey = "ray.io/cluster-name" RayClusterUserLabelKey = "ray.io/user" RayClusterVersionLabelKey = "ray.io/version" RayClusterEnvironmentLabelKey = "ray.io/environment" KubernetesApplicationNameLabelKey = "app.kubernetes.io/name" KubernetesManagedByLabelKey = "app.kubernetes.io/managed-by" // Annotation keys // Role level RayClusterComputeTemplateAnnotationKey = "ray.io/compute-template" RayClusterImageAnnotationKey = "ray.io/compute-image" RayClusterDefaultImageRepository = "rayproject/ray" )
TODO: this needs to be revised.
const ( // The application name ApplicationName = "kuberay" // The component name for apiserver ComponentName = "kuberay-apiserver" )
const (
API_CODE_NOT_FOUND = 404
)
Variables ¶
This section is empty.
Functions ¶
func ExtractErrorForCLI ¶
func GetContainerByName ¶
func GetNodeHostIP ¶
GetNodeHostIP returns the provided node's IP, based on the priority: 1. NodeInternalIP 2. NodeExternalIP
func HasCustomCode ¶
func HasCustomCode(err error, code CustomCode) bool
func IsNotFound ¶
IsNotFound returns whether an error indicates that a resource was "not found".
func IsUserErrorCodeMatch ¶
IsUserErrorCodeMatch returns whether the error is a user error with specified code.
func NewComputeTemplate ¶
func NewComputeTemplate(runtime *api.ComputeTemplate) (*corev1.ConfigMap, error)
Build compute template
func ParseTimeOrFatal ¶
func TerminateIfError ¶
func TerminateIfError(err error)
TerminateIfError Check if error is nil. Terminate if not.
func UpdateRayServiceWorkerGroupSpecs ¶
func UpdateRayServiceWorkerGroupSpecs(updateSpecs []*api.WorkerGroupUpdateSpec, workerGroupSpecs []rayv1api.WorkerGroupSpec) []rayv1api.WorkerGroupSpec
Types ¶
type ClientOptions ¶
ClientOptions contains configuration needed to create a Kubernetes client
type CustomCode ¶
type CustomCode uint32
const ( CUSTOM_CODE_TRANSIENT CustomCode = 0 CUSTOM_CODE_PERMANENT CustomCode = 1 CUSTOM_CODE_NOT_FOUND CustomCode = 2 CUSTOM_CODE_GENERIC CustomCode = 3 )
type CustomError ¶
type CustomError struct {
// contains filtered or unexported fields
}
func NewCustomError ¶
func NewCustomError(err error, code CustomCode, format string, a ...interface{}) *CustomError
func NewCustomErrorf ¶
func NewCustomErrorf(code CustomCode, format string, a ...interface{}) *CustomError
func (*CustomError) Error ¶
func (e *CustomError) Error() string
type RayCluster ¶
type RayCluster struct {
*rayv1api.RayCluster
}
func NewRayCluster ¶
func NewRayCluster(apiCluster *api.Cluster, computeTemplateMap map[string]*api.ComputeTemplate) (*RayCluster, error)
NewRayCluster creates a RayCluster. func NewRayCluster(apiCluster *api.Cluster, clusterRuntime *api.ClusterRuntime, computeRuntime *api.ComputeRuntime) *RayCluster {
func (*RayCluster) Get ¶
func (c *RayCluster) Get() *rayv1api.RayCluster
Get converts this object to a rayv1api.Workflow.
func (*RayCluster) SetAnnotationsToAllTemplates ¶
func (c *RayCluster) SetAnnotationsToAllTemplates(key string, value string)
SetAnnotations sets annotations on all templates in a RayCluster
type RayJob ¶
type RayService ¶
type RayService struct {
*rayv1api.RayService
}
func NewRayService ¶
func NewRayService(apiService *api.RayService, computeTemplateMap map[string]*api.ComputeTemplate) (*RayService, error)
func (*RayService) Get ¶
func (s *RayService) Get() *rayv1api.RayService
type TimeInterface ¶
func NewFakeTime ¶
func NewFakeTime(now time.Time) TimeInterface
func NewFakeTimeForEpoch ¶
func NewFakeTimeForEpoch() TimeInterface
func NewRealTime ¶
func NewRealTime() TimeInterface
type UserError ¶
type UserError struct {
// contains filtered or unexported fields
}
func NewAlreadyExistError ¶
func NewBadRequestError ¶
func NewInternalServerError ¶
func NewInvalidInputError ¶
func NewNotFoundError ¶
func NewUnauthenticatedError ¶
func NewUserError ¶
func (*UserError) ErrorStringWithoutStackTrace ¶
func (*UserError) ExternalMessage ¶
func (*UserError) ExternalStatusCode ¶
func (*UserError) GRPCStatus ¶
GRPCStatus implements `GRPCStatus` to make sure `FromError` in grpc-go can honor the code. Otherwise, it will always return codes.Unknown(2). https://github.com/grpc/grpc-go/blob/2c0949c22d46095edc579d9e66edcd025192b98c/status/status.go#L91-L92