ray

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Meta = metadata.NewProvider(
	ApplicationName,
	func(obj client.Object) string { return objToRayCluster(obj).Spec.Image.Tag },
	func(obj client.Object) map[string]string { return objToRayCluster(obj).Spec.GlobalLabels },
)

Functions

func AddGlobalLabels added in v0.4.3

func AddGlobalLabels(labels map[string]string, globalLabels map[string]string) map[string]string

func HeadlessHeadServiceName

func HeadlessHeadServiceName(name string) string

HeadlessHeadServiceName returns the name of the headless service used to register the head ray pod.

func HeadlessWorkerServiceName

func HeadlessWorkerServiceName(name string) string

HeadlessWorkerServiceName returns the name of the headless service used to register ray worker pods.

func HorizontalPodAutoscalerObjectMeta

func HorizontalPodAutoscalerObjectMeta(rc *dcv1alpha1.RayCluster) metav1.ObjectMeta

HorizontalPodAutoscalerObjectMeta returns the ObjectMeta object used to identify new HPA objects.

func InstanceObjectName

func InstanceObjectName(instance string, comp Component) string

InstanceObjectName returns the name that will be used to create most owned cluster resources.

func MetadataLabels

func MetadataLabels(rc *dcv1alpha1.RayCluster) map[string]string

MetadataLabels returns standard metadata for ray resources.

func MetadataLabelsWithComponent

func MetadataLabelsWithComponent(rc *dcv1alpha1.RayCluster, comp Component) map[string]string

MetadataLabelsWithComponent returns standard component metadata for ray resources.

func NewClientService

func NewClientService(rc *dcv1alpha1.RayCluster) *corev1.Service

NewClientService creates a ClusterIP service that points to the head node that exposes the client server port, and dashboard port when enabled.

func NewClusterNetworkPolicy

func NewClusterNetworkPolicy(rc *dcv1alpha1.RayCluster) *networkingv1.NetworkPolicy

NewClusterNetworkPolicy generates a network policy that allows all nodes within a single cluster to communicate on all ports.

func NewHeadClientNetworkPolicy

func NewHeadClientNetworkPolicy(rc *dcv1alpha1.RayCluster) *networkingv1.NetworkPolicy

NewHeadClientNetworkPolicy generates a network policy that allows client access to any pods that have been appointed with the configured client server labels.

func NewHeadDashboardNetworkPolicy

func NewHeadDashboardNetworkPolicy(rc *dcv1alpha1.RayCluster) *networkingv1.NetworkPolicy

NewHeadDashboardNetworkPolicy generates a network policy that allows dashboard access to any pods that have been appointed with configured dashboard labels.

func NewHeadlessHeadService

func NewHeadlessHeadService(rc *dcv1alpha1.RayCluster) *corev1.Service

NewHeadlessHeadService creates a headless service that points to the head node and exposes cluster communication ports.

func NewHeadlessWorkerService

func NewHeadlessWorkerService(rc *dcv1alpha1.RayCluster) *corev1.Service

NewHeadlessWorkerService creates a headless service that points to the worker nodes and exposes cluster communication ports.

func NewHorizontalPodAutoscaler

func NewHorizontalPodAutoscaler(rc *dcv1alpha1.RayCluster) (*autoscalingv2.HorizontalPodAutoscaler, error)

NewHorizontalPodAutoscaler generates an HPA that targets a RayCluster resource.

The metrics-server needs to be launched separately and the worker stateful set requires cpu resource requests in order for this object to have any effect.

func NewPodSecurityPolicyRBAC

func NewPodSecurityPolicyRBAC(rc *dcv1alpha1.RayCluster) (*rbacv1.Role, *rbacv1.RoleBinding)

NewPodSecurityPolicyRBAC generates the role and role binding required to use a pod security policy. The role is bound to the service account used by the ray cluster pods.

func NewServiceAccount

func NewServiceAccount(rc *dcv1alpha1.RayCluster) *corev1.ServiceAccount

NewServiceAccount generates a service account resource without API access.

func NewStatefulSet

func NewStatefulSet(rc *dcv1alpha1.RayCluster, comp Component, istioEnabled bool) (*appsv1.StatefulSet, error)

func SelectorLabels

func SelectorLabels(rc *dcv1alpha1.RayCluster) map[string]string

SelectorLabels returns a resource selector clause for ray resources.

func SelectorLabelsWithComponent

func SelectorLabelsWithComponent(rc *dcv1alpha1.RayCluster, comp Component) map[string]string

SelectorLabelsWithComponent returns a resource component selector clause for ray resources.

Types

type Component

type Component string

Component is used to drive Kubernetes object generation for different ray types.

const (
	// ComponentNone indicates a generic ray resource.
	ComponentNone Component = "none"
	// ComponentHead indicates a ray head resource.
	ComponentHead Component = "head"
	// ComponentWorker indicates a ray worker resource.
	ComponentWorker Component = "worker"
	// ApplicationName defines the static name used to generate ray object metadata.
	ApplicationName = "ray"
)

Jump to

Keyboard shortcuts

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