Skip to content

Commit de7fc9d

Browse files
VanillaSpoonopenshift-merge-robot
authored andcommitted
fix: e2e tests not passing
1 parent f3660db commit de7fc9d

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ The e2e tests can be executed locally by running the following commands:
7575
- 'system:serviceaccount:$(namespace):kuberay-operator'
7676
```
7777
78-
4. In a separate terminal, run the e2e suite:
78+
4. In a separate terminal, set your output directory for test files, and run the e2e suite:
79+
```bash
80+
export CODEFLARE_TEST_OUTPUT_DIR=<your_output_directory>
81+
```
7982
8083
```bash
8184
make test-e2e

test/e2e/mnist_pytorch_mcad_job_test.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,23 @@ func TestMNISTPyTorchMCAD(t *testing.T) {
7777
Spec: corev1.PodSpec{
7878
Containers: []corev1.Container{
7979
{
80-
Name: "job",
81-
Image: GetPyTorchImage(),
80+
Name: "job",
81+
Image: GetPyTorchImage(),
82+
Env: []corev1.EnvVar{
83+
corev1.EnvVar{Name: "PYTHONUSERBASE", Value: "/workdir"},
84+
},
8285
Command: []string{"/bin/sh", "-c", "pip install -r /test/requirements.txt && torchrun /test/mnist.py"},
8386
VolumeMounts: []corev1.VolumeMount{
8487
{
8588
Name: "test",
8689
MountPath: "/test",
8790
},
91+
{
92+
Name: "workdir",
93+
MountPath: "/workdir",
94+
},
8895
},
96+
WorkingDir: "/workdir",
8997
},
9098
},
9199
Volumes: []corev1.Volume{
@@ -99,6 +107,12 @@ func TestMNISTPyTorchMCAD(t *testing.T) {
99107
},
100108
},
101109
},
110+
{
111+
Name: "workdir",
112+
VolumeSource: corev1.VolumeSource{
113+
EmptyDir: &corev1.EmptyDirVolumeSource{},
114+
},
115+
},
102116
},
103117
RestartPolicy: corev1.RestartPolicyNever,
104118
},

test/e2e/mnist_raycluster_sdk_test.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,22 @@ func TestMNISTRayClusterSDK(t *testing.T) {
160160
Name: "test",
161161
// FIXME: switch to base Python image once the dependency on OpenShift CLI is removed
162162
// See https://github.com/project-codeflare/codeflare-sdk/pull/146
163-
Image: "quay.io/opendatahub/notebooks:jupyter-minimal-ubi8-python-3.8-4c8f26e",
163+
Image: "quay.io/opendatahub/notebooks:jupyter-minimal-ubi8-python-3.8-4c8f26e",
164+
Env: []corev1.EnvVar{
165+
corev1.EnvVar{Name: "PYTHONUSERBASE", Value: "/workdir"},
166+
},
164167
Command: []string{"/bin/sh", "-c", "pip install codeflare-sdk==" + GetCodeFlareSDKVersion() + " && cp /test/* . && python mnist_raycluster_sdk.py" + " " + namespace.Name},
165168
VolumeMounts: []corev1.VolumeMount{
166169
{
167170
Name: "test",
168171
MountPath: "/test",
169172
},
173+
{
174+
Name: "workdir",
175+
MountPath: "/workdir",
176+
},
170177
},
178+
WorkingDir: "/workdir",
171179
},
172180
},
173181
Volumes: []corev1.Volume{
@@ -181,6 +189,12 @@ func TestMNISTRayClusterSDK(t *testing.T) {
181189
},
182190
},
183191
},
192+
{
193+
Name: "workdir",
194+
VolumeSource: corev1.VolumeSource{
195+
EmptyDir: &corev1.EmptyDirVolumeSource{},
196+
},
197+
},
184198
},
185199
RestartPolicy: corev1.RestartPolicyNever,
186200
ServiceAccountName: serviceAccount.Name,

0 commit comments

Comments
 (0)