forked from skypilot-org/skypilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env_check.yaml
41 lines (36 loc) · 1 KB
/
env_check.yaml
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
num_nodes: 2
setup: |
echo "here"
echo "export TEST_VAR=test" >> ~/.bashrc
[[ -v CUDA_VISIBLE_DEVICES ]] && exit 1 || exit 0
export CUDA_VISIBLE_DEVICES=1
[[ -v CUDA_VISIBLE_DEVICES ]] && exit 0 || exit 1
run: |
if [[ -z "${TEST_VAR}" ]]; then
echo "TEST_VAR is not set"
exit 1
else
echo "TEST_VAR is set to ${TEST_VAR}"
fi
if [[ -z "$SKYPILOT_NODE_RANK" ]]; then
echo "SKYPILOT_NODE_RANK is not set"
exit 1
else
echo "SKYPILOT_NODE_RANK is set to ${SKYPILOT_NODE_RANK}"
fi
if [[ -z "$SKYPILOT_NODE_IPS" ]]; then
echo "SKYPILOT_NODE_IPS is not set"
exit 1
else
echo "SKYPILOT_NODE_IPS is set to ${SKYPILOT_NODE_IPS}"
echo "${SKYPILOT_NODE_IPS}"
echo "${SKYPILOT_NODE_IPS}" | wc -l | grep 2 || exit 1
fi
worker_addr=`echo "$SKYPILOT_NODE_IPS" | sed -n 2p`
echo Worker IP: $worker_addr
if [[ -z "$SKYPILOT_TASK_ID" ]]; then
echo "SKYPILOT_TASK_ID is not set"
exit 1
else
echo "SKYPILOT_TASK_ID is set to ${SKYPILOT_TASK_ID}"
fi