Skip to content

Commit 4a2b1af

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 7bd6509 + 38b2fa4 commit 4a2b1af

File tree

6 files changed

+20
-40
lines changed

6 files changed

+20
-40
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.21.5
77
require (
88
github.com/kubeflow/training-operator v1.7.0
99
github.com/onsi/gomega v1.31.1
10-
github.com/project-codeflare/codeflare-common v0.0.0-20240905061421-272c8b361325
10+
github.com/project-codeflare/codeflare-common v0.0.0-20240913125822-2f60dc7b588c
1111
github.com/prometheus/client_golang v1.18.0
1212
github.com/prometheus/common v0.45.0
1313
github.com/ray-project/kuberay/ray-operator v1.1.0-alpha.0

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
363363
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
364364
github.com/project-codeflare/appwrapper v0.8.0 h1:vWHNtXUtHutN2EzYb6rryLdESnb8iDXsCokXOuNYXvg=
365365
github.com/project-codeflare/appwrapper v0.8.0/go.mod h1:FMQ2lI3fz6LakUVXgN1FTdpsc3BBkNIZZgtMmM9J5UM=
366-
github.com/project-codeflare/codeflare-common v0.0.0-20240829135229-4225111c401e h1:ozVW0icXLDJcKigc3Bi/4Fc4UMXMxESO53msCLameWw=
367-
github.com/project-codeflare/codeflare-common v0.0.0-20240829135229-4225111c401e/go.mod h1:unKTw+XoMANTES3WieG016im7rxZ7IR2/ph++L5Vp1Y=
368-
github.com/project-codeflare/codeflare-common v0.0.0-20240905061421-272c8b361325 h1:77e1P1PFUizHP9V/DiIa19Mp/ITPH8z4d4zirAcnFY8=
369-
github.com/project-codeflare/codeflare-common v0.0.0-20240905061421-272c8b361325/go.mod h1:unKTw+XoMANTES3WieG016im7rxZ7IR2/ph++L5Vp1Y=
366+
github.com/project-codeflare/codeflare-common v0.0.0-20240913125822-2f60dc7b588c h1:dtALMViz1KkOqHXNWy7fEXgX8CsT1YfopexQGkEzg/Q=
367+
github.com/project-codeflare/codeflare-common v0.0.0-20240913125822-2f60dc7b588c/go.mod h1:unKTw+XoMANTES3WieG016im7rxZ7IR2/ph++L5Vp1Y=
370368
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
371369
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
372370
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=

tests/odh/mnist_ray_test.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,21 +169,15 @@ func mnistRay(test Test, numGpus int, namespace *corev1.Namespace, rayImage stri
169169

170170
// Initialise raycluster client to interact with raycluster to get rayjob details using REST-API
171171
dashboardUrl := GetDashboardUrl(test, namespace, rayCluster)
172-
rayClusterClientConfig := RayClusterClientConfig{Address: dashboardUrl.String(), Client: nil, InsecureSkipVerify: true}
173-
rayClient, err := NewRayClusterClient(rayClusterClientConfig, test.Config().BearerToken)
174-
test.Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to create new raycluster client: %s", err))
172+
rayClient := GetRayClusterClient(test, dashboardUrl, test.Config().BearerToken)
175173

176174
// wait until rayjob exists
177175
test.Eventually(func() ([]RayJobDetailsResponse, error) {
178-
rayJobs, err := rayClient.GetJobs()
179-
if err != nil {
180-
return *rayJobs, err
181-
}
182-
return *rayJobs, nil
176+
return rayClient.ListJobs()
183177
}, TestTimeoutMedium, 1*time.Second).Should(HaveLen(1), "Ray job not found")
184178

185179
// Get test job-id
186-
jobID := GetTestJobId(test, rayClient, dashboardUrl.Host)
180+
jobID := GetTestJobId(test, rayClient)
187181
test.Expect(jobID).ToNot(BeEmpty())
188182

189183
// Wait for the job to be succeeded or failed

tests/odh/mnist_raytune_hpo_test.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,15 @@ func mnistRayTuneHpo(t *testing.T, numGpus int) {
140140

141141
// Initialise raycluster client to interact with raycluster to get rayjob details using REST-API
142142
dashboardUrl := GetDashboardUrl(test, namespace, rayCluster)
143-
rayClusterClientConfig := RayClusterClientConfig{Address: dashboardUrl.String(), Client: nil, InsecureSkipVerify: true}
144-
rayClient, err := NewRayClusterClient(rayClusterClientConfig, test.Config().BearerToken)
145-
test.Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to create new raycluster client: %s", err))
143+
rayClient := GetRayClusterClient(test, dashboardUrl, test.Config().BearerToken)
146144

147145
// wait until rayjob exists
148146
test.Eventually(func() ([]RayJobDetailsResponse, error) {
149-
rayJobs, err := rayClient.GetJobs()
150-
if err != nil {
151-
return *rayJobs, err
152-
}
153-
return *rayJobs, nil
147+
return rayClient.ListJobs()
154148
}, TestTimeoutMedium, 1*time.Second).Should(HaveLen(1), "Ray job not found")
155149

156150
// Get rayjob-ID
157-
jobID := GetTestJobId(test, rayClient, dashboardUrl.Host)
151+
jobID := GetTestJobId(test, rayClient)
158152
test.Expect(jobID).ToNot(BeEmpty())
159153

160154
// Wait for the job to either succeed or fail

tests/odh/ray_finetune_llm_deepspeed_test.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,15 @@ func rayFinetuneLlmDeepspeed(t *testing.T, numGpus int, modelName string, modelC
127127

128128
// Initialise raycluster client to interact with raycluster to get rayjob details using REST-API
129129
dashboardUrl := GetDashboardUrl(test, namespace, rayCluster)
130-
rayClusterClientConfig := RayClusterClientConfig{Address: dashboardUrl.String(), Client: nil, InsecureSkipVerify: true}
131-
rayClient, err := NewRayClusterClient(rayClusterClientConfig, test.Config().BearerToken)
132-
test.Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to create new raycluster client: %s", err))
130+
rayClient := GetRayClusterClient(test, dashboardUrl, test.Config().BearerToken)
133131

134132
// wait until rayjob exists
135133
test.Eventually(func() ([]RayJobDetailsResponse, error) {
136-
rayJobs, err := rayClient.GetJobs()
137-
if err != nil {
138-
return *rayJobs, err
139-
}
140-
return *rayJobs, nil
134+
return rayClient.ListJobs()
141135
}, TestTimeoutMedium, 1*time.Second).Should(HaveLen(1), "Ray job not found")
142136

143137
// Get test job-id
144-
jobID := GetTestJobId(test, rayClient, dashboardUrl.Host)
138+
jobID := GetTestJobId(test, rayClient)
145139
test.Expect(jobID).ToNot(BeEmpty())
146140

147141
// Wait for the job to be succeeded or failed

tests/odh/support.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ func ReadFileExt(t support.Test, fileName string) []byte {
4444
return file
4545
}
4646

47-
func GetDashboardUrl(test support.Test, namespace *v1.Namespace, rayCluster *rayv1.RayCluster) *url.URL {
47+
func GetDashboardUrl(test support.Test, namespace *v1.Namespace, rayCluster *rayv1.RayCluster) string {
4848
dashboardName := "ray-dashboard-" + rayCluster.Name
4949
route := support.GetRoute(test, namespace.Name, dashboardName)
5050
hostname := route.Status.Ingress[0].Host
5151
dashboardUrl, _ := url.Parse("https://" + hostname)
5252
test.T().Logf("Ray-dashboard route : %s\n", dashboardUrl.String())
5353

54-
return dashboardUrl
54+
return dashboardUrl.String()
5555
}
5656

57-
func GetTestJobId(test support.Test, rayClient support.RayClusterClient, hostName string) string {
58-
allJobsData, err := rayClient.GetJobs()
57+
func GetTestJobId(test support.Test, rayClient support.RayClusterClient) string {
58+
allJobsData, err := rayClient.ListJobs()
5959
test.Expect(err).ToNot(gomega.HaveOccurred())
60+
test.Expect(allJobsData).NotTo(gomega.BeEmpty())
61+
62+
jobID := allJobsData[0].SubmissionID
63+
test.T().Logf("Ray job has been successfully submitted to the raycluster with Submission-ID : %s\n", jobID)
6064

61-
jobID := (*allJobsData)[0].SubmissionID
62-
if len(*allJobsData) > 0 {
63-
test.T().Logf("Ray job has been successfully submitted to the raycluster with Submission-ID : %s\n", jobID)
64-
}
6565
return jobID
6666
}

0 commit comments

Comments
 (0)