Skip to content

Commit 962c950

Browse files
author
Peter Gagarinov
committed
ML server launching scripts now use absolute paths for everything which is safer
1 parent e7f7abf commit 962c950

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

ml_server/start_ml_server.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
2-
script_name=$0
3-
script_full_path=$(dirname "$0")
4-
python $script_full_path/ml_server.py
2+
SCRIPT_DIR=$(dirname "$0")
3+
pkill -9 -f ray # force-kill ray sessions to make sure we start from scratch
4+
python $SCRIPT_DIR/ml_server.py

ml_server/start_ml_server_with_conda.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
set -e
33
source /opt/miniconda/bin/activate
44
conda activate $1
5-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
6-
$DIR/start_ml_server.sh
5+
SCRIPT_DIR=$(dirname "$0")
6+
$SCRIPT_DIR/start_ml_server.sh
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/bash
22
set -e
33
#
4-
rm -f ./screenlog.0
5-
screen -S style_ml_server -X quit || true
6-
screen -S style_ml_server -L -d -m ./start_ml_server_with_conda.sh $1
4+
SCRIPT_DIR=$(dirname "$0")
5+
rm -f $SCRIPT_DIR/screenlog.0
6+
screen -X -S style_ml_server kill || true
7+
screen -S style_ml_server -L -d -m -Logfile $SCRIPT_DIR/screenlog.0 $SCRIPT_DIR/start_ml_server_with_conda.sh $1
78
sleep 1
89
screen -ls
910
sleep 1
1011
sync
11-
watch cat ./screenlog.0
12+
watch cat $SCRIPT_DIR/screenlog.0
1213

0 commit comments

Comments
 (0)