@@ -583,7 +583,7 @@ func TrainAndTestModel(namespace string, feastCRName string, feastDeploymentName
583
583
"cronJob": {
584
584
"containerConfigs": {
585
585
"commands": [
586
- "pip install -r ../requirements.txt ",
586
+ "pip install jupyter==1.1.1 scikit-learn==1.5.2 matplotlib==3.9.2 seaborn==0.13.2 joblib ",
587
587
"cd ../ && python run.py"
588
588
]
589
589
}
@@ -596,13 +596,17 @@ func TrainAndTestModel(namespace string, feastCRName string, feastDeploymentName
596
596
fmt .Println ("Patched FeatureStore with train/test commands" )
597
597
598
598
By ("Validating patch was applied correctly" )
599
- cmd = exec .Command ("kubectl" , "get" , "feast/" + feastCRName , "-n" , namespace , "-o" , "jsonpath={.status.applied.cronJob.containerConfigs.commands}" )
600
- output , err := Run (cmd , testDir )
601
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
602
- outputStr := string (output )
603
- Expect (outputStr ).To (ContainSubstring ("pip install -r ../requirements.txt" ))
604
- Expect (outputStr ).To (ContainSubstring ("python run.py" ))
605
- fmt .Print ("FeatureStore patched correctly with commands" , outputStr )
599
+
600
+ Eventually (func () string {
601
+ cmd := exec .Command ("kubectl" , "get" , "feast/" + feastCRName , "-n" , namespace , "-o" , "jsonpath={.status.applied.cronJob.containerConfigs.commands}" )
602
+ output , _ := Run (cmd , testDir )
603
+ return string (output )
604
+ }, "30s" , "3s" ).Should (
605
+ And (
606
+ ContainSubstring ("python run.py" ),
607
+ ),
608
+ )
609
+ fmt .Println ("FeatureStore patched correctly with commands" )
606
610
607
611
By ("Creating Job from CronJob" )
608
612
CreateAndVerifyJobFromCron (namespace , feastDeploymentName , "feast-test-job" , testDir , []string {"Loan rejected!" })
@@ -616,7 +620,7 @@ func CreateAndVerifyJobFromCron(namespace, cronName, jobName, testDir string, ex
616
620
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
617
621
618
622
By ("Waiting for Job completion" )
619
- cmd = exec .Command ("kubectl" , "wait" , "--for=condition=complete" , "--timeout=3m " , "job/" + jobName , "-n" , namespace )
623
+ cmd = exec .Command ("kubectl" , "wait" , "--for=condition=complete" , "--timeout=5m " , "job/" + jobName , "-n" , namespace )
620
624
_ , err = Run (cmd , testDir )
621
625
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
622
626
@@ -631,6 +635,7 @@ func CreateAndVerifyJobFromCron(namespace, cronName, jobName, testDir string, ex
631
635
for _ , expected := range expectedLogSubstrings {
632
636
Expect (outputStr ).To (ContainSubstring (expected ))
633
637
}
638
+ fmt .Printf ("created Job %s and Verified expected Logs " , jobName )
634
639
}
635
640
636
641
// verifies the specified deployment exists and is in the "Available" state.
@@ -645,11 +650,16 @@ func checkDeployment(namespace, name string) {
645
650
646
651
// validate that the status of the FeatureStore CR is "Ready".
647
652
func validateFeatureStoreCRStatus (namespace , crName string ) {
648
- cmd := exec .Command ("kubectl" , "get" , "feast" , crName , "-n" , namespace , "-o" , "jsonpath={.status.phase}" )
649
- output , err := cmd .Output ()
650
- Expect (err ).ToNot (HaveOccurred (), "failed to get Feature Store CR status" )
651
- Expect (string (output )).To (Equal ("Ready" ))
652
- fmt .Printf ("Feature Store CR is in %s state\n " , output )
653
+ Eventually (func () string {
654
+ cmd := exec .Command ("kubectl" , "get" , "feast" , crName , "-n" , namespace , "-o" , "jsonpath={.status.phase}" )
655
+ output , err := cmd .Output ()
656
+ if err != nil {
657
+ return ""
658
+ }
659
+ return string (output )
660
+ }, "2m" , "5s" ).Should (Equal ("Ready" ), "Feature Store CR did not reach 'Ready' state in time" )
661
+
662
+ fmt .Printf ("✅ Feature Store CR %s/%s is in Ready state\n " , namespace , crName )
653
663
}
654
664
655
665
// validate the feature store yaml
0 commit comments