-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisvis
More file actions
executable file
·67 lines (49 loc) · 1.44 KB
/
disvis
File metadata and controls
executable file
·67 lines (49 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
#
# Simple bdocker demo
# Using Disvis - https://hub.docker.com/r/indigodatacloudapps/disvis/
#
# 2017 lalves@lip.pt
#
##
echo "### Clean up leftover files from previous runs\n"
rm -f script.*
echo "### WRITE SCRIPT: This script will run inside the container.\n"
cat <<EOT > ~/script.sh
#!/bin/bash
echo -e "\e[31m>>> Running in (hostname):\e[0m"
hostname
echo -e "\e[31m>>> Running as (id):\e[0m"
id
echo -e "\e[31m>>> Working dir (pwd):\e[0m"
pwd
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/lib64
export EX_DIR=/usr/local/disvis/test-cases/PRE5-PUP2-complex
echo -e "\n\e[31m>>> Running Disvis:\e[0m"
disvis /usr/local/disvis/test-cases/PRE5-PUP2-complex/O14250.pdb\
/usr/local/disvis/test-cases/PRE5-PUP2-complex/Q9UT97.pdb\
/usr/local/disvis/test-cases/PRE5-PUP2-complex/restraints.dat\
-p 2 -a 20.0 -vs 2 -d /tmp/out
echo -e "\n\e[31m>>> Output generated:\e[0m"
ls -l out/
cat out/*.out
rm -fr out
echo "I'm DONE!"
EOT
chmod +x ~/script.sh
echo -e "\n### PULL IMAGE: bdocker pull disvis\n"
bdocker pull indigodatacloudapps/disvis
echo -e "\n### RUN IMAGE: bdocker run container\n"
bdocker run -d\
-w /tmp/\
-v ~/:/tmp/\
indigodatacloudapps/disvis\
'/bin/bash -c "./script.sh > script.out 2>&1"'
sleep 5
echo -e "\n### INFO ON RUNNING CONTAINERS: bdocker ps\n"
bdocker ps
echo -e "\n### waiting until it's DONE"
tail -f script.out | while read LOGLINE
do
[[ "${LOGLINE}" == *"I'm DONE!"* ]] && pkill -P $$ tail
done