-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·41 lines (34 loc) · 1020 Bytes
/
run.sh
File metadata and controls
executable file
·41 lines (34 loc) · 1020 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
40
41
#!/bin/bash
OS=$(uname)
MEMORY=$(vmstat -s -S M | awk '/total memory/ {print $1}')
SHM="$(($MEMORY / 2))MB"
flags="$*"
if [ -z "$flags" ]
then
flags="--help"
fi
if [ "$flags" = "--update" -o "$flags" = "update" ]; then
docker pull ghcr.io/biometix/bqat-cli:latest
docker inspect ghcr.io/biometix/bqat-cli:latest | grep image.version
else
[ ! -d data ] && mkdir data
sub="\<"
flags=${flags//</"$sub"}
sub="\>"
flags=${flags//>/"$sub"}
if [ "$OS" = "Linux" -o "$OS" = "Darwin" ]; then
docker run --rm -it \
--shm-size="$SHM" \
-v "$(pwd)"/data:/app/data \
ghcr.io/biometix/bqat-cli:latest \
"python3 -m bqat -W $(pwd) $flags"
elif [[ "$OS" =~ "MINGW64" ]]; then
docker run --rm -it \
--shm-size="$SHM" \
-v //$(PWD)/data:/app/data \
ghcr.io/biometix/bqat-cli:latest \
"python3 -m bqat -W $(pwd) $flags"
else
echo "Error. Unidentified Host."
fi
fi