2020-03-20 12:43:57 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
rm -f last_checkpoint.out
|
|
|
|
pkill -f cartpole_server.py
|
|
|
|
sleep 1
|
|
|
|
|
2020-05-30 22:48:34 +02:00
|
|
|
if [ -f test_local_inference.sh ]; then
|
|
|
|
basedir="../../examples/serving"
|
2020-03-20 12:43:57 -07:00
|
|
|
else
|
|
|
|
basedir="rllib/examples/serving" # In bazel.
|
|
|
|
fi
|
|
|
|
|
2021-01-14 20:44:26 +01:00
|
|
|
# Do not attempt to restore from checkpoint; leads to errors on travis.
|
|
|
|
(python $basedir/cartpole_server.py --run=DQN --no-restore 2>&1 | grep -v 200) &
|
2020-03-20 12:43:57 -07:00
|
|
|
pid=$!
|
|
|
|
|
|
|
|
echo "Waiting for server to start"
|
2020-05-30 22:48:34 +02:00
|
|
|
while ! curl localhost:9900; do
|
2020-03-20 12:43:57 -07:00
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
sleep 2
|
2020-05-30 22:48:34 +02:00
|
|
|
python $basedir/cartpole_client.py --stop-reward=150 --inference-mode=remote
|
2020-03-20 12:43:57 -07:00
|
|
|
kill $pid
|
|
|
|
|