-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy-all.sh
executable file
·35 lines (30 loc) · 1.48 KB
/
deploy-all.sh
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
#!/bin/bash
# Check if we are running in the VStream directory
if [ ! -f "workers" ]; then
echo "Please run this script from the VStream directory"
exit 1
fi
PROJECT_DIR=/home/auroflow/code/vector-search/VStream
BUILD_FLAGS=$1
SSH_PORT=4399
# The first node in the workers file is the master
master=$(head -n 1 workers)
# The rest are workers
workers=$(tail -n +2 workers)
# Copy the project to the master, excluding anything from the build directory
echo "Copying project to $master"
rsync -a --delete --exclude "/flink-frontend/nohup.out" --exclude ".idea" --exclude "/build/" --exclude "/build-ncompress/" --exclude "/cmake-build-*" --exclude "/examples/" --exclude "/flink-frontend/tmp" --exclude "/flink-frontend/params/completed" --exclude ".git" $PROJECT_DIR/ $master:$PROJECT_DIR
for worker in $workers; do
echo "Copying project to $worker"
# Copy the project to the worker, excluding anything from the build directory
rsync -a --delete --exclude "/flink-frontend/nohup.out" --exclude ".idea" --exclude "/build/" --exclude "/build-ncompress/" --exclude "/cmake-build-*" --exclude "/examples/" --exclude "/flink-frontend/tmp" --exclude "/flink-frontend/params/completed" --exclude ".git" $PROJECT_DIR/ $worker:$PROJECT_DIR
done
if [ "$1" != "scripts" ]; then
echo "Building..."
ssh -p $SSH_PORT $master "cd $PROJECT_DIR && ./build.sh $BUILD_FLAGS" &
for worker in $workers; do
ssh -p $SSH_PORT $worker "cd $PROJECT_DIR && ./build.sh $BUILD_FLAGS" &
done
wait
fi
echo "all done"