Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ var _ = Describe("Feast Workbench Integration Connection Testing", Ordered, func
feastCRName = "credit-scoring"
)

// Create and monitor notebook
createAndMonitorNotebook := func() {
nbParams := utils.GetNotebookParams(namespace, configMapName, notebookPVC, notebookName, testDir)
By("Creating Jupyter Notebook")
Expect(utils.CreateNotebook(nbParams)).To(Succeed(), "Failed to create notebook")

By("Monitoring notebook logs")
Expect(utils.MonitorNotebookPod(namespace, "jupyter-nb-", notebookName)).To(Succeed(), "Notebook execution failed")
}

// Parameterized test function that handles both auth and non-auth scenarios
runFeastWorkbenchIntegration := func(authEnabled bool) {
// Apply permissions only if auth is enabled
Expand All @@ -61,24 +51,8 @@ var _ = Describe("Feast Workbench Integration Connection Testing", Ordered, func
utils.ApplyFeastPermissions(permissionFile, "/feast-data/credit_scoring_local/feature_repo/permissions.py", namespace, feastDeploymentName)
}

By(fmt.Sprintf("Setting namespace context to : %s", namespace))
Expect(utils.SetNamespaceContext(namespace, testDir)).To(Succeed())
fmt.Printf("Successfully set namespace context to: %s\n", namespace)

By(fmt.Sprintf("Creating Config map: %s", configMapName))
Expect(utils.CreateNotebookConfigMap(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", testDir)).To(Succeed())
fmt.Printf("ConfigMap %s created successfully\n", configMapName)

By(fmt.Sprintf("Creating Persistent volume claim: %s", notebookPVC))
Expect(utils.CreateNotebookPVC(pvcFile, testDir)).To(Succeed())
fmt.Printf("Persistent Volume Claim %s created successfully\n", notebookPVC)

By(fmt.Sprintf("Creating rolebinding %s for the user", rolebindingName))
Expect(utils.CreateNotebookRoleBinding(namespace, rolebindingName, utils.GetOCUser(testDir), testDir)).To(Succeed())
fmt.Printf("Created rolebinding %s successfully\n", rolebindingName)

// Create and monitor notebook for execution status
createAndMonitorNotebook()
// Use the shared RunNotebookTest function for common setup and execution
utils.RunNotebookTest(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", pvcFile, rolebindingName, notebookPVC, notebookName, testDir)
}

BeforeAll(func() {
Expand Down
31 changes: 3 additions & 28 deletions infra/feast-operator/test/e2e_rhoai/feast_wb_milvus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,9 @@ var _ = Describe("Feast Jupyter Notebook Testing", Ordered, func() {
fmt.Printf("Namespace %s deleted successfully\n", namespace)
})

runNotebookTest := func() {
// Execute common setup steps
By(fmt.Sprintf("Setting namespace context to : %s", namespace))
Expect(utils.SetNamespaceContext(namespace, testDir)).To(Succeed())
fmt.Printf("Successfully set namespace context to: %s\n", namespace)

By(fmt.Sprintf("Creating Config map: %s", configMapName))
Expect(utils.CreateNotebookConfigMap(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", testDir)).To(Succeed())
fmt.Printf("ConfigMap %s created successfully\n", configMapName)

By(fmt.Sprintf("Creating Persistent volume claim: %s", notebookPVC))
Expect(utils.CreateNotebookPVC(pvcFile, testDir)).To(Succeed())
fmt.Printf("Persistent Volume Claim %s created successfully\n", notebookPVC)

By(fmt.Sprintf("Creating rolebinding %s for the user", rolebindingName))
Expect(utils.CreateNotebookRoleBinding(namespace, rolebindingName, utils.GetOCUser(testDir), testDir)).To(Succeed())
fmt.Printf("Created rolebinding %s successfully\n", rolebindingName)

// Build notebook parameters and create notebook
nbParams := utils.GetNotebookParams(namespace, configMapName, notebookPVC, notebookName, testDir)
By("Creating Jupyter Notebook")
Expect(utils.CreateNotebook(nbParams)).To(Succeed(), "Failed to create notebook")

By("Monitoring notebook logs")
Expect(utils.MonitorNotebookPod(namespace, "jupyter-nb-", notebookName)).To(Succeed(), "Notebook execution failed")
}

Context("Feast Jupyter Notebook Test", func() {
It("Should create and run a "+feastMilvusTest+" successfully", runNotebookTest)
It("Should create and run a "+feastMilvusTest+" successfully", func() {
utils.RunNotebookTest(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", pvcFile, rolebindingName, notebookPVC, notebookName, testDir)
})
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
Copyright 2025 Feast Community.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package e2erhoai provides end-to-end (E2E) test coverage for Feast integration with
// Red Hat OpenShift AI (RHOAI) environments. This specific test validates the functionality
// of executing a Feast Jupyter notebook with Ray offline store within a fully configured OpenShift namespace
package e2erhoai

import (
"fmt"
"os/exec"

utils "github.com/feast-dev/feast/infra/feast-operator/test/utils"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("Feast Jupyter Notebook Testing with Ray Offline Store", Ordered, func() {
const (
namespace = "test-ns-feast-wb-ray"
configMapName = "feast-wb-ray-cm"
rolebindingName = "rb-feast-ray-test"
notebookFile = "test/e2e_rhoai/resources/feast-wb-ray-test.ipynb"
pvcFile = "test/e2e_rhoai/resources/pvc.yaml"
kueueResourcesFile = "test/e2e_rhoai/resources/kueue_resources_setup.yaml"
notebookPVC = "jupyterhub-nb-kube-3aadmin-pvc"
testDir = "/test/e2e_rhoai"
notebookName = "feast-wb-ray-test.ipynb"
feastRayTest = "TestFeastRayOfflineStoreNotebook"
)

BeforeAll(func() {
By(fmt.Sprintf("Creating test namespace: %s", namespace))
Expect(utils.CreateNamespace(namespace, testDir)).To(Succeed())
fmt.Printf("Namespace %s created successfully\n", namespace)

By("Applying Kueue resources setup")
// Apply with namespace flag - cluster-scoped resources (ResourceFlavor, ClusterQueue) will be applied at cluster level,
// and namespace-scoped resources (LocalQueue) will be applied in the specified namespace
cmd := exec.Command("kubectl", "apply", "-f", kueueResourcesFile, "-n", namespace)
output, err := utils.Run(cmd, testDir)
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to apply Kueue resources: %v\nOutput: %s", err, output))
fmt.Printf("Kueue resources applied successfully\n")
})

AfterAll(func() {
By("Deleting Kueue resources")
// Delete with namespace flag - will delete namespace-scoped resources from the namespace
// and cluster-scoped resources from the cluster
cmd := exec.Command("kubectl", "delete", "-f", kueueResourcesFile, "-n", namespace, "--ignore-not-found=true")
_, _ = utils.Run(cmd, testDir)
fmt.Printf("Kueue resources cleanup completed\n")

By(fmt.Sprintf("Deleting test namespace: %s", namespace))
Expect(utils.DeleteNamespace(namespace, testDir)).To(Succeed())
fmt.Printf("Namespace %s deleted successfully\n", namespace)
})

Context("Feast Jupyter Notebook Test with Ray Offline store", func() {
It("Should create and run a "+feastRayTest+" successfully", func() {
utils.RunNotebookTest(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", pvcFile, rolebindingName, notebookPVC, notebookName, testDir)
})
})
})
Loading
Loading