Skip to content

Commit b0746ac

Browse files
committed
Update SDK e2e test to reflect poetry changes
Add Ingress domain for sdk e2e test Revert "Add Ingress domain for sdk e2e test" This reverts commit ffc2004.
1 parent 9c0cecc commit b0746ac

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

test/e2e/install-codeflare-sdk.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# returning to workdir for codeflare-sdk installation
4+
cd ..
5+
6+
# Install Poetry and configure virtualenvs
7+
pip install poetry
8+
poetry config virtualenvs.create false
9+
10+
mkdir codeflare-sdk
11+
cd codeflare-sdk
12+
# Clone the CodeFlare SDK repository
13+
git clone --branch main https://github.com/project-codeflare/codeflare-sdk.git
14+
15+
cd codeflare-sdk
16+
17+
# Lock dependencies and install them
18+
poetry lock --no-update
19+
poetry install --with test,docs
20+
21+
# Return to the test config directory
22+
cd ../..
23+
cd test_config

test/e2e/mnist_raycluster_sdk_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ func TestMNISTRayClusterSDK(t *testing.T) {
5151
"requirements.txt": ReadFile(test, "mnist_pip_requirements.txt"),
5252
// MNIST training script
5353
"mnist.py": ReadFile(test, "mnist.py"),
54+
// codeflare-sdk installation script
55+
"install-codeflare-sdk.sh": ReadFile(test, "install-codeflare-sdk.sh"),
5456
})
5557

5658
// Create RBAC, retrieve token for user with limited rights
@@ -119,7 +121,7 @@ func TestMNISTRayClusterSDK(t *testing.T) {
119121
{Name: "PYTHONUSERBASE", Value: "/workdir"},
120122
{Name: "RAY_IMAGE", Value: GetRayImage()},
121123
},
122-
Command: []string{"/bin/sh", "-c", "pip install codeflare-sdk==" + GetCodeFlareSDKVersion() + " && cp /test/* . && python mnist_raycluster_sdk.py" + " " + namespace.Name},
124+
Command: []string{"/bin/sh", "-c", "cp /test/* . && chmod +x install-codeflare-sdk.sh && ./install-codeflare-sdk.sh && python mnist_raycluster_sdk.py" + " " + namespace.Name},
123125
VolumeMounts: []corev1.VolumeMount{
124126
{
125127
Name: "test",
@@ -129,8 +131,12 @@ func TestMNISTRayClusterSDK(t *testing.T) {
129131
Name: "workdir",
130132
MountPath: "/workdir",
131133
},
134+
{
135+
Name: "workdir",
136+
MountPath: "/workdir/test_config",
137+
},
132138
},
133-
WorkingDir: "/workdir",
139+
WorkingDir: "/workdir/test_config",
134140
SecurityContext: &corev1.SecurityContext{
135141
AllowPrivilegeEscalation: Ptr(false),
136142
SeccompProfile: &corev1.SeccompProfile{

test/e2e/support.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/project-codeflare/codeflare-common/support"
2424
)
2525

26-
//go:embed *.py *.txt
26+
//go:embed *.py *.txt *.sh
2727
var files embed.FS
2828

2929
func ReadFile(t support.Test, fileName string) []byte {

0 commit comments

Comments
 (0)