Skip to content

Commit

Permalink
fixes for multi-model serving
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Jan 26, 2024
1 parent c2dab90 commit a0b3d0d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions rllm/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ if [ "X$CUDA_VISIBLE_DEVICES" = "X" ] ; then
echo "KILL $P"
kill $P
fi
else
echo "CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES"
fi

if [ "$1" = "--loop" ] ; then
Expand Down
25 changes: 14 additions & 11 deletions scripts/host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ INNER_STOP=0
FULL=0
STOP=0
START_CONTAINER=0
PULL=1

WS=`cd $(dirname $0)/..; pwd`

test -f .devcontainer/Dockerfile-cuda || exit 1

while [ $# -gt 0 ] ; do
case "$1" in
--no-pull ) PULL=0 ;;
--env )
. "$2"
export CUDA_VISIBLE_DEVICES
FOLDER=`dirname $2`
shift
;;
Expand Down Expand Up @@ -62,13 +63,15 @@ fi

if [ "$INNER" = "model" ] ; then
echo "in server for $MODEL in $FOLDER"
docker_cmd "cd $FOLDER && /workspaces/aici/rllm/server.sh --loop $MODEL --port $FWD_PORT"
docker_cmd "cd $FOLDER && CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES /workspaces/aici/rllm/server.sh --loop $MODEL --port $FWD_PORT"
exit 0
fi

echo "Pulling..."
git pull
(cd tmp/ws-http-tunnel && git pull)
if [ "$PULL" = 1 ] ; then
echo "Pulling..."
git pull
(cd tmp/ws-http-tunnel && git pull)
fi

if [ "$FULL" = 1 ] ; then
echo "Building full..."
Expand Down Expand Up @@ -103,13 +106,13 @@ if [ $START_CONTAINER = 1 ] ; then
fi

echo "Stopping inner servers..."
P=`ps -ax|grep 'docker [e]xec' | awk '{print $1}' | xargs echo`
if [ "X$P" != "X" ] ; then
echo "KILL $P"
kill $P
fi
# P=`ps -ax|grep 'docker [e]xec' | awk '{print $1}' | xargs echo`
# if [ "X$P" != "X" ] ; then
# echo "KILL $P"
# kill $P
# fi

# docker_cmd "./scripts/kill-server.sh"
docker_cmd "./scripts/kill-server.sh"

echo "Building ..."
docker_cmd "cd rllm && ./server.sh build"
Expand Down
2 changes: 1 addition & 1 deletion scripts/kill-server.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

P=`ps -ax|grep 'aicir[t]\|rllm-serve[r]\|\./server\.sh\|node \./built/worker' | awk '{print $1}' | xargs echo`
P=`ps -ax|grep 'aicir[t]\|rllm-serve[r]\|/serve[r]\.sh\|node.*/buil[t]/worker' | awk '{print $1}' | xargs echo`

if [ "X$P" != "X" ] ; then
echo "KILL $P"
Expand Down

0 comments on commit a0b3d0d

Please sign in to comment.