Skip to content

Commit 50a5a9c

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 50a5a9c

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

Diff for: test/e2e/install-codeflare-sdk.sh

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

Diff for: test/e2e/mnist_raycluster_sdk_test.go

+13-1
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,12 +121,16 @@ 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",
126128
MountPath: "/test",
127129
},
130+
{
131+
Name: "codeflare-sdk",
132+
MountPath: "/codeflare-sdk",
133+
},
128134
{
129135
Name: "workdir",
130136
MountPath: "/workdir",
@@ -154,6 +160,12 @@ func TestMNISTRayClusterSDK(t *testing.T) {
154160
},
155161
},
156162
},
163+
{
164+
Name: "codeflare-sdk",
165+
VolumeSource: corev1.VolumeSource{
166+
EmptyDir: &corev1.EmptyDirVolumeSource{},
167+
},
168+
},
157169
{
158170
Name: "workdir",
159171
VolumeSource: corev1.VolumeSource{

Diff for: test/e2e/support.go

+1-1
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)