From 97cd61c74e26085200d11eb60200bd3bb9502806 Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Tue, 17 Oct 2023 15:50:34 +0100 Subject: [PATCH 1/3] Replaced rayv1alpha1 with rayv1 --- test/e2e/mnist_raycluster_sdk_test.go | 4 ++-- test/e2e/mnist_rayjob_mcad_raycluster_test.go | 24 +++++++++---------- test/support/ray.go | 22 ++++++++--------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/test/e2e/mnist_raycluster_sdk_test.go b/test/e2e/mnist_raycluster_sdk_test.go index e96110651..29643fe67 100644 --- a/test/e2e/mnist_raycluster_sdk_test.go +++ b/test/e2e/mnist_raycluster_sdk_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" mcadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" - rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" + rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -102,7 +102,7 @@ func TestMNISTRayClusterSDK(t *testing.T) { }, { Verbs: []string{"get", "list"}, - APIGroups: []string{rayv1alpha1.GroupVersion.Group}, + APIGroups: []string{rayv1.GroupVersion.Group}, Resources: []string{"rayclusters", "rayclusters/status"}, }, { diff --git a/test/e2e/mnist_rayjob_mcad_raycluster_test.go b/test/e2e/mnist_rayjob_mcad_raycluster_test.go index 7752d2eab..a7956f66e 100644 --- a/test/e2e/mnist_rayjob_mcad_raycluster_test.go +++ b/test/e2e/mnist_rayjob_mcad_raycluster_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" mcadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" - rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" + rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -60,18 +60,18 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) { test.T().Logf("Created ConfigMap %s/%s successfully", mnist.Namespace, mnist.Name) // RayCluster - rayCluster := &rayv1alpha1.RayCluster{ + rayCluster := &rayv1.RayCluster{ TypeMeta: metav1.TypeMeta{ - APIVersion: rayv1alpha1.GroupVersion.String(), + APIVersion: rayv1.GroupVersion.String(), Kind: "RayCluster", }, ObjectMeta: metav1.ObjectMeta{ Name: "raycluster", Namespace: namespace.Name, }, - Spec: rayv1alpha1.RayClusterSpec{ + Spec: rayv1.RayClusterSpec{ RayVersion: GetRayVersion(), - HeadGroupSpec: rayv1alpha1.HeadGroupSpec{ + HeadGroupSpec: rayv1.HeadGroupSpec{ RayStartParams: map[string]string{ "dashboard-host": "0.0.0.0", }, @@ -135,7 +135,7 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) { }, }, }, - WorkerGroupSpecs: []rayv1alpha1.WorkerGroupSpec{ + WorkerGroupSpecs: []rayv1.WorkerGroupSpec{ { Replicas: Ptr(int32(1)), MinReplicas: Ptr(int32(1)), @@ -220,16 +220,16 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) { test.Eventually(AppWrapper(test, namespace, aw.Name), TestTimeoutMedium). Should(WithTransform(AppWrapperState, Equal(mcadv1beta1.AppWrapperStateActive))) - rayJob := &rayv1alpha1.RayJob{ + rayJob := &rayv1.RayJob{ TypeMeta: metav1.TypeMeta{ - APIVersion: rayv1alpha1.GroupVersion.String(), + APIVersion: rayv1.GroupVersion.String(), Kind: "RayJob", }, ObjectMeta: metav1.ObjectMeta{ Name: "mnist", Namespace: namespace.Name, }, - Spec: rayv1alpha1.RayJobSpec{ + Spec: rayv1.RayJobSpec{ Entrypoint: "python /home/ray/jobs/mnist.py", RuntimeEnv: base64.StdEncoding.EncodeToString([]byte(` { @@ -248,7 +248,7 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) { ShutdownAfterJobFinishes: false, }, } - rayJob, err = test.Client().Ray().RayV1alpha1().RayJobs(namespace.Name).Create(test.Ctx(), rayJob, metav1.CreateOptions{}) + rayJob, err = test.Client().Ray().RayV1().RayJobs(namespace.Name).Create(test.Ctx(), rayJob, metav1.CreateOptions{}) test.Expect(err).NotTo(HaveOccurred()) test.T().Logf("Created RayJob %s/%s successfully", rayJob.Namespace, rayJob.Name) @@ -262,9 +262,9 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) { test.T().Logf("Waiting for RayJob %s/%s to complete", rayJob.Namespace, rayJob.Name) test.Eventually(RayJob(test, rayJob.Namespace, rayJob.Name), TestTimeoutLong). - Should(WithTransform(RayJobStatus, Satisfy(rayv1alpha1.IsJobTerminal))) + Should(WithTransform(RayJobStatus, Satisfy(rayv1.IsJobTerminal))) // Assert the Ray job has completed successfully test.Expect(GetRayJob(test, rayJob.Namespace, rayJob.Name)). - To(WithTransform(RayJobStatus, Equal(rayv1alpha1.JobStatusSucceeded))) + To(WithTransform(RayJobStatus, Equal(rayv1.JobStatusSucceeded))) } diff --git a/test/support/ray.go b/test/support/ray.go index b69609aef..f18edaa03 100644 --- a/test/support/ray.go +++ b/test/support/ray.go @@ -18,27 +18,27 @@ package support import ( "github.com/onsi/gomega" - rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" + rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const RayJobDefaultClusterSelectorKey = "ray.io/cluster" -func RayJob(t Test, namespace, name string) func(g gomega.Gomega) *rayv1alpha1.RayJob { - return func(g gomega.Gomega) *rayv1alpha1.RayJob { - job, err := t.Client().Ray().RayV1alpha1().RayJobs(namespace).Get(t.Ctx(), name, metav1.GetOptions{}) +func RayJob(t Test, namespace, name string) func(g gomega.Gomega) *rayv1.RayJob { + return func(g gomega.Gomega) *rayv1.RayJob { + job, err := t.Client().Ray().RayV1().RayJobs(namespace).Get(t.Ctx(), name, metav1.GetOptions{}) g.Expect(err).NotTo(gomega.HaveOccurred()) return job } } -func GetRayJob(t Test, namespace, name string) *rayv1alpha1.RayJob { +func GetRayJob(t Test, namespace, name string) *rayv1.RayJob { t.T().Helper() return RayJob(t, namespace, name)(t) } -func RayJobStatus(job *rayv1alpha1.RayJob) rayv1alpha1.JobStatus { +func RayJobStatus(job *rayv1.RayJob) rayv1.JobStatus { return job.Status.JobStatus } @@ -48,20 +48,20 @@ func GetRayJobId(t Test, namespace, name string) string { return job.Status.JobId } -func RayCluster(t Test, namespace, name string) func(g gomega.Gomega) *rayv1alpha1.RayCluster { - return func(g gomega.Gomega) *rayv1alpha1.RayCluster { - cluster, err := t.Client().Ray().RayV1alpha1().RayClusters(namespace).Get(t.Ctx(), name, metav1.GetOptions{}) +func RayCluster(t Test, namespace, name string) func(g gomega.Gomega) *rayv1.RayCluster { + return func(g gomega.Gomega) *rayv1.RayCluster { + cluster, err := t.Client().Ray().RayV1().RayClusters(namespace).Get(t.Ctx(), name, metav1.GetOptions{}) g.Expect(err).NotTo(gomega.HaveOccurred()) return cluster } } -func GetRayCluster(t Test, namespace, name string) *rayv1alpha1.RayCluster { +func GetRayCluster(t Test, namespace, name string) *rayv1.RayCluster { t.T().Helper() return RayCluster(t, namespace, name)(t) } -func RayClusterState(cluster *rayv1alpha1.RayCluster) rayv1alpha1.ClusterState { +func RayClusterState(cluster *rayv1.RayCluster) rayv1.ClusterState { return cluster.Status.State } From 043c40afe8c301d3c88a415741dbf3cb2273c45f Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Tue, 17 Oct 2023 16:02:01 +0100 Subject: [PATCH 2/3] Added missing go files --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9166e25a2..08f3cb317 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/openshift/client-go v0.0.0-20221019143426-16aed247da5c github.com/project-codeflare/instascale v0.1.0 github.com/project-codeflare/multi-cluster-app-dispatcher v1.36.0 - github.com/ray-project/kuberay/ray-operator v0.0.0-20231012011224-15ce568a0c36 + github.com/ray-project/kuberay/ray-operator v0.0.0-20231016183545-097828931d15 go.uber.org/zap v1.26.0 k8s.io/api v0.26.3 k8s.io/apimachinery v0.26.3 diff --git a/go.sum b/go.sum index f5d91a72c..2c53de1ce 100644 --- a/go.sum +++ b/go.sum @@ -420,8 +420,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/ray-project/kuberay/ray-operator v0.0.0-20231012011224-15ce568a0c36 h1:IzXHzI4OjL1ySpvmPHTWjFjmgBBjAZXBa3cQwejLPWY= -github.com/ray-project/kuberay/ray-operator v0.0.0-20231012011224-15ce568a0c36/go.mod h1:NDvscwYbeLSh+Cfc2UTeyPWODtNKPCsPjD/2kg3ZXPw= +github.com/ray-project/kuberay/ray-operator v0.0.0-20231016183545-097828931d15 h1:s+/WzpqoFot/fgo1uq7BLgeiOy3HZuT+UVtCb3h7R+I= +github.com/ray-project/kuberay/ray-operator v0.0.0-20231016183545-097828931d15/go.mod h1:NDvscwYbeLSh+Cfc2UTeyPWODtNKPCsPjD/2kg3ZXPw= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= From 0b5fc8374c36ad3e1aca6463a79fb905c904ca8f Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Tue, 17 Oct 2023 16:08:16 +0100 Subject: [PATCH 3/3] Updated KubeRay version in MakeFile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 725b661aa..4dcd3618f 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ MCAD_REPO ?= github.com/project-codeflare/multi-cluster-app-dispatcher MCAD_CRD ?= ${MCAD_REPO}/config/crd?ref=${MCAD_VERSION} # KUBERAY_VERSION defines the default version of the KubeRay operator (used for testing) -KUBERAY_VERSION ?= v0.6.0 +KUBERAY_VERSION ?= v1.0.0-rc.1 # RAY_VERSION defines the default version of Ray (used for testing) RAY_VERSION ?= 2.5.0