Skip to content

Replaced rayv1alpha1 with rayv1 #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/mnist_raycluster_sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"},
},
{
Expand Down
24 changes: 12 additions & 12 deletions test/e2e/mnist_rayjob_mcad_raycluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) {
},
},
},
WorkerGroupSpecs: []rayv1alpha1.WorkerGroupSpec{
WorkerGroupSpecs: []rayv1.WorkerGroupSpec{
{
Replicas: Ptr(int32(1)),
MinReplicas: Ptr(int32(1)),
Expand Down Expand Up @@ -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(`
{
Expand All @@ -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)

Expand All @@ -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)))
}
22 changes: 11 additions & 11 deletions test/support/ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down