Documentation ¶
Index ¶
- Constants
- Variables
- func AppWrapper(t Test, namespace *corev1.Namespace, name string) func(g gomega.Gomega) *mcadv1beta2.AppWrapper
- func AppWrapperName(aw *mcadv1beta2.AppWrapper) string
- func AppWrapperPhase(aw *mcadv1beta2.AppWrapper) mcadv1beta2.AppWrapperPhase
- func AppWrappers(t Test, namespace *corev1.Namespace) func(g gomega.Gomega) []*mcadv1beta2.AppWrapper
- func ConditionStatus[T conditionType](conditionType T) func(any) corev1.ConditionStatus
- func CreateClusterRole(t Test, policyRules []rbacv1.PolicyRule) *rbacv1.ClusterRole
- func CreateClusterRoleBinding(t Test, serviceAccount *corev1.ServiceAccount, role *rbacv1.ClusterRole) *rbacv1.ClusterRoleBinding
- func CreateConfigMap(t Test, namespace string, content map[string][]byte) *corev1.ConfigMap
- func CreateKueueClusterQueue(t Test, clusterQueueSpec kueuev1beta1.ClusterQueueSpec) *kueuev1beta1.ClusterQueue
- func CreateKueueLocalQueue(t Test, namespace, clusterQueueName string) *kueuev1beta1.LocalQueue
- func CreateKueueResourceFlavor(t Test, resourceFlavorSpec kueuev1beta1.ResourceFlavorSpec) *kueuev1beta1.ResourceFlavor
- func CreateOCMConnection(test Test) *ocmsdk.Connection
- func CreatePersistentVolumeClaim(t Test, namespace string, storageSize string, ...) *corev1.PersistentVolumeClaim
- func CreateRole(t Test, namespace string, policyRules []rbacv1.PolicyRule) *rbacv1.Role
- func CreateRoleBinding(t Test, namespace string, serviceAccount *corev1.ServiceAccount, ...) *rbacv1.RoleBinding
- func CreateServiceAccount(t Test, namespace string) *corev1.ServiceAccount
- func CreateTestNamespaceWithName(t Test, namespaceName string, options ...Option[*corev1.Namespace]) *corev1.Namespace
- func CreateToken(t Test, namespace string, serviceAccount *corev1.ServiceAccount) string
- func CreateUserClusterRoleBinding(t Test, userName string, role *rbacv1.ClusterRole) *rbacv1.ClusterRoleBinding
- func CreateUserRoleBinding(t Test, namespace string, userName string, role *rbacv1.Role) *rbacv1.RoleBinding
- func DeleteTestNamespace(t Test, namespace *corev1.Namespace)
- func ExposeService(t Test, name string, namespace string, serviceName string, servicePort string) url.URL
- func ExposeServiceByIngress(t Test, name string, namespace string, serviceName string, servicePort string) url.URL
- func ExposeServiceByRoute(t Test, name string, namespace string, serviceName string, servicePort string) url.URL
- func GetAppWrapper(t Test, namespace *corev1.Namespace, name string) *mcadv1beta2.AppWrapper
- func GetClusterHostname(t Test) string
- func GetClusterId() (string, bool)
- func GetCodeFlareSDKVersion() string
- func GetImageStream(t Test, namespace string, name string) *imagev1.ImageStream
- func GetIngress(t Test, namespace, name string) *networkingv1.Ingress
- func GetInstascaleOcmSecret() (string, string)
- func GetJob(t Test, namespace, name string) *batchv1.Job
- func GetKueueWorkloads(t Test, namespace string) []*kueuev1beta1.Workload
- func GetMachinePools(t Test, connection *ocmsdk.Connection) []*cmv1.MachinePool
- func GetMachineSets(t Test) ([]machinev1beta1.MachineSet, error)
- func GetMachines(t Test, machineSetName string) []machinev1beta1.Machine
- func GetMnistDatasetURL() string
- func GetNamespaceWithName(t Test, namespaceName string) *corev1.Namespace
- func GetNodeInternalIP(t Test, node corev1.Node) (IP string)
- func GetNodePools(t Test, connection *ocmsdk.Connection) []*cmv1.NodePool
- func GetNodes(t Test) []corev1.Node
- func GetOpenShiftApiUrl(test Test) string
- func GetOpenShiftIngressDomain(test Test) string
- func GetPipIndexURL() string
- func GetPipTrustedHost() string
- func GetPodLogs(t Test, pod *corev1.Pod, options corev1.PodLogOptions) []byte
- func GetPods(t Test, namespace string, options metav1.ListOptions) []corev1.Pod
- func GetPyTorchImage() string
- func GetRayCluster(t Test, namespace, name string) *rayv1.RayCluster
- func GetRayClusters(t Test, namespace string) []*rayv1.RayCluster
- func GetRayImage() string
- func GetRayJob(t Test, namespace, name string) *rayv1.RayJob
- func GetRayJobAPIDetailsStatus(jobDetails *RayJobDetailsResponse) string
- func GetRayJobId(t Test, namespace, name string) string
- func GetRayVersion() string
- func GetRoute(t Test, namespace, name string) *routev1.Route
- func Ingress(t Test, namespace, name string) func(g gomega.Gomega) *networkingv1.Ingress
- func IsOpenShift(test Test) bool
- func Job(t Test, namespace, name string) func(g gomega.Gomega) *batchv1.Job
- func KueueWorkloadAdmitted(workload *kueuev1beta1.Workload) bool
- func LoadBalancerIngresses(ingress *networkingv1.Ingress) []networkingv1.IngressLoadBalancerIngress
- func MachinePoolId(machinePool *cmv1.MachinePool) string
- func MachinePoolLabels(machinePool *cmv1.MachinePool) map[string]string
- func MachinePools(t Test, connection *ocmsdk.Connection) func(g gomega.Gomega) []*cmv1.MachinePool
- func MachineSet(t Test, namespace string, machineSetName string) func(g gomega.Gomega) *machinev1beta1.MachineSet
- func MachineSetId(machineSet machinev1beta1.MachineSet) string
- func MachineSetReplicas(machineSet *machinev1beta1.MachineSet) *int32
- func Machines(t Test, machineSetName string) func(g gomega.Gomega) []machinev1beta1.Machine
- func NodePoolLabels(nodePool *cmv1.NodePool) map[string]string
- func NodePools(t Test, connection *ocmsdk.Connection) func(g gomega.Gomega) []*cmv1.NodePool
- func Ptr[T any](v T) *T
- func Raw(t Test, obj runtime.Object) runtime.RawExtension
- func RayCluster(t Test, namespace, name string) func(g gomega.Gomega) *rayv1.RayCluster
- func RayClusterState(cluster *rayv1.RayCluster) rayv1.ClusterState
- func RayClusters(t Test, namespace string) func(g gomega.Gomega) []*rayv1.RayCluster
- func RayJob(t Test, namespace, name string) func(g gomega.Gomega) *rayv1.RayJob
- func RayJobAPIDetails(t Test, rayClient RayClusterClient, jobID string) func(g gomega.Gomega) *RayJobDetailsResponse
- func RayJobId(job *rayv1.RayJob) string
- func RayJobStatus(job *rayv1.RayJob) rayv1.JobStatus
- func Route(t Test, namespace, name string) func(g gomega.Gomega) *routev1.Route
- func StoreNamespaceLogs(t Test, namespace *corev1.Namespace)
- func WriteRayJobAPILogs(t Test, rayClient RayClusterClient, jobID string)
- func WriteRayJobLogs(t Test, rayClient RayClusterClient, namespace, name string)
- func WriteToOutputDir(t Test, fileName string, fileType OutputType, data []byte)
- type Client
- type ClusterType
- type Option
- type OutputType
- type RayClusterClient
- type RayJobDetailsResponse
- type RayJobLogsResponse
- type RayJobResponse
- type RayJobSetup
- type T
- type Test
Constants ¶
View Source
const ( CodeFlareSDKVersion = "0.12.0" RayVersion = "2.5.0" RayImage = "quay.io/project-codeflare/ray:latest-py39-cu118" )
View Source
const ( CodeFlareTestSdkVersion = "CODEFLARE_TEST_SDK_VERSION" CodeFlareTestRayVersion = "CODEFLARE_TEST_RAY_VERSION" CodeFlareTestRayImage = "CODEFLARE_TEST_RAY_IMAGE" CodeFlareTestPyTorchImage = "CODEFLARE_TEST_PYTORCH_IMAGE" // The testing output directory, to write output files into. CodeFlareTestOutputDir = "CODEFLARE_TEST_OUTPUT_DIR" // The namespace where a secret containing InstaScale OCM token is stored and the secret name. InstaScaleOcmSecret = "INSTASCALE_OCM_SECRET" // Cluster ID for OSD cluster used in tests, used for testing InstaScale ClusterID = "CLUSTERID" // Type of cluster test is run on ClusterTypeEnvVar = "CLUSTER_TYPE" // Hostname of the Kubernetes cluster ClusterHostname = "CLUSTER_HOSTNAME" )
View Source
const RayJobDefaultClusterSelectorKey = "ray.io/cluster"
Variables ¶
Functions ¶
func AppWrapper ¶
func AppWrapper(t Test, namespace *corev1.Namespace, name string) func(g gomega.Gomega) *mcadv1beta2.AppWrapper
func AppWrapperName ¶
func AppWrapperName(aw *mcadv1beta2.AppWrapper) string
func AppWrapperPhase ¶
func AppWrapperPhase(aw *mcadv1beta2.AppWrapper) mcadv1beta2.AppWrapperPhase
func AppWrappers ¶
func AppWrappers(t Test, namespace *corev1.Namespace) func(g gomega.Gomega) []*mcadv1beta2.AppWrapper
func ConditionStatus ¶
func ConditionStatus[T conditionType](conditionType T) func(any) corev1.ConditionStatus
func CreateClusterRole ¶
func CreateClusterRole(t Test, policyRules []rbacv1.PolicyRule) *rbacv1.ClusterRole
func CreateClusterRoleBinding ¶
func CreateClusterRoleBinding(t Test, serviceAccount *corev1.ServiceAccount, role *rbacv1.ClusterRole) *rbacv1.ClusterRoleBinding
func CreateConfigMap ¶
func CreateKueueClusterQueue ¶
func CreateKueueClusterQueue(t Test, clusterQueueSpec kueuev1beta1.ClusterQueueSpec) *kueuev1beta1.ClusterQueue
func CreateKueueLocalQueue ¶
func CreateKueueLocalQueue(t Test, namespace, clusterQueueName string) *kueuev1beta1.LocalQueue
func CreateKueueResourceFlavor ¶
func CreateKueueResourceFlavor(t Test, resourceFlavorSpec kueuev1beta1.ResourceFlavorSpec) *kueuev1beta1.ResourceFlavor
func CreateOCMConnection ¶
func CreateOCMConnection(test Test) *ocmsdk.Connection
func CreatePersistentVolumeClaim ¶
func CreatePersistentVolumeClaim(t Test, namespace string, storageSize string, accessMode ...corev1.PersistentVolumeAccessMode) *corev1.PersistentVolumeClaim
func CreateRole ¶
func CreateRoleBinding ¶
func CreateRoleBinding(t Test, namespace string, serviceAccount *corev1.ServiceAccount, role *rbacv1.Role) *rbacv1.RoleBinding
func CreateServiceAccount ¶
func CreateServiceAccount(t Test, namespace string) *corev1.ServiceAccount
func CreateToken ¶
func CreateToken(t Test, namespace string, serviceAccount *corev1.ServiceAccount) string
func CreateUserClusterRoleBinding ¶
func CreateUserClusterRoleBinding(t Test, userName string, role *rbacv1.ClusterRole) *rbacv1.ClusterRoleBinding
func CreateUserRoleBinding ¶
func DeleteTestNamespace ¶
func ExposeService ¶
func ExposeServiceByIngress ¶
func ExposeServiceByRoute ¶
func GetAppWrapper ¶
func GetAppWrapper(t Test, namespace *corev1.Namespace, name string) *mcadv1beta2.AppWrapper
func GetClusterHostname ¶
func GetClusterId ¶
func GetCodeFlareSDKVersion ¶
func GetCodeFlareSDKVersion() string
func GetImageStream ¶
func GetImageStream(t Test, namespace string, name string) *imagev1.ImageStream
func GetIngress ¶
func GetIngress(t Test, namespace, name string) *networkingv1.Ingress
func GetInstascaleOcmSecret ¶
func GetKueueWorkloads ¶
func GetKueueWorkloads(t Test, namespace string) []*kueuev1beta1.Workload
func GetMachinePools ¶
func GetMachinePools(t Test, connection *ocmsdk.Connection) []*cmv1.MachinePool
func GetMachineSets ¶
func GetMachineSets(t Test) ([]machinev1beta1.MachineSet, error)
func GetMachines ¶
func GetMachines(t Test, machineSetName string) []machinev1beta1.Machine
func GetMnistDatasetURL ¶
func GetMnistDatasetURL() string
func GetNamespaceWithName ¶
func GetNodePools ¶
func GetNodePools(t Test, connection *ocmsdk.Connection) []*cmv1.NodePool
func GetOpenShiftApiUrl ¶
func GetPipIndexURL ¶
func GetPipIndexURL() string
func GetPipTrustedHost ¶
func GetPipTrustedHost() string
func GetPodLogs ¶
func GetPyTorchImage ¶
func GetPyTorchImage() string
func GetRayCluster ¶
func GetRayCluster(t Test, namespace, name string) *rayv1.RayCluster
func GetRayClusters ¶
func GetRayClusters(t Test, namespace string) []*rayv1.RayCluster
func GetRayImage ¶
func GetRayImage() string
func GetRayJobAPIDetailsStatus ¶
func GetRayJobAPIDetailsStatus(jobDetails *RayJobDetailsResponse) string
func GetRayJobId ¶
func GetRayVersion ¶
func GetRayVersion() string
func IsOpenShift ¶
func KueueWorkloadAdmitted ¶
func KueueWorkloadAdmitted(workload *kueuev1beta1.Workload) bool
func LoadBalancerIngresses ¶
func LoadBalancerIngresses(ingress *networkingv1.Ingress) []networkingv1.IngressLoadBalancerIngress
func MachinePoolId ¶
func MachinePoolId(machinePool *cmv1.MachinePool) string
func MachinePoolLabels ¶
func MachinePoolLabels(machinePool *cmv1.MachinePool) map[string]string
func MachinePools ¶
func MachinePools(t Test, connection *ocmsdk.Connection) func(g gomega.Gomega) []*cmv1.MachinePool
func MachineSet ¶
func MachineSet(t Test, namespace string, machineSetName string) func(g gomega.Gomega) *machinev1beta1.MachineSet
func MachineSetId ¶
func MachineSetId(machineSet machinev1beta1.MachineSet) string
func MachineSetReplicas ¶
func MachineSetReplicas(machineSet *machinev1beta1.MachineSet) *int32
func RayCluster ¶
func RayClusterState ¶
func RayClusterState(cluster *rayv1.RayCluster) rayv1.ClusterState
func RayClusters ¶
func RayJobAPIDetails ¶
func RayJobAPIDetails(t Test, rayClient RayClusterClient, jobID string) func(g gomega.Gomega) *RayJobDetailsResponse
func StoreNamespaceLogs ¶
func WriteRayJobAPILogs ¶
func WriteRayJobAPILogs(t Test, rayClient RayClusterClient, jobID string)
func WriteRayJobLogs ¶
func WriteRayJobLogs(t Test, rayClient RayClusterClient, namespace, name string)
func WriteToOutputDir ¶
func WriteToOutputDir(t Test, fileName string, fileType OutputType, data []byte)
Types ¶
type ClusterType ¶
type ClusterType string
const ( OsdCluster ClusterType = "OSD" OcpCluster ClusterType = "OCP" HypershiftCluster ClusterType = "HYPERSHIFT" KindCluster ClusterType = "KIND" UndefinedCluster ClusterType = "UNDEFINED" )
func GetClusterType ¶
func GetClusterType(t Test) ClusterType
type RayClusterClient ¶
type RayClusterClient interface { CreateJob(job *RayJobSetup) (*RayJobResponse, error) GetJobDetails(jobID string) (*RayJobDetailsResponse, error) GetJobLogs(jobID string) (string, error) }
func NewRayClusterClient ¶
func NewRayClusterClient(dashboardEndpoint url.URL) RayClusterClient
type RayJobDetailsResponse ¶
type RayJobDetailsResponse struct { JobID string `json:"job_id"` SubmissionID string `json:"submission_id"` Status string `json:"status"` }
func GetRayJobAPIDetails ¶
func GetRayJobAPIDetails(t Test, rayClient RayClusterClient, jobID string) *RayJobDetailsResponse
type RayJobLogsResponse ¶
type RayJobLogsResponse struct {
Logs string `json:"logs"`
}
type RayJobResponse ¶
type RayJobSetup ¶
type T ¶
func (*T) NewTestNamespace ¶
Source Files ¶
- appwrapper.go
- authentication.go
- batch.go
- client.go
- conditions.go
- config.go
- core.go
- defaults.go
- environment.go
- events.go
- fakeclient.go
- image.go
- ingress.go
- kueue.go
- machine.go
- namespace.go
- ocm.go
- openshift.go
- ray.go
- ray_api.go
- ray_cluster_client.go
- rbac.go
- route.go
- service.go
- support.go
- test.go
- utils.go
Click to show internal directories.
Click to hide internal directories.