Skip to content

Commit 9593003

Browse files
Cleanup code
1 parent bb75488 commit 9593003

File tree

7 files changed

+21
-67
lines changed

7 files changed

+21
-67
lines changed

.github/workflows/e2e_tests.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
ls -lart
3636
echo "Initial status:"
3737
df -h
38-
3938
echo "Cleaning up resources:"
4039
sudo swapoff -a
4140
sudo rm -f /swapfile
@@ -45,7 +44,6 @@ jobs:
4544
sudo rm -rf "/usr/local/share/boost"
4645
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
4746
docker rmi $(docker image ls -aq)
48-
4947
echo "Final status:"
5048
df -h
5149

copyscript.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/e2e/install-codeflare-sdk.sh

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
11
#!/bin/bash
22

3-
# Generate zip file beforehand
4-
# tar -czvf root-dir.tar.gz --exclude='.git' --exclude='.github' --exclude='.pytest_cache' ./
5-
6-
# Create temp-pod to contain the zip file
7-
# kubectl apply -f temp-pod.yaml
8-
9-
# Copy the zip file to the temp-pod:/mnt
10-
# kubectl cp root-dir.tar.gz temp-pod:/mnt
11-
12-
# Run a shell in the temp-pod
13-
# kubectl exec -it temp-pod -- /bin/sh
14-
15-
# Unzip the zip file
16-
# tar -xzvf /mnt/root-dir.tar.gz -C /mnt
17-
18-
# Not necessary as the PVC is mounted to /codeflare-sdk
19-
# mv /mnt/* /codeflare-sdk/
20-
21-
## Copy files from temp-pod /mnt into the codeflare-sdk volume mount in this other pod.
22-
# kubectl cp default/temp-pod:/mnt codeflare-sdk
23-
24-
253
cd ..
264

275
# Install Poetry and configure virtualenvs

tests/e2e/mnist_raycluster_sdk.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@
6262
script="mnist.py",
6363
scheduler_args={"requirements": "requirements.txt"},
6464
)
65-
print("Submitting Job OSAOUBDAUDDAOUBDOUBUBAD")
6665
job = jobdef.submit(cluster)
6766

6867
done = False
6968
time = 0
70-
timeout = 500
69+
timeout = 900
7170
while not done:
7271
status = job.status()
7372
if is_terminal(status.state):

tests/e2e/mnist_raycluster_sdk_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ func TestMNISTRayClusterSDK(t *testing.T) {
208208
test.T().Logf("Created Job %s/%s successfully", job.Namespace, job.Name)
209209

210210
go func() {
211-
scriptName := "../.././copyscript.sh"
211+
scriptName := "./sdk-to-pod.sh"
212212
cmd := exec.Command(scriptName, namespace.Name)
213213

214214
var stdoutBuf, stderrBuf bytes.Buffer
215215
cmd.Stdout = &stdoutBuf
216216
cmd.Stderr = &stderrBuf
217217

218-
// Run the script
218+
// Run the script to copy the SDK to the pod
219219
if err := cmd.Run(); err != nil {
220220
t.Logf("STDOUT: %s", stdoutBuf.String())
221221
t.Logf("STDERR: %s", stderrBuf.String())

tests/e2e/sdk-to-pod.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
echo "Starting the script to copy the SDK to the pod"
3+
namespace=$1
4+
5+
# Get the name of the pod starting with 'sdk' and its status
6+
while : ; do
7+
read podname podstatus <<< $(kubectl get pods -n "${namespace}" -o custom-columns=:metadata.name,:status.phase | grep "^sdk" | awk '{print $1, $2}')
8+
echo "$podname, $podstatus, $namespace"
9+
# Check if the pod is found and is in 'Running' status
10+
if [[ -n "$podname" && "$podstatus" == "Running" ]]; then
11+
echo "Pod ${podname} is running. Proceeding to copy files."
12+
kubectl cp ../.././ "${namespace}/${podname}:/codeflare-sdk"
13+
break
14+
else
15+
echo "Waiting for pod to be in Running state in namespace ${namespace}..."
16+
sleep 5
17+
fi
18+
done

tests/e2e/support.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ package e2e
1919
import (
2020
"embed"
2121

22-
"io/ioutil"
23-
2422
"github.com/onsi/gomega"
2523

2624
"github.com/project-codeflare/codeflare-common/support"
@@ -35,10 +33,3 @@ func ReadFile(t support.Test, fileName string) []byte {
3533
t.Expect(err).NotTo(gomega.HaveOccurred())
3634
return file
3735
}
38-
39-
func ReadWhlFile(t support.Test, fileName string) []byte {
40-
t.T().Helper()
41-
file, err := ioutil.ReadFile(fileName)
42-
t.Expect(err).NotTo(gomega.HaveOccurred())
43-
return file
44-
}

0 commit comments

Comments
 (0)