-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
44 lines (33 loc) · 1.56 KB
/
Copy pathrun.sh
File metadata and controls
44 lines (33 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -eo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLOUD=${1:?Usage: $0 <azure|nebius>}
NAMESPACE=ray
if [[ "$CLOUD" != "azure" && "$CLOUD" != "nebius" ]]; then
echo "Error: CLOUD must be 'azure' or 'nebius', got '$CLOUD'"
exit 1
fi
OVERLAY_DIR="$SCRIPT_DIR/overlays/$CLOUD"
# Install kuberay (skip if already deployed)
if ! helm status kuberay-operator -n $NAMESPACE &>/dev/null; then
helm repo add kuberay https://ray-project.github.io/kuberay-helm/
helm repo update
helm install kuberay-operator kuberay/kuberay-operator \
--version 1.5.1 \
--create-namespace \
--namespace $NAMESPACE \
--set nodeSelector.agentpool=system \
--wait
fi
kubectl -n $NAMESPACE delete configmap multimodel-distributed-training-scripts --ignore-not-found
kubectl -n $NAMESPACE delete rayjob multimodel-distributed-training --ignore-not-found
# Create the ConfigMap holding the job script
kubectl create configmap multimodel-distributed-training-scripts \
--from-file="$SCRIPT_DIR/main.py" \
-n $NAMESPACE --dry-run=client -o yaml | kubectl apply -f -
# Apply the kustomize overlay (RayJob)
kubectl apply -k "$OVERLAY_DIR"
# Wait for the job's pod to be running before streaming logs
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/created-by=kuberay-operator -n $NAMESPACE --timeout=3600s
kubectl wait --for=condition=Ready pod -l job-name=multimodel-distributed-training -n $NAMESPACE --timeout=3600s
kubectl -n $NAMESPACE logs -f -l job-name=multimodel-distributed-training --tail=100