-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·43 lines (35 loc) · 1.17 KB
/
run.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
42
43
#!/bin/bash
WORKING_DIR=${1}
COMPI_PARAMS=${2:-""}
function info() {
tput setaf 2
echo -e "[INFO] [run.sh] ${1}"
tput sgr0
}
function show_error() {
tput setaf 1
echo -e "${1}"
tput sgr0
}
if [ $# -ne 1 ] && [ $# -ne 2 ]; then
show_error "[ERROR]: This script requires one or two arguments (working directory and, optionally, Compi CLI parameters)"
exit 1
fi
info "Running SEDA-Compi pipeline at ${WORKING_DIR}"
PIPELINE_PARAMS_FILE=""
if [ -f "${WORKING_DIR}/compi.params" ]; then
PIPELINE_PARAMS_FILE="--params ${WORKING_DIR}/compi.params"
info "Pipeline parameters found at ${WORKING_DIR}/compi.params"
fi
DOCKER_ENV_PARAMS=""
if [ ! -z "${SEDA_JAVA_MEMORY}" ]; then
DOCKER_ENV_PARAMS="-e SEDA_JAVA_MEMORY=${SEDA_JAVA_MEMORY}"
info "Docker environment parameters: ${DOCKER_ENV_PARAMS}"
fi
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp \
-v "${WORKING_DIR}:${WORKING_DIR}" \
-w "${WORKING_DIR}" \
${DOCKER_ENV_PARAMS} \
pegi3s/seda-pipeline-phylogenetics-datasets \
/compi run -p /pipeline.xml -o -r /pipeline-runner.xml ${COMPI_PARAMS} ${PIPELINE_PARAMS_FILE} -- \
--workingDirectory ${WORKING_DIR}