Skip to content

Commit 7036fc8

Browse files
naderzareSK2iP
authored andcommitted
run proxy in debug mode
1 parent 90417f1 commit 7036fc8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

start-team.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def run_server_script(args):
2727
def run_start_script(args):
2828
# Start the start.sh script in its own directory as a new process group
2929
process = subprocess.Popen(
30-
['bash', 'start.sh', '-t', args.team_name, '--rpc-port', args.rpc_port, '--rpc-type', 'grpc'],
30+
['bash', 'start.sh' if not args.debug else 'start-debug.sh', '-t', args.team_name, '--rpc-port', args.rpc_port, '--rpc-type', 'grpc'],
3131
cwd='scripts/proxy', # Corrected directory to where start.sh is located
3232
preexec_fn=os.setsid, # Create a new session and set the process group ID
3333
stdout=subprocess.PIPE,
@@ -60,8 +60,9 @@ def kill_process_group(process):
6060
parser = argparse.ArgumentParser(description='Run server and team scripts.')
6161
parser.add_argument('-t', '--team_name', required=False, help='The name of the team', default='CLS')
6262
parser.add_argument('--rpc-port', required=False, help='The port of the server', default='50051')
63+
parser.add_argument('-d', '--debug', required=False, help='Enable debug mode', default=False, action='store_true')
6364
args = parser.parse_args()
64-
65+
6566
try:
6667
# Check Python requirements
6768
start_team_logger.debug("Checking Python requirements...")

start-team.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ fi
1717

1818
team_name="CLS"
1919
rpc_port=50051
20+
debug=false
2021

2122
# help function
2223
usage() {
@@ -38,6 +39,9 @@ do
3839
rpc_port=$2
3940
shift
4041
;;
42+
-d|--debug)
43+
debug=true
44+
;;
4145
*)
4246
echo 1>&2
4347
echo "invalid option \"${1}\"." 1>&2
@@ -77,7 +81,11 @@ echo "Starting start.sh with team name: $team_name and ..."
7781
log_dir="logs/proxy.log"
7882
abspath=$(realpath $log_dir)
7983
cd scripts/proxy
80-
bash start.sh -t "$team_name" --rpc-port $rpc_port --rpc-type grpc >> $abspath 2>&1 &
84+
if [ "$debug" = true ]; then
85+
bash start-debug.sh -t "$team_name" --rpc-port $rpc_port --rpc-type grpc >> $abspath 2>&1 &
86+
else
87+
bash start.sh -t "$team_name" --rpc-port $rpc_port --rpc-type grpc >> $abspath 2>&1 &
88+
fi
8189
start_pid=$!
8290

8391
# Wait for both background processes to finish

0 commit comments

Comments
 (0)