support

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeFlareTestSdkVersion   = "CODEFLARE_TEST_SDK_VERSION"
	CodeFlareTestRayVersion   = "CODEFLARE_TEST_RAY_VERSION"
	CodeFlareTestRayImage     = "CODEFLARE_TEST_RAY_IMAGE"
	CodeFlareTestPyTorchImage = "CODEFLARE_TEST_PYTORCH_IMAGE"

	CodeFlareTestOutputDir = "CODEFLARE_TEST_OUTPUT_DIR"
)
View Source
const (
	CodeFlareSDKVersion = "0.4.4"
	RayVersion          = "2.5.0"
	RayImage            = "rayproject/ray:2.5.0"
)
View Source
const RayJobDefaultClusterSelectorKey = "ray.io/cluster"

Variables

View Source
var (
	TestTimeoutShort  = 1 * time.Minute
	TestTimeoutMedium = 2 * time.Minute
	TestTimeoutLong   = 5 * time.Minute

	ApplyOptions = metav1.ApplyOptions{FieldManager: "codeflare-test", Force: true}
)

Functions

func AppWrapper

func AppWrapper(t Test, namespace *corev1.Namespace, name string) func(g gomega.Gomega) *mcadv1beta1.AppWrapper

func ConditionStatus

func ConditionStatus[T conditionType](conditionType T) func(any) corev1.ConditionStatus

func GetCodeFlareSDKVersion

func GetCodeFlareSDKVersion() string

func GetJob

func GetJob(t Test, namespace, name string) *batchv1.Job

func GetPodLogs

func GetPodLogs(t Test, pod *corev1.Pod, options corev1.PodLogOptions) []byte

func GetPods

func GetPods(t Test, namespace string, options metav1.ListOptions) []corev1.Pod

func GetPyTorchImage

func GetPyTorchImage() string

func GetRayImage

func GetRayImage() string

func GetRayJob

func GetRayJob(t Test, namespace, name string) *rayv1alpha1.RayJob

func GetRayJobLogs

func GetRayJobLogs(t Test, namespace, name string) []byte

func GetRayVersion

func GetRayVersion() string

func IsOpenShift

func IsOpenShift(test Test) bool

func Job

func Job(t Test, namespace, name string) func(g gomega.Gomega) *batchv1.Job

func Ptr

func Ptr[T any](v T) *T

func Raw

func RayJob

func RayJob(t Test, namespace, name string) func(g gomega.Gomega) *rayv1alpha1.RayJob

func RayJobStatus

func RayJobStatus(job *rayv1alpha1.RayJob) rayv1alpha1.JobStatus

func WriteJobLogs

func WriteJobLogs(t Test, namespace, name string)

func WriteRayJobLogs

func WriteRayJobLogs(t Test, namespace, name string)

func WriteToOutputDir

func WriteToOutputDir(t Test, fileName string, fileType OutputType, data []byte)

Types

type Client

type Client interface {
	Core() kubernetes.Interface
	CodeFlare() codeflareclient.Interface
	MCAD() mcadclient.Interface
	Ray() rayclient.Interface
}

type Option

type Option[T any] interface {
	// contains filtered or unexported methods
}

type OutputType

type OutputType string
const (
	Log OutputType = "log"
)

type T

type T struct {
	*gomega.WithT
	// contains filtered or unexported fields
}

func (*T) Client

func (t *T) Client() Client

func (*T) Ctx

func (t *T) Ctx() context.Context

func (*T) NewTestNamespace

func (t *T) NewTestNamespace(options ...Option[*corev1.Namespace]) *corev1.Namespace

func (*T) OutputDir

func (t *T) OutputDir() string

func (*T) T

func (t *T) T() *testing.T

type Test

type Test interface {
	T() *testing.T
	Ctx() context.Context
	Client() Client
	OutputDir() string

	gomega.Gomega

	NewTestNamespace(...Option[*corev1.Namespace]) *corev1.Namespace
}

func With

func With(t *testing.T) Test

Jump to

Keyboard shortcuts

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