Skip to content

Commit c18cc95

Browse files
update
1 parent 7fd9df2 commit c18cc95

File tree

9 files changed

+8871
-22
lines changed

9 files changed

+8871
-22
lines changed

tests/kfto/core/kfto_kueue_sft_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ func runPytorchjobWithSFTtrainer(t *testing.T, modelConfigFile string) {
7979
}
8080
clusterQueue := CreateKueueClusterQueue(test, cqSpec)
8181
defer test.Client().Kueue().KueueV1beta1().ClusterQueues().Delete(test.Ctx(), clusterQueue.Name, metav1.DeleteOptions{})
82-
localQueue := CreateKueueLocalQueue(test, namespace.Name, clusterQueue.Name)
82+
annotations := map[string]string{
83+
"kueue.x-k8s.io/default-queue": "true",
84+
}
85+
localQueue := CreateKueueLocalQueue(test, namespace.Name, clusterQueue.Name, annotations)
8386

8487
// Create training PyTorch job
8588
tuningJob := createPyTorchJob(test, namespace.Name, localQueue.Name, *config)
@@ -143,7 +146,10 @@ func TestPytorchjobUsingKueueQuota(t *testing.T) {
143146
}
144147
clusterQueue := CreateKueueClusterQueue(test, cqSpec)
145148
defer test.Client().Kueue().KueueV1beta1().ClusterQueues().Delete(test.Ctx(), clusterQueue.Name, metav1.DeleteOptions{})
146-
localQueue := CreateKueueLocalQueue(test, namespace.Name, clusterQueue.Name)
149+
annotations := map[string]string{
150+
"kueue.x-k8s.io/default-queue": "true",
151+
}
152+
localQueue := CreateKueueLocalQueue(test, namespace.Name, clusterQueue.Name, annotations)
147153

148154
// Create first training PyTorch job
149155
tuningJob := createPyTorchJob(test, namespace.Name, localQueue.Name, *config)

tests/kfto/upgrade/kfto_kueue_sft_upgrade_training_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ func TestSetupPytorchjob(t *testing.T) {
9898
}
9999
clusterQueue, err = test.Client().Kueue().KueueV1beta1().ClusterQueues().Create(test.Ctx(), clusterQueue, metav1.CreateOptions{})
100100
test.Expect(err).NotTo(HaveOccurred())
101-
102-
localQueue := CreateKueueLocalQueue(test, namespaceName, clusterQueue.Name)
101+
annotations := map[string]string{
102+
"kueue.x-k8s.io/default-queue": "true",
103+
}
104+
localQueue := CreateKueueLocalQueue(test, namespaceName, clusterQueue.Name, annotations)
103105

104106
// Create training PyTorch job
105107
tuningJob := createPyTorchJob(test, namespaceName, localQueue.Name, *config)

tests/odh/mnist_ray_finetune_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func mnistRayLlmFinetune(t *testing.T, numGpus int) {
3232
test := With(t)
3333

3434
// Create a namespace
35-
namespace := test.NewTestNamespace()
35+
namespace := CreateTestNamespaceWithName(test, "ray-finetune-llm-deepspeed")
3636

3737
// Test configuration
3838
jupyterNotebookConfigMapFileName := "ray_finetune_llm_deepspeed.ipynb"

tests/odh/notebook.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,44 @@ func createNotebook(test Test, namespace *corev1.Namespace, notebookUserToken, j
9393
test.Expect(err).NotTo(gomega.HaveOccurred())
9494
}
9595

96+
func createNotebookWithPvc(test Test, namespace *corev1.Namespace, notebookUserToken, jupyterNotebookConfigMapName, jupyterNotebookConfigMapFileName string, numGpus int) {
97+
// Create PVC for Notebook
98+
notebookPVC := CreatePersistentVolumeClaim(test, namespace.Name, "10Gi", corev1.ReadWriteOnce)
99+
s3BucketName, _ := GetStorageBucketName()
100+
s3AccessKeyId, _ := GetStorageBucketAccessKeyId()
101+
s3SecretAccessKey, _ := GetStorageBucketSecretKey()
102+
103+
// Read the Notebook CR from resources and perform replacements for custom values using go template
104+
notebookProps := NotebookProps{
105+
IngressDomain: GetOpenShiftIngressDomain(test),
106+
OpenShiftApiUrl: GetOpenShiftApiUrl(test),
107+
KubernetesUserBearerToken: notebookUserToken,
108+
Namespace: namespace.Name,
109+
OpenDataHubNamespace: GetOpenDataHubNamespace(test),
110+
RayImage: GetRayImage(),
111+
NotebookImage: GetNotebookImage(test),
112+
NotebookConfigMapName: jupyterNotebookConfigMapName,
113+
NotebookConfigMapFileName: jupyterNotebookConfigMapFileName,
114+
NotebookPVC: notebookPVC.Name,
115+
NumGpus: numGpus,
116+
S3BucketName: s3BucketName,
117+
S3AccessKeyId: s3AccessKeyId,
118+
S3SecretAccessKey: s3SecretAccessKey,
119+
S3DefaultRegion: GetS3DefaultRegion(),
120+
}
121+
notebookTemplate, err := files.ReadFile("resources/custom-nb-small.yaml")
122+
test.Expect(err).NotTo(gomega.HaveOccurred())
123+
124+
parsedNotebookTemplate := ParseTemplate(test, notebookTemplate, notebookProps)
125+
126+
// Create Notebook CR
127+
notebookCR := &unstructured.Unstructured{}
128+
err = yaml.NewYAMLOrJSONDecoder(bytes.NewBuffer(parsedNotebookTemplate), 8192).Decode(notebookCR)
129+
test.Expect(err).NotTo(gomega.HaveOccurred())
130+
_, err = test.Client().Dynamic().Resource(notebookResource).Namespace(namespace.Name).Create(test.Ctx(), notebookCR, metav1.CreateOptions{})
131+
test.Expect(err).NotTo(gomega.HaveOccurred())
132+
}
133+
96134
func deleteNotebook(test Test, namespace *corev1.Namespace) {
97135
err := test.Client().Dynamic().Resource(notebookResource).Namespace(namespace.Name).Delete(test.Ctx(), "jupyter-nb-kube-3aadmin", metav1.DeleteOptions{})
98136
test.Expect(err).NotTo(gomega.HaveOccurred())

0 commit comments

Comments
 (0)