-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandalone.sh
executable file
·41 lines (31 loc) · 1.21 KB
/
standalone.sh
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
#!/usr/bin/env bash
export WORKDIR=/tmp/mdstudio
export MD_CONFIG_ENVIRONMENTS=dev,docker
# Docker and standalone services
SERVICES=("mdstudio_structures" "mdstudio_smartcyp" "mdstudio_atb" "mdstudio_amber" "mdstudio_propka" "mdstudio_haddock" "mdstudio_pylie")
STANDALONE_SERVICES=( "mdstudio_gromacs")
MDSTUDIO_LOGS=$( pwd )"/logs"
MDSTUDIO_PYTHON=$( which python )
# Create temporate files directory for services
ALL_SERVICES=(${SERVICES[@]} ${STANDALONE_SERVICES[@]})
for s in ${ALL_SERVICES[@]}; do
mkdir -p ${WORKDIR}/${s}
done
# start docker microservices
docker-compose up -d crossbar common_resources
docker-compose up -d ${SERVICES[@]}
# Start standalone components locally
# These are expected to have been installed locally by the user
# Store process PID's in a local file to be used by MDStudio's 'stop.sh' script to
# terminate standalone services.
# Remove PID file
if [[ -e standalone.pid ]]; then
rm standalone.pid
fi
# Start standalone components locally
for service in ${STANDALONE_SERVICES[@]}; do
${MDSTUDIO_PYTHON} -u -m ${service} >> ${MDSTUDIO_LOGS}"/standalone.log" &
spid=$!
echo ${spid} >> standalone.pid
echo "Starting ${service} as standalone component status code: $? PID: ${spid}"
done