Skip to content

Commit 5a0bb17

Browse files
Bobbins228openshift-ci[bot]
authored andcommitted
Replaced rayv1alpha1 with rayv1
1 parent ea777c6 commit 5a0bb17

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

test/e2e/mnist_raycluster_sdk_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
. "github.com/onsi/gomega"
2323
mcadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
24-
rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1"
24+
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
2525

2626
batchv1 "k8s.io/api/batch/v1"
2727
corev1 "k8s.io/api/core/v1"
@@ -102,7 +102,7 @@ func TestMNISTRayClusterSDK(t *testing.T) {
102102
},
103103
{
104104
Verbs: []string{"get", "list"},
105-
APIGroups: []string{rayv1alpha1.GroupVersion.Group},
105+
APIGroups: []string{rayv1.GroupVersion.Group},
106106
Resources: []string{"rayclusters", "rayclusters/status"},
107107
},
108108
{

test/e2e/mnist_rayjob_mcad_raycluster_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
. "github.com/onsi/gomega"
2424
mcadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
25-
rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1"
25+
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
2626

2727
corev1 "k8s.io/api/core/v1"
2828
"k8s.io/apimachinery/pkg/api/resource"
@@ -60,18 +60,18 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) {
6060
test.T().Logf("Created ConfigMap %s/%s successfully", mnist.Namespace, mnist.Name)
6161

6262
// RayCluster
63-
rayCluster := &rayv1alpha1.RayCluster{
63+
rayCluster := &rayv1.RayCluster{
6464
TypeMeta: metav1.TypeMeta{
65-
APIVersion: rayv1alpha1.GroupVersion.String(),
65+
APIVersion: rayv1.GroupVersion.String(),
6666
Kind: "RayCluster",
6767
},
6868
ObjectMeta: metav1.ObjectMeta{
6969
Name: "raycluster",
7070
Namespace: namespace.Name,
7171
},
72-
Spec: rayv1alpha1.RayClusterSpec{
72+
Spec: rayv1.RayClusterSpec{
7373
RayVersion: GetRayVersion(),
74-
HeadGroupSpec: rayv1alpha1.HeadGroupSpec{
74+
HeadGroupSpec: rayv1.HeadGroupSpec{
7575
RayStartParams: map[string]string{
7676
"dashboard-host": "0.0.0.0",
7777
},
@@ -135,7 +135,7 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) {
135135
},
136136
},
137137
},
138-
WorkerGroupSpecs: []rayv1alpha1.WorkerGroupSpec{
138+
WorkerGroupSpecs: []rayv1.WorkerGroupSpec{
139139
{
140140
Replicas: Ptr(int32(1)),
141141
MinReplicas: Ptr(int32(1)),
@@ -220,16 +220,16 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) {
220220
test.Eventually(AppWrapper(test, namespace, aw.Name), TestTimeoutMedium).
221221
Should(WithTransform(AppWrapperState, Equal(mcadv1beta1.AppWrapperStateActive)))
222222

223-
rayJob := &rayv1alpha1.RayJob{
223+
rayJob := &rayv1.RayJob{
224224
TypeMeta: metav1.TypeMeta{
225-
APIVersion: rayv1alpha1.GroupVersion.String(),
225+
APIVersion: rayv1.GroupVersion.String(),
226226
Kind: "RayJob",
227227
},
228228
ObjectMeta: metav1.ObjectMeta{
229229
Name: "mnist",
230230
Namespace: namespace.Name,
231231
},
232-
Spec: rayv1alpha1.RayJobSpec{
232+
Spec: rayv1.RayJobSpec{
233233
Entrypoint: "python /home/ray/jobs/mnist.py",
234234
RuntimeEnv: base64.StdEncoding.EncodeToString([]byte(`
235235
{
@@ -248,7 +248,7 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) {
248248
ShutdownAfterJobFinishes: false,
249249
},
250250
}
251-
rayJob, err = test.Client().Ray().RayV1alpha1().RayJobs(namespace.Name).Create(test.Ctx(), rayJob, metav1.CreateOptions{})
251+
rayJob, err = test.Client().Ray().RayV1().RayJobs(namespace.Name).Create(test.Ctx(), rayJob, metav1.CreateOptions{})
252252
test.Expect(err).NotTo(HaveOccurred())
253253
test.T().Logf("Created RayJob %s/%s successfully", rayJob.Namespace, rayJob.Name)
254254

@@ -262,9 +262,9 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) {
262262

263263
test.T().Logf("Waiting for RayJob %s/%s to complete", rayJob.Namespace, rayJob.Name)
264264
test.Eventually(RayJob(test, rayJob.Namespace, rayJob.Name), TestTimeoutLong).
265-
Should(WithTransform(RayJobStatus, Satisfy(rayv1alpha1.IsJobTerminal)))
265+
Should(WithTransform(RayJobStatus, Satisfy(rayv1.IsJobTerminal)))
266266

267267
// Assert the Ray job has completed successfully
268268
test.Expect(GetRayJob(test, rayJob.Namespace, rayJob.Name)).
269-
To(WithTransform(RayJobStatus, Equal(rayv1alpha1.JobStatusSucceeded)))
269+
To(WithTransform(RayJobStatus, Equal(rayv1.JobStatusSucceeded)))
270270
}

test/support/ray.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ package support
1818

1919
import (
2020
"github.com/onsi/gomega"
21-
rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1"
21+
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
2222

2323
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424
)
2525

2626
const RayJobDefaultClusterSelectorKey = "ray.io/cluster"
2727

28-
func RayJob(t Test, namespace, name string) func(g gomega.Gomega) *rayv1alpha1.RayJob {
29-
return func(g gomega.Gomega) *rayv1alpha1.RayJob {
30-
job, err := t.Client().Ray().RayV1alpha1().RayJobs(namespace).Get(t.Ctx(), name, metav1.GetOptions{})
28+
func RayJob(t Test, namespace, name string) func(g gomega.Gomega) *rayv1.RayJob {
29+
return func(g gomega.Gomega) *rayv1.RayJob {
30+
job, err := t.Client().Ray().RayV1().RayJobs(namespace).Get(t.Ctx(), name, metav1.GetOptions{})
3131
g.Expect(err).NotTo(gomega.HaveOccurred())
3232
return job
3333
}
3434
}
3535

36-
func GetRayJob(t Test, namespace, name string) *rayv1alpha1.RayJob {
36+
func GetRayJob(t Test, namespace, name string) *rayv1.RayJob {
3737
t.T().Helper()
3838
return RayJob(t, namespace, name)(t)
3939
}
4040

41-
func RayJobStatus(job *rayv1alpha1.RayJob) rayv1alpha1.JobStatus {
41+
func RayJobStatus(job *rayv1.RayJob) rayv1.JobStatus {
4242
return job.Status.JobStatus
4343
}
4444

@@ -48,20 +48,20 @@ func GetRayJobId(t Test, namespace, name string) string {
4848
return job.Status.JobId
4949
}
5050

51-
func RayCluster(t Test, namespace, name string) func(g gomega.Gomega) *rayv1alpha1.RayCluster {
52-
return func(g gomega.Gomega) *rayv1alpha1.RayCluster {
53-
cluster, err := t.Client().Ray().RayV1alpha1().RayClusters(namespace).Get(t.Ctx(), name, metav1.GetOptions{})
51+
func RayCluster(t Test, namespace, name string) func(g gomega.Gomega) *rayv1.RayCluster {
52+
return func(g gomega.Gomega) *rayv1.RayCluster {
53+
cluster, err := t.Client().Ray().RayV1().RayClusters(namespace).Get(t.Ctx(), name, metav1.GetOptions{})
5454
g.Expect(err).NotTo(gomega.HaveOccurred())
5555
return cluster
5656
}
5757
}
5858

59-
func GetRayCluster(t Test, namespace, name string) *rayv1alpha1.RayCluster {
59+
func GetRayCluster(t Test, namespace, name string) *rayv1.RayCluster {
6060
t.T().Helper()
6161
return RayCluster(t, namespace, name)(t)
6262
}
6363

64-
func RayClusterState(cluster *rayv1alpha1.RayCluster) rayv1alpha1.ClusterState {
64+
func RayClusterState(cluster *rayv1.RayCluster) rayv1.ClusterState {
6565
return cluster.Status.State
6666
}
6767

0 commit comments

Comments
 (0)