-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy patheval.sh
More file actions
39 lines (34 loc) · 890 Bytes
/
Copy patheval.sh
File metadata and controls
39 lines (34 loc) · 890 Bytes
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
#!/bin/bash
function evaluate_directly() {
echo "Evaluating Directly, Parameters: $*"
python evaluate.py $*
}
# function evaluate_in_docker(image_name, evaluating_parameters)
function evaluate_in_docker() {
DOCKER_IMAGE=$1
shift
echo "Evaluating in docker $DOCKER_IMAGE, Parameters: $*"
docker run -it --rm --network host -v $(pwd):/root/workspace -w /root/workspace $DOCKER_IMAGE \
bash -c "
umask 0
[ -f /root/.setup.sh ] && bash /root/.setup.sh
python evaluate.py $*
"
}
get_min() {
if [ "$1" -lt "$2" ]; then
echo "$1"
else
echo "$2"
fi
}
check_and_append_suffix() {
local dir="$1"
local count=1
local new_dir="${dir}"
while [[ -d "${new_dir}" ]]; do
new_dir="${dir}-$(printf '%04d' "${count}")"
count=$((count + 1))
done
echo "${new_dir}"
}