Skip to content

Commit

Permalink
comment e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Bangqi Zhu <[email protected]>
  • Loading branch information
Bangqi Zhu committed Nov 1, 2024
1 parent 506671d commit e2fec97
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 230 deletions.
5 changes: 4 additions & 1 deletion test/e2e/inference_with_adapters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down Expand Up @@ -93,7 +94,8 @@ func validateInitContainers(workspaceObj *kaitov1alpha1.Workspace, expectedInitC
}
initContainer, expectedInitContainer := initContainers[0], expectedInitContainers[0]

// GinkgoWriter.Printf("Resource '%s' not ready. Ready replicas: %d\n", workspaceObj.Name, readyReplicas)
klog.Info("adapter ouput", "initContainer.Image", initContainer.Image, "expectedInitContainer.Image", expectedInitContainer.Image, "equal", initContainer.Image == expectedInitContainer.Image)

Check failure on line 97 in test/e2e/inference_with_adapters_test.go

View workflow job for this annotation

GitHub Actions / build

`ouput` is a misspelling of `output` (misspell)
klog.Info("adapter ouput", "initContainer.Name", initContainer.Name, "expectedInitContainer.Name", expectedInitContainer.Name, "equal", initContainer.Name == expectedInitContainer.Name)

Check failure on line 98 in test/e2e/inference_with_adapters_test.go

View workflow job for this annotation

GitHub Actions / build

`ouput` is a misspelling of `output` (misspell)
return initContainer.Image == expectedInitContainer.Image && initContainer.Name == expectedInitContainer.Name
}, 20*time.Minute, utils.PollInterval).Should(BeTrue(), "Failed to wait for initContainers to be ready")
})
Expand Down Expand Up @@ -157,6 +159,7 @@ var _ = Describe("Workspace Preset", func() {
} else {
utils.ValidateMachineCreation(ctx, workspaceObj, numOfNode)
}
GinkgoWriter.Printf("expectedInitContainers1: %v\n", expectedInitContainers1)
validateResourceStatus(workspaceObj)

time.Sleep(30 * time.Second)
Expand Down
194 changes: 97 additions & 97 deletions test/e2e/preset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,151 +662,151 @@ var _ = Describe("Workspace Preset", func() {
Fail("Fail threshold reached")
}
})
/*
It("should create a mistral workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createMistralWorkspaceWithPresetPublicMode(numOfNode)
It("should create a mistral workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createMistralWorkspaceWithPresetPublicMode(numOfNode)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
time.Sleep(30 * time.Second)
time.Sleep(30 * time.Second)

validateAssociatedService(workspaceObj)
validateAssociatedService(workspaceObj)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateWorkspaceReadiness(workspaceObj)
})
validateWorkspaceReadiness(workspaceObj)
})
It("should create a Phi-2 workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createPhi2WorkspaceWithPresetPublicMode(numOfNode)
It("should create a Phi-2 workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createPhi2WorkspaceWithPresetPublicMode(numOfNode)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
time.Sleep(30 * time.Second)
time.Sleep(30 * time.Second)
validateAssociatedService(workspaceObj)
validateAssociatedService(workspaceObj)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateWorkspaceReadiness(workspaceObj)
})
validateWorkspaceReadiness(workspaceObj)
})
It("should create a falcon workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createFalconWorkspaceWithPresetPublicMode(numOfNode)
It("should create a falcon workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createFalconWorkspaceWithPresetPublicMode(numOfNode)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
time.Sleep(30 * time.Second)
time.Sleep(30 * time.Second)
validateAssociatedService(workspaceObj)
validateAssociatedService(workspaceObj)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateWorkspaceReadiness(workspaceObj)
})

It("should create a llama 7b workspace with preset private mode successfully", func() {
numOfNode := 1
modelVersion, ok := modelInfo[PresetLlama2AChat]
if !ok {
Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat))
}
workspaceObj := createLlama7BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode)
validateWorkspaceReadiness(workspaceObj)
})
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
It("should create a llama 7b workspace with preset private mode successfully", func() {
numOfNode := 1
modelVersion, ok := modelInfo[PresetLlama2AChat]
if !ok {
Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat))
}
workspaceObj := createLlama7BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
time.Sleep(30 * time.Second)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
validateAssociatedService(workspaceObj)
time.Sleep(30 * time.Second)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateAssociatedService(workspaceObj)
validateWorkspaceReadiness(workspaceObj)
})
validateInferenceResource(workspaceObj, int32(numOfNode), false)
It("should create a llama 13b workspace with preset private mode successfully", func() {
if !runLlama13B {
Skip("Skipping llama 13b workspace test")
}
numOfNode := 2
modelVersion, ok := modelInfo[PresetLlama2BChat]
if !ok {
Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat))
}
workspaceObj := createLlama13BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode)
validateWorkspaceReadiness(workspaceObj)
})
defer cleanupResources(workspaceObj)
It("should create a llama 13b workspace with preset private mode successfully", func() {
if !runLlama13B {
Skip("Skipping llama 13b workspace test")
}
numOfNode := 2
modelVersion, ok := modelInfo[PresetLlama2BChat]
if !ok {
Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat))
}
workspaceObj := createLlama13BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode)
time.Sleep(30 * time.Second)
defer cleanupResources(workspaceObj)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
time.Sleep(30 * time.Second)
time.Sleep(30 * time.Second)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
validateAssociatedService(workspaceObj)
time.Sleep(30 * time.Second)
validateInferenceResource(workspaceObj, int32(numOfNode), true)
validateAssociatedService(workspaceObj)
validateWorkspaceReadiness(workspaceObj)
})
validateInferenceResource(workspaceObj, int32(numOfNode), true)
It("should create a custom template workspace successfully", func() {
numOfNode := 1
imageName := "nginx:latest"
workspaceObj := createCustomWorkspaceWithPresetCustomMode(imageName, numOfNode)
validateWorkspaceReadiness(workspaceObj)
})
defer cleanupResources(workspaceObj)
It("should create a custom template workspace successfully", func() {
numOfNode := 1
imageName := "nginx:latest"
workspaceObj := createCustomWorkspaceWithPresetCustomMode(imageName, numOfNode)
time.Sleep(30 * time.Second)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
time.Sleep(30 * time.Second)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
time.Sleep(30 * time.Second)
validateWorkspaceReadiness(workspaceObj)
})
validateInferenceResource(workspaceObj, int32(numOfNode), false)
It("should create a Phi-3-mini-128k-instruct workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createPhi3WorkspaceWithPresetPublicMode(numOfNode)
validateWorkspaceReadiness(workspaceObj)
})
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
It("should create a Phi-3-mini-128k-instruct workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createPhi3WorkspaceWithPresetPublicMode(numOfNode)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)
time.Sleep(30 * time.Second)
validateCreateNode(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)
validateAssociatedService(workspaceObj)
time.Sleep(30 * time.Second)
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateAssociatedService(workspaceObj)
validateWorkspaceReadiness(workspaceObj)
})
validateInferenceResource(workspaceObj, int32(numOfNode), false)
validateWorkspaceReadiness(workspaceObj)
})
*/
It("should create a workspace for tuning successfully, and update the workspace with another dataset and output image", func() {
numOfNode := 1
err := copySecretToNamespace(e2eACRSecret, namespaceName)
Expand Down
Loading

0 comments on commit e2fec97

Please sign in to comment.