Skip to content

Commit 1cb52f5

Browse files
authored
Merge pull request #181 from shxingch/docker-Xvfb
[Update] Xvbf virtual display to docker
2 parents 89ce695 + 0d03f61 commit 1cb52f5

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

template/docker-template/run_python.shell

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
#!/bin/bash
22
set -e
33

4+
if ! command -v Xvfb &> /dev/null; then
5+
echo "Xvfb is not installed. Installing..."
6+
sudo apt-get update && sudo apt-get install -y xvfb
7+
fi
8+
9+
if xdpyinfo -display :99 >/dev/null 2>&1; then
10+
echo "Display :99 already exists. Skipping virtual display setup."
11+
else
12+
echo "Starting virtual display on :99..."
13+
Xvfb :99 -screen 0 1280x1024x24 &
14+
export DISPLAY=:99
15+
fi
16+
17+
export DISPLAY=:99
18+
419
echo "Starting test_bathing.py script..."
520
python ../test_bathing.py || { echo "Failed to run test_bathing.py"; exit 1; }
621

@@ -11,5 +26,19 @@ python ../test_dressing.py || { echo "Failed to run test_dressing.py"; exit 1; }
1126

1227
echo "Finished test_dressing.py script."
1328

29+
if [ -f /root/.config/unity3d/RCareWorld/DressingPlayer/spongeScore.json ]; then
30+
echo "Contents of spongeScore.json:"
31+
cat /root/.config/unity3d/RCareWorld/DressingPlayer/spongeScore.json
32+
else
33+
echo "spongeScore.json file not found!"
34+
fi
35+
36+
if [ -f /root/.config/unity3d/RCareWorld/DressingPlayer/dressingScore.json ]; then
37+
echo "Contents of dressingScore.json:"
38+
cat /root/.config/unity3d/RCareWorld/DressingPlayer/dressingScore.json
39+
else
40+
echo "dressingScore.json file not found!"
41+
fi
42+
1443
echo "All scripts have finished running."
1544
sleep infinity

0 commit comments

Comments
 (0)