Skip to content

Commit b894279

Browse files
committed
Add Workbecnh Ray Compute engine and offline store test
Signed-off-by: Srihari <[email protected]>
1 parent b601ef2 commit b894279

File tree

6 files changed

+659
-56
lines changed

6 files changed

+659
-56
lines changed

infra/feast-operator/test/e2e_rhoai/feast_wb_connection_integration_test.go

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ var _ = Describe("Feast Workbench Integration Connection Testing", Ordered, func
4343
feastCRName = "credit-scoring"
4444
)
4545

46-
// Create and monitor notebook
47-
createAndMonitorNotebook := func() {
48-
nbParams := utils.GetNotebookParams(namespace, configMapName, notebookPVC, notebookName, testDir)
49-
By("Creating Jupyter Notebook")
50-
Expect(utils.CreateNotebook(nbParams)).To(Succeed(), "Failed to create notebook")
51-
52-
By("Monitoring notebook logs")
53-
Expect(utils.MonitorNotebookPod(namespace, "jupyter-nb-", notebookName)).To(Succeed(), "Notebook execution failed")
54-
}
55-
5646
// Parameterized test function that handles both auth and non-auth scenarios
5747
runFeastWorkbenchIntegration := func(authEnabled bool) {
5848
// Apply permissions only if auth is enabled
@@ -61,24 +51,8 @@ var _ = Describe("Feast Workbench Integration Connection Testing", Ordered, func
6151
utils.ApplyFeastPermissions(permissionFile, "/feast-data/credit_scoring_local/feature_repo/permissions.py", namespace, feastDeploymentName)
6252
}
6353

64-
By(fmt.Sprintf("Setting namespace context to : %s", namespace))
65-
Expect(utils.SetNamespaceContext(namespace, testDir)).To(Succeed())
66-
fmt.Printf("Successfully set namespace context to: %s\n", namespace)
67-
68-
By(fmt.Sprintf("Creating Config map: %s", configMapName))
69-
Expect(utils.CreateNotebookConfigMap(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", testDir)).To(Succeed())
70-
fmt.Printf("ConfigMap %s created successfully\n", configMapName)
71-
72-
By(fmt.Sprintf("Creating Persistent volume claim: %s", notebookPVC))
73-
Expect(utils.CreateNotebookPVC(pvcFile, testDir)).To(Succeed())
74-
fmt.Printf("Persistent Volume Claim %s created successfully\n", notebookPVC)
75-
76-
By(fmt.Sprintf("Creating rolebinding %s for the user", rolebindingName))
77-
Expect(utils.CreateNotebookRoleBinding(namespace, rolebindingName, utils.GetOCUser(testDir), testDir)).To(Succeed())
78-
fmt.Printf("Created rolebinding %s successfully\n", rolebindingName)
79-
80-
// Create and monitor notebook for execution status
81-
createAndMonitorNotebook()
54+
// Use the shared RunNotebookTest function for common setup and execution
55+
utils.RunNotebookTest(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", pvcFile, rolebindingName, notebookPVC, notebookName, testDir)
8256
}
8357

8458
BeforeAll(func() {

infra/feast-operator/test/e2e_rhoai/feast_wb_milvus_test.go

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,9 @@ var _ = Describe("Feast Jupyter Notebook Testing", Ordered, func() {
5252
fmt.Printf("Namespace %s deleted successfully\n", namespace)
5353
})
5454

55-
runNotebookTest := func() {
56-
// Execute common setup steps
57-
By(fmt.Sprintf("Setting namespace context to : %s", namespace))
58-
Expect(utils.SetNamespaceContext(namespace, testDir)).To(Succeed())
59-
fmt.Printf("Successfully set namespace context to: %s\n", namespace)
60-
61-
By(fmt.Sprintf("Creating Config map: %s", configMapName))
62-
Expect(utils.CreateNotebookConfigMap(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", testDir)).To(Succeed())
63-
fmt.Printf("ConfigMap %s created successfully\n", configMapName)
64-
65-
By(fmt.Sprintf("Creating Persistent volume claim: %s", notebookPVC))
66-
Expect(utils.CreateNotebookPVC(pvcFile, testDir)).To(Succeed())
67-
fmt.Printf("Persistent Volume Claim %s created successfully\n", notebookPVC)
68-
69-
By(fmt.Sprintf("Creating rolebinding %s for the user", rolebindingName))
70-
Expect(utils.CreateNotebookRoleBinding(namespace, rolebindingName, utils.GetOCUser(testDir), testDir)).To(Succeed())
71-
fmt.Printf("Created rolebinding %s successfully\n", rolebindingName)
72-
73-
// Build notebook parameters and create notebook
74-
nbParams := utils.GetNotebookParams(namespace, configMapName, notebookPVC, notebookName, testDir)
75-
By("Creating Jupyter Notebook")
76-
Expect(utils.CreateNotebook(nbParams)).To(Succeed(), "Failed to create notebook")
77-
78-
By("Monitoring notebook logs")
79-
Expect(utils.MonitorNotebookPod(namespace, "jupyter-nb-", notebookName)).To(Succeed(), "Notebook execution failed")
80-
}
81-
8255
Context("Feast Jupyter Notebook Test", func() {
83-
It("Should create and run a "+feastMilvusTest+" successfully", runNotebookTest)
56+
It("Should create and run a "+feastMilvusTest+" successfully", func() {
57+
utils.RunNotebookTest(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", pvcFile, rolebindingName, notebookPVC, notebookName, testDir)
58+
})
8459
})
8560
})
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
Copyright 2025 Feast Community.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package e2erhoai provides end-to-end (E2E) test coverage for Feast integration with
18+
// Red Hat OpenShift AI (RHOAI) environments. This specific test validates the functionality
19+
// of executing a Feast Jupyter notebook with Ray offline store within a fully configured OpenShift namespace
20+
package e2erhoai
21+
22+
import (
23+
"fmt"
24+
"os/exec"
25+
26+
utils "github.com/feast-dev/feast/infra/feast-operator/test/utils"
27+
. "github.com/onsi/ginkgo/v2"
28+
. "github.com/onsi/gomega"
29+
)
30+
31+
var _ = Describe("Feast Jupyter Notebook Testing with Ray Offline Store", Ordered, func() {
32+
const (
33+
namespace = "test-ns-feast-wb-ray"
34+
configMapName = "feast-wb-ray-cm"
35+
rolebindingName = "rb-feast-ray-test"
36+
notebookFile = "test/e2e_rhoai/resources/feast-wb-ray-test.ipynb"
37+
pvcFile = "test/e2e_rhoai/resources/pvc.yaml"
38+
kueueResourcesFile = "test/e2e_rhoai/resources/kueue_resources_setup.yaml"
39+
notebookPVC = "jupyterhub-nb-kube-3aadmin-pvc"
40+
testDir = "/test/e2e_rhoai"
41+
notebookName = "feast-wb-ray-test.ipynb"
42+
feastRayTest = "TestFeastRayOfflineStoreNotebook"
43+
)
44+
45+
BeforeAll(func() {
46+
By(fmt.Sprintf("Creating test namespace: %s", namespace))
47+
Expect(utils.CreateNamespace(namespace, testDir)).To(Succeed())
48+
fmt.Printf("Namespace %s created successfully\n", namespace)
49+
50+
By("Applying Kueue resources setup")
51+
// Apply with namespace flag - cluster-scoped resources (ResourceFlavor, ClusterQueue) will be applied at cluster level,
52+
// and namespace-scoped resources (LocalQueue) will be applied in the specified namespace
53+
cmd := exec.Command("kubectl", "apply", "-f", kueueResourcesFile, "-n", namespace)
54+
output, err := utils.Run(cmd, testDir)
55+
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to apply Kueue resources: %v\nOutput: %s", err, output))
56+
fmt.Printf("Kueue resources applied successfully\n")
57+
})
58+
59+
AfterAll(func() {
60+
By("Deleting Kueue resources")
61+
// Delete with namespace flag - will delete namespace-scoped resources from the namespace
62+
// and cluster-scoped resources from the cluster
63+
cmd := exec.Command("kubectl", "delete", "-f", kueueResourcesFile, "-n", namespace, "--ignore-not-found=true")
64+
_, _ = utils.Run(cmd, testDir)
65+
fmt.Printf("Kueue resources cleanup completed\n")
66+
67+
By(fmt.Sprintf("Deleting test namespace: %s", namespace))
68+
Expect(utils.DeleteNamespace(namespace, testDir)).To(Succeed())
69+
fmt.Printf("Namespace %s deleted successfully\n", namespace)
70+
})
71+
72+
Context("Feast Jupyter Notebook Test with Ray Offline store", func() {
73+
It("Should create and run a "+feastRayTest+" successfully", func() {
74+
utils.RunNotebookTest(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", pvcFile, rolebindingName, notebookPVC, notebookName, testDir)
75+
})
76+
})
77+
})

0 commit comments

Comments
 (0)