Skip to content

fix: codeflare-operator e2e tests not passing #312

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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ The e2e tests can be executed locally by running the following commands:
- 'system:serviceaccount:$(namespace):kuberay-operator'
```

4. In a separate terminal, run the e2e suite:
4. In a separate terminal, set your output directory for test files, and run the e2e suite:
```bash
export CODEFLARE_TEST_OUTPUT_DIR=<your_output_directory>
```

```bash
make test-e2e
Expand Down
18 changes: 16 additions & 2 deletions test/e2e/mnist_pytorch_mcad_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,23 @@ func TestMNISTPyTorchMCAD(t *testing.T) {
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "job",
Image: GetPyTorchImage(),
Name: "job",
Image: GetPyTorchImage(),
Env: []corev1.EnvVar{
corev1.EnvVar{Name: "PYTHONUSERBASE", Value: "/workdir"},
},
Command: []string{"/bin/sh", "-c", "pip install -r /test/requirements.txt && torchrun /test/mnist.py"},
VolumeMounts: []corev1.VolumeMount{
{
Name: "test",
MountPath: "/test",
},
{
Name: "workdir",
MountPath: "/workdir",
},
},
WorkingDir: "/workdir",
},
},
Volumes: []corev1.Volume{
Expand All @@ -99,6 +107,12 @@ func TestMNISTPyTorchMCAD(t *testing.T) {
},
},
},
{
Name: "workdir",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
},
RestartPolicy: corev1.RestartPolicyNever,
},
Expand Down
16 changes: 15 additions & 1 deletion test/e2e/mnist_raycluster_sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,22 @@ func TestMNISTRayClusterSDK(t *testing.T) {
Name: "test",
// 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",
Image: "quay.io/opendatahub/notebooks:jupyter-minimal-ubi8-python-3.8-4c8f26e",
Env: []corev1.EnvVar{
corev1.EnvVar{Name: "PYTHONUSERBASE", Value: "/workdir"},
},
Command: []string{"/bin/sh", "-c", "pip install codeflare-sdk==" + GetCodeFlareSDKVersion() + " && cp /test/* . && python mnist_raycluster_sdk.py" + " " + namespace.Name},
VolumeMounts: []corev1.VolumeMount{
{
Name: "test",
MountPath: "/test",
},
{
Name: "workdir",
MountPath: "/workdir",
},
},
WorkingDir: "/workdir",
},
},
Volumes: []corev1.Volume{
Expand All @@ -181,6 +189,12 @@ func TestMNISTRayClusterSDK(t *testing.T) {
},
},
},
{
Name: "workdir",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
},
RestartPolicy: corev1.RestartPolicyNever,
ServiceAccountName: serviceAccount.Name,
Expand Down