Skip to content

Update SDK e2e test to reflect poetry changes #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
22 changes: 22 additions & 0 deletions test/e2e/install-codeflare-sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# go to codeflare-sdk folder and install codeflare-sdk
cd ..

# Install Poetry and configure virtualenvs
pip install poetry
poetry config virtualenvs.create false

cd codeflare-sdk
# Clone the CodeFlare SDK repository
git clone --branch main https://github.com/project-codeflare/codeflare-sdk.git

cd codeflare-sdk

# Lock dependencies and install them
poetry lock --no-update
poetry install --with test,docs

# Return to the workdir
cd ../..
cd workdir
14 changes: 13 additions & 1 deletion test/e2e/mnist_raycluster_sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func TestMNISTRayClusterSDK(t *testing.T) {
"requirements.txt": ReadFile(test, "mnist_pip_requirements.txt"),
// MNIST training script
"mnist.py": ReadFile(test, "mnist.py"),
// codeflare-sdk installation script
"install-codeflare-sdk.sh": ReadFile(test, "install-codeflare-sdk.sh"),
})

// Create RBAC, retrieve token for user with limited rights
Expand Down Expand Up @@ -119,12 +121,16 @@ func TestMNISTRayClusterSDK(t *testing.T) {
{Name: "PYTHONUSERBASE", Value: "/workdir"},
{Name: "RAY_IMAGE", Value: GetRayImage()},
},
Command: []string{"/bin/sh", "-c", "pip install codeflare-sdk==" + GetCodeFlareSDKVersion() + " && cp /test/* . && python mnist_raycluster_sdk.py" + " " + namespace.Name},
Command: []string{"/bin/sh", "-c", "cp /test/* . && chmod +x install-codeflare-sdk.sh && ./install-codeflare-sdk.sh && python mnist_raycluster_sdk.py" + " " + namespace.Name},
VolumeMounts: []corev1.VolumeMount{
{
Name: "test",
MountPath: "/test",
},
{
Name: "codeflare-sdk",
MountPath: "/codeflare-sdk",
},
{
Name: "workdir",
MountPath: "/workdir",
Expand Down Expand Up @@ -154,6 +160,12 @@ func TestMNISTRayClusterSDK(t *testing.T) {
},
},
},
{
Name: "codeflare-sdk",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
{
Name: "workdir",
VolumeSource: corev1.VolumeSource{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/project-codeflare/codeflare-common/support"
)

//go:embed *.py *.txt
//go:embed *.py *.txt *.sh
var files embed.FS

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