Skip to content

Commit 036df5a

Browse files
committed
resources now go in default namespace, and edited unique id shortcut
1 parent ac3fc95 commit 036df5a

28 files changed

+67
-64
lines changed

Container-Root/ray/deploy/fsx/dynamic-create.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,16 @@ echo "SECURITYGROUP_ID: "
6464
echo $SECURITYGROUP_ID
6565

6666

67-
echo "In kuberay namespace..."
6867

6968
echo "Applying dynamic-storageclass.yaml"
70-
# kubectl apply -f dynamic-storageclass.yaml -n kuberay
71-
envsubst < /aws-do-ray/Container-Root/ray/deploy/fsx/dynamic-storageclass.yaml | kubectl apply -n kuberay -f -
69+
envsubst < /aws-do-ray/Container-Root/ray/deploy/fsx/dynamic-storageclass.yaml | kubectl apply -f -
7270

7371

7472
echo "Applying dynamic-pvc.yaml"
75-
kubectl apply -f /aws-do-ray/Container-Root/ray/deploy/fsx/dynamic-pvc.yaml -n kuberay
73+
kubectl apply -f /aws-do-ray/Container-Root/ray/deploy/fsx/dynamic-pvc.yaml
7674

7775
echo "Describing pvc fsx-claim"
78-
kubectl describe pvc fsx-claim -n kuberay
76+
kubectl describe pvc fsx-claim
7977

8078

8179

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/bin/bash
2-
echo "In kuberay namespace..."
32

43
echo "Deleting dynamic-pvc.yaml"
5-
kubectl delete -f /aws-do-ray/Container-Root/ray/deploy/fsx/dynamic-pvc.yaml -n kuberay
4+
kubectl delete -f /aws-do-ray/Container-Root/ray/deploy/fsx/dynamic-pvc.yaml
65

76
echo "Deleting dynamic-storageclass.yaml"
8-
# kubectl apply -f dynamic-storageclass.yaml -n kuberay
9-
envsubst < /aws-do-ray/Container-Root/ray/deploy/fsx/dynamic-storageclass.yaml | kubectl delete -n kuberay -f -
7+
8+
envsubst < /aws-do-ray/Container-Root/ray/deploy/fsx/dynamic-storageclass.yaml | kubectl delete -f -
109

1110
echo "Describing pvc fsx-claim"
12-
kubectl describe pvc fsx-claim -n kuberay
11+
kubectl describe pvc fsx-claim
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
#!/bin/bash
2-
echo "In kuberay namespace..."
32

43
echo "Applying static-storageclass.yaml"
5-
# kubectl apply -f static-storageclass.yaml -n kuberay
6-
envsubst < static-storageclass.yaml | kubectl apply -n kuberay -f -
4+
5+
envsubst < static-storageclass.yaml | kubectl apply -f -
76

87

98
echo "Applying static-pv.yaml"
10-
# kubectl apply -f static-pv.yaml -n kuberay
11-
envsubst < static-pv.yaml | kubectl apply -n kuberay -f -
9+
10+
envsubst < static-pv.yaml | kubectl apply -f -
1211

1312

1413
echo "Applying static-pvc.yaml"
15-
kubectl apply -f static-pvc.yaml -n kuberay
14+
kubectl apply -f static-pvc.yaml
1615

1716
echo "Describing pvc fsx-claim"
18-
kubectl describe pvc fsx-claim -n kuberay
17+
kubectl describe pvc fsx-claim
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
#!/bin/bash
2-
echo "In kuberay namespace..."
32

43
echo "Deleting static-storageclass.yaml"
5-
# kubectl apply -f static-storageclass.yaml -n kuberay
6-
envsubst < static-storageclass.yaml | kubectl delete -n kuberay -f -
4+
5+
envsubst < static-storageclass.yaml | kubectl delete -f -
76

87

98
echo "Deleting static-pv.yaml"
10-
# kubectl apply -f static-pv.yaml -n kuberay
11-
envsubst < static-pv.yaml | kubectl delete -n kuberay -f -
9+
envsubst < static-pv.yaml | kubectl delete -f -
1210

1311

1412
echo "Deleting static-pvc.yaml"
15-
kubectl delete -f static-pvc.yaml -n kuberay
13+
kubectl delete -f static-pvc.yaml
1614

1715
echo "Describing pvc fsx-claim"
18-
kubectl describe pvc fsx-claim -n kuberay
16+
kubectl describe pvc fsx-claim
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/bin/bash
2-
echo "In kuberay namespace..."
32

43
echo "Applying pv-s3.yaml"
5-
# kubectl apply -f pv-s3.yaml -n kuberay
6-
envsubst < pv-s3.yaml | kubectl apply -n kuberay -f -
4+
5+
envsubst < pv-s3.yaml | kubectl apply -f -
76

87
echo "Applying pvc-s3.yaml"
9-
kubectl apply -f pvc-s3.yaml -n kuberay
8+
kubectl apply -f pvc-s3.yaml
109

1110
echo "Describing pvc s3-claim"
12-
kubectl describe pvc s3-claim -n kuberay
11+
kubectl describe pvc s3-claim

Container-Root/ray/ops/ray-expose.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ if [ "$?" == 0 ]; then
66
else
77
PID_FILE="$HOME/port-forward.pid"
88
# kubectl port-forward --address 0.0.0.0 service/raycluster-kuberay-head-svc 8265:8265 > /dev/null 2>&1 &
9-
export SERVICEHEAD=$(kubectl get service -n kuberay | grep head-svc | awk '{print $1}' | head -n 1)
9+
export SERVICEHEAD=$(kubectl get service | grep head-svc | awk '{print $1}' | head -n 1)
1010

11-
kubectl port-forward --address 0.0.0.0 service/${SERVICEHEAD} -n kuberay 8265:8265 > /dev/null 2>&1 &
11+
kubectl port-forward --address 0.0.0.0 service/${SERVICEHEAD} 8265:8265 > /dev/null 2>&1 &
1212
echo $! > "$PID_FILE"
1313
echo "Port-forward started, PID $! saved in $PID_FILE"
1414
sleep 1

Container-Root/ray/raycluster/jobs/job-list.sh

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ CMD="ray job list --address http://localhost:8265 | sed -n \"s/.*submission_id='
99
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
1010
eval "$CMD"
1111

12+
echo ""
13+
1214
#echo -e "\nTo get the status of a job, please run './job-status.sh <submission_id>' where <submission_id> is listed for your jobs above."
1315
#echo -e "\nTo get the logs of a job, please run './job-logs.sh <submission_id>' where <submission_id> is listed for your jobs above."
1416
#echo -e "\nTo stop a job, please run './job-stop.sh <submission_id>' where <submission_id> is listed for your jobs above.\n"

Container-Root/ray/raycluster/jobs/job-logs.sh

100644100755
+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ if [ -z "$1" ]; then
1616
fi
1717

1818
# Assign the user's input to a variable
19-
submission_id=$1
19+
submission_id=$(ray job list --address http://localhost:8265 | sed -n "s/.*submission_id='\([^']*\)'.*entrypoint='\([^']*\)'.*/submission_id: \1, entrypoint: \2/p" | grep $1 | head -n 1 | cut -d ' ' -f 2 | cut -d ',' -f 1)
20+
# submission_id=$1
2021

2122
CMD="ray job logs --address http://localhost:8265 $submission_id"
2223

Container-Root/ray/raycluster/jobs/job-status.sh

100644100755
+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ if [ -z "$1" ]; then
1515
fi
1616

1717
# Assign the user's input to a variable
18-
submission_id=$1
18+
submission_id=$(ray job list --address http://localhost:8265 | sed -n "s/.*submission_id='\([^']*\)'.*entrypoint='\([^']*\)'.*/submission_id: \1, entrypoint: \2/p" | grep $1 | head -n 1 | cut -d ' ' -f 2 | cut -d ',' -f 1)
19+
# submission_id=$1
1920

2021
CMD="ray job status --address http://localhost:8265 $submission_id"
2122

Container-Root/ray/raycluster/jobs/job-stop.sh

100644100755
+4-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ if [ -z "$1" ]; then
77
echo "Error: No submission_id provided."
88
echo "Usage: ./job-status.sh <submission_id>"
99
echo "List of jobs to choose from:"
10+
echo ""
1011
ray job list --address http://localhost:8265 | sed -n "s/.*submission_id='\([^']*\)'.*entrypoint='\([^']*\)'.*/submission_id: \1, entrypoint: \2/p"
1112
echo -e "\n"
1213
exit 1
1314
fi
1415

1516
# Assign the user's input to a variable
16-
submission_id=$1
17+
submission_id=$(ray job list --address http://localhost:8265 | sed -n "s/.*submission_id='\([^']*\)'.*entrypoint='\([^']*\)'.*/submission_id: \1, entrypoint: \2/p" | grep $1 | head -n 1 | cut -d ' ' -f 2 | cut -d ',' -f 1)
18+
19+
# submission_id=$1
1720

1821
CMD="ray job stop --address http://localhost:8265 $submission_id"
1922

Container-Root/ray/raycluster/jobs/job-submit.sh

100644100755
+9-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ submit_via_head() {
2525
local working_dir="$script_name"
2626

2727
# Get the name of the head pod
28-
head_pod=$(kubectl get pods -n kuberay --selector=ray.io/node-type=head -o custom-columns=POD:metadata.name --no-headers)
28+
head_pod=$(kubectl get pods --selector=ray.io/node-type=head -o custom-columns=POD:metadata.name --no-headers)
2929

3030
# Check if the head pod is found
3131
if [ -z "$head_pod" ]; then
@@ -35,14 +35,14 @@ submit_via_head() {
3535

3636
# Copy the script to the head pod
3737
if [ -d "$working_dir" ]; then
38-
kubectl cp "$working_dir/$script_name.py" "$head_pod:/tmp/$script_name.py" -n kuberay
38+
kubectl cp "$working_dir/$script_name.py" "$head_pod:/tmp/$script_name.py"
3939
else
4040
echo "Error: Working directory '$working_dir' does not exist."
4141
exit 1
4242
fi
4343

4444
# Run the Python script on the head pod
45-
CMD="kubectl exec -it "$head_pod" -n kuberay -- python \"/tmp/$script_name.py\""
45+
CMD="kubectl exec -it "$head_pod" -- python \"/tmp/$script_name.py\""
4646
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
4747
eval "$CMD"
4848
}
@@ -53,7 +53,7 @@ submit_local_job() {
5353
local script_name="$1"
5454
local script_path="$2"
5555

56-
head_pod=$(kubectl get pods -n kuberay --selector=ray.io/node-type=head -o custom-columns=POD:metadata.name --no-headers)
56+
head_pod=$(kubectl get pods --selector=ray.io/node-type=head -o custom-columns=POD:metadata.name --no-headers)
5757

5858
# Check if the head pod is found
5959
if [ -z "$head_pod" ]; then
@@ -62,11 +62,11 @@ submit_local_job() {
6262
fi
6363

6464
# Check if the file exists inside the pod
65-
file_exists=$(kubectl exec "$head_pod" -n kuberay -- bash -c "[ -f $script_path/$script_name.py ] && echo 'true' || echo 'false'")
65+
file_exists=$(kubectl exec "$head_pod" -- bash -c "[ -f $script_path/$script_name.py ] && echo 'true' || echo 'false'")
6666

6767
if [ "$file_exists" == "true" ]; then
6868
# submit_via_head "$script_name"
69-
CMD="kubectl exec -it \"$head_pod\" -n kuberay -- python \"$script_path/$script_name.py\""
69+
CMD="kubectl exec -it \"$head_pod\" -- python \"$script_path/$script_name.py\""
7070
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
7171
eval "$CMD"
7272
else
@@ -77,7 +77,9 @@ submit_local_job() {
7777

7878
# Check if a script name or path has been provided
7979
if [ "$#" -eq 0 ]; then
80-
echo "Usage: $0 <script-name> [script-path]"
80+
echo ""
81+
echo "Usage: $0 <script-name> optional:[script-path]"
82+
echo ""
8183
exit 1
8284
fi
8385

Container-Root/ray/raycluster/raycluster-config.sh

100644100755
File mode changed.

Container-Root/ray/raycluster/raycluster-create.sh

100644100755
File mode changed.

Container-Root/ray/raycluster/raycluster-delete.sh

100644100755
File mode changed.

Container-Root/ray/raycluster/raycluster-pods.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
CMD="kubectl get pods --namespace kuberay"
3+
CMD="kubectl get pods"
44

55
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
66
eval "$CMD"

Container-Root/ray/raycluster/raycluster-status.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
CMD="kubectl get raycluster --namespace kuberay"
3+
CMD="kubectl get raycluster"
44

55
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
66
eval "$CMD"

Container-Root/ray/raycluster/raycluster-template-autoscaler.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: ray.io/v1
22
kind: RayCluster
33
metadata:
44
name: raycluster-autoscaler
5-
namespace: kuberay
65
labels:
76
controller-tools.k8s.io: "1.0"
87
spec:

Container-Root/ray/raycluster/raycluster-template.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: ray.io/v1alpha1
22
kind: RayCluster
33
metadata:
44
name: rayml
5-
namespace: kuberay
65
labels:
76
controller-tools.k8s.io: "1.0"
87
spec:

Container-Root/ray/rayjob/rayjob-create.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ JOB=$(echo "$JOB" | tr '[:upper:]' '[:lower:]')
2525
# exit 2
2626
# fi
2727

28-
CMD="kubectl apply -f ${JOB}/ray-job.${JOB}.yaml -n kuberay"
28+
CMD="kubectl apply -f ${JOB}/ray-job.${JOB}.yaml"
2929
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
3030
eval "$CMD"
3131

Container-Root/ray/rayjob/rayjob-delete.sh

100644100755
+3-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ if [ -z "$1" ]; then
1414
fi
1515

1616
# Set the model name from the argument
17-
JOB=$1
17+
# JOB=$1
18+
JOB=$(kubectl get rayjob | grep $1 | head -n 1 | cut -d ' ' -f 1)
1819

1920
# Convert the model name to lowercase for consistency
2021
JOB=$(echo "$JOB" | tr '[:upper:]' '[:lower:]')
2122

22-
CMD="kubectl delete rayjob $JOB -n kuberay"
23+
CMD="kubectl delete rayjob $JOB"
2324
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
2425
eval "$CMD"
2526

Container-Root/ray/rayjob/rayjob-logs.sh

100644100755
+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ if [ -z "$1" ]; then
1414
fi
1515

1616
# Assign the user's input to a variable
17-
JOB=$1
17+
# JOB=$1
18+
JOB=$(kubectl get rayjob | grep $1 | head -n 1 | cut -d ' ' -f 1)
1819

19-
CMD="kubectl logs -l=job-name=$JOB -n kuberay"
20+
21+
CMD="kubectl logs -l=job-name=$JOB"
2022
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
2123
eval "$CMD"

Container-Root/ray/rayjob/rayjob-pods.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
CMD="kubectl get pods --namespace kuberay"
3+
CMD="kubectl get pods"
44
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
55
eval "$CMD"
66

Container-Root/ray/rayjob/rayjob-status.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
CMD="kubectl get rayjob --namespace kuberay"
3+
CMD="kubectl get rayjob"
44
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
55
eval "$CMD"
66

Container-Root/ray/rayservice/rayservice-create.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ MODEL_NAME=$1
1818
MODEL_NAME=$(echo "$MODEL_NAME" | tr '[:upper:]' '[:lower:]')
1919

2020

21-
CMD="kubectl apply -f ${MODEL_NAME}/ray-service.${MODEL_NAME}.yaml -n kuberay"
21+
CMD="kubectl apply -f ${MODEL_NAME}/ray-service.${MODEL_NAME}.yaml"
2222
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
2323
eval "$CMD"
2424

@@ -45,12 +45,12 @@ echo "Waiting for query service... this service is created after the Ray Serve a
4545
SVC_CNT=0
4646
while [ "$SVC_CNT" == "0" ]; do
4747
sleep 2
48-
SVC_CNT=$(kubectl -n kuberay get svc | grep ${MODEL_NAME}-serve-svc | wc -l)
48+
SVC_CNT=$(kubectl get svc | grep ${MODEL_NAME}-serve-svc | wc -l)
4949
done
5050
echo ""
5151
echo "Forwarding the port for Stable Diffusion Query"
5252
echo ""
53-
kubectl port-forward svc/${MODEL_NAME}-serve-svc -n kuberay 8000 > /dev/null 2>&1 &
53+
kubectl port-forward svc/${MODEL_NAME}-serve-svc 8000 > /dev/null 2>&1 &
5454

5555
if [ $? -eq 0 ]; then
5656
echo "Query is ready..."
@@ -62,10 +62,10 @@ if [ $? -eq 0 ]; then
6262
else
6363
echo "Failed to port forward query..."
6464
echo ""
65-
echo "Issue may be service "svc/${MODEL_NAME}-serve-svc" is not ready... please run 'kubectl get svc -n kuberay' to double check."
66-
echo "If it becomes ready, please run 'kubectl port-forward svc/stable-diffusion-serve-svc -n kuberay 8000'"
65+
echo "Issue may be service "svc/${MODEL_NAME}-serve-svc" is not ready... please run 'kubectl get svc' to double check."
66+
echo "If it becomes ready, please run 'kubectl port-forward svc/stable-diffusion-serve-svc 8000'"
6767
echo ""
6868
fi
6969

70-
echo "Run './rayservice-status.sh' to view the serve status."
71-
echo "Run 'kubectl get pods -n kuberay' to view cluster pods."
70+
echo "Run './rayservice-status.sh' or ' to view the serve status."
71+
echo "Run 'kubectl get pods' or 'kgp' to view cluster pods."

Container-Root/ray/rayservice/rayservice-delete.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MODEL_NAME=$1
1919
# Convert the model name to lowercase for consistency
2020
MODEL_NAME=$(echo "$MODEL_NAME" | tr '[:upper:]' '[:lower:]')
2121

22-
CMD="kubectl delete rayservice $MODEL_NAME -n kuberay"
22+
CMD="kubectl delete rayservice $MODEL_NAME"
2323
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
2424
eval "$CMD"
2525

@@ -34,7 +34,7 @@ fi
3434
if [ $? -eq 0 ]; then
3535
echo "Service deleted successfully for model: $MODEL_NAME."
3636
echo "Run './rayservice-status.sh' to view the serve status."
37-
echo "Run 'kgp -n kuberay' to view cluster pods."
37+
echo "Run 'kgp' to view cluster pods."
3838
echo ""
3939
else
4040
echo "Error deleting RayService for model: $MODEL_NAME"
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
CMD="kubectl get pods -n kuberay"
3+
CMD="kubectl get pods"
44
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
55
eval "$CMD"
66

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
CMD="kubectl get rayservice -n kuberay"
3+
CMD="kubectl get rayservice"
44
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
55
eval "$CMD"

Container-Root/ray/setup-dependencies.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ echo "Deploying FSX Dependences..."
3535
echo "Dynamically Provisioning FSX For Lustre Cluster... this may take a few minutes"
3636
./deploy/fsx/dynamic-create.sh
3737

38-
echo "Please wait until FSx Cluster is up and ready until you deploy Ray Cluster. Please check AWS Console, or run fsx-list.sh, or use alias fl, or run 'kubectl get pvc -n kuberay' and wait until status is 'Bound'"
38+
echo "Please wait until FSx Cluster is up and ready until you deploy Ray Cluster. Please check AWS Console, or run fsx-list.sh, or use alias fl, or run 'kubectl get pvc' and wait until status is 'Bound'"

0 commit comments

Comments
 (0)