diff --git a/tests/e2e/install-codeflare-sdk.sh b/tests/e2e/install-codeflare-sdk.sh new file mode 100644 index 000000000..16d84b904 --- /dev/null +++ b/tests/e2e/install-codeflare-sdk.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Install Poetry and configure virtualenvs +pip install poetry +poetry config virtualenvs.create false + +# 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 previous directory +cd .. \ No newline at end of file diff --git a/tests/e2e/mnist_raycluster_sdk_test.go b/tests/e2e/mnist_raycluster_sdk_test.go index e8c76f903..976f54130 100644 --- a/tests/e2e/mnist_raycluster_sdk_test.go +++ b/tests/e2e/mnist_raycluster_sdk_test.go @@ -69,7 +69,10 @@ func TestMNISTRayClusterSDK(t *testing.T) { // MNIST training script "mnist.py": ReadFile(test, "mnist.py"), // SDK Wheel File - "codeflare_sdk-0.0.0.dev0-py3-none-any.whl": ReadWhlFile(test, "codeflare_sdk-0.0.0.dev0-py3-none-any.whl"), + // codeflare-sdk installation script + "install-codeflare-sdk.sh": ReadFile(test, "install-codeflare-sdk.sh"), + + // "codeflare_sdk-0.0.0.dev0-py3-none-any.whl": ReadWhlFile(test, "codeflare_sdk-0.0.0.dev0-py3-none-any.whl"), }, Immutable: Ptr(true), } @@ -167,7 +170,8 @@ func TestMNISTRayClusterSDK(t *testing.T) { // FIXME: switch to base Python image once the dependency on OpenShift CLI is removed // See https://github.com/project-codeflare/codeflare-sdk/pull/146 Image: "quay.io/opendatahub/notebooks:jupyter-minimal-ubi8-python-3.8-4c8f26e", - Command: []string{"/bin/sh", "-c", "pip install /test/codeflare_sdk-0.0.0.dev0-py3-none-any.whl && 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}, + // Command: []string{"/bin/sh", "-c", "pip install /test/codeflare_sdk-0.0.0.dev0-py3-none-any.whl && cp /test/* . && python mnist_raycluster_sdk.py" + " " + namespace.Name}, VolumeMounts: []corev1.VolumeMount{ { Name: "test", diff --git a/tests/e2e/support.go b/tests/e2e/support.go index 7c2d50511..fd0f5a1db 100644 --- a/tests/e2e/support.go +++ b/tests/e2e/support.go @@ -26,7 +26,7 @@ import ( "github.com/project-codeflare/codeflare-operator/test/support" ) -//go:embed *.py *.txt +//go:embed *.py *.txt *.sh var files embed.FS func ReadFile(t support.Test, fileName string) []byte {