forked from skypilot-org/skypilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env_check.yaml
50 lines (43 loc) · 1.15 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
42
43
44
45
46
47
48
49
50
num_nodes: 2
workdir: .
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 [[ -d ~/sky_workdir/sky ]]; then
echo "~/sky_workdir/sky exists"
else
echo "~/sky_workdir/sky does not exist"
exit 1
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