forked from vmujadia/onemtbhashaverse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_run.sh
38 lines (31 loc) · 865 Bytes
/
docker_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
#!/bin/bash
export JOB_NAME="onemt-v3"
export IMAGE="onemt/onemtv3"
export TAG="latest"
export PYTHON_ENV="development"
export API_PORT=8084
export WORKERS=2
export TIMEOUT=300
export LOG_FOLDER=log/onemt-v3
echo ${IMAGE}:${TAG}
# Create log folder if not exists
if [ ! -d ${LOG_FOLDER} ]; then
mkdir ${LOG_FOLDER}
fi
# Add your authentication command for the docker image registry here
# force pull and update the image, use this in remote host only
#docker pull ${IMAGE}:${TAG}
# stop running container with same job name, if any
if [ "$(docker ps -a | grep $JOB_NAME)" ]; then
docker stop ${JOB_NAME} && docker rm ${JOB_NAME}
fi
# start docker container
docker run \
--rm \
--gpus all \
-p ${API_PORT}:8084 \
-e "WORKERS=${WORKERS}" \
-e "TIMEOUT=${TIMEOUT}" \
-e "PYTHON_ENV=${PYTHON_ENV}" \
-v "logs:/onemt/" \
-t ${IMAGE}:${TAG}