kopia lustrzana https://github.com/OpenDroneMap/WebODM
Add --worker-cpus option
rodzic
24f3b38dce
commit
bc0c4ac3e0
|
@ -0,0 +1,4 @@
|
||||||
|
version: '2.2'
|
||||||
|
services:
|
||||||
|
worker:
|
||||||
|
cpus: ${WO_WORKER_CPUS}
|
32
webodm.sh
32
webodm.sh
|
@ -56,13 +56,13 @@ case $key in
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
--media-dir)
|
--media-dir)
|
||||||
WO_MEDIA_DIR=$(realpath "$2")
|
WO_MEDIA_DIR=$(realpath "$2")
|
||||||
export WO_MEDIA_DIR
|
export WO_MEDIA_DIR
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
--db-dir)
|
--db-dir)
|
||||||
WO_DB_DIR=$(realpath "$2")
|
WO_DB_DIR=$(realpath "$2")
|
||||||
export WO_DB_DIR
|
export WO_DB_DIR
|
||||||
shift # past argument
|
shift # past argument
|
||||||
|
@ -72,19 +72,19 @@ case $key in
|
||||||
export WO_SSL=YES
|
export WO_SSL=YES
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
--ssl-key)
|
--ssl-key)
|
||||||
WO_SSL_KEY=$(realpath "$2")
|
WO_SSL_KEY=$(realpath "$2")
|
||||||
export WO_SSL_KEY
|
export WO_SSL_KEY
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
--ssl-cert)
|
--ssl-cert)
|
||||||
WO_SSL_CERT=$(realpath "$2")
|
WO_SSL_CERT=$(realpath "$2")
|
||||||
export WO_SSL_CERT
|
export WO_SSL_CERT
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
--ssl-insecure-port-redirect)
|
--ssl-insecure-port-redirect)
|
||||||
export WO_SSL_INSECURE_PORT_REDIRECT="$2"
|
export WO_SSL_INSECURE_PORT_REDIRECT="$2"
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
|
@ -103,11 +103,11 @@ case $key in
|
||||||
dev_mode=true
|
dev_mode=true
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
--gpu)
|
--gpu)
|
||||||
gpu=true
|
gpu=true
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
--broker)
|
--broker)
|
||||||
export WO_BROKER="$2"
|
export WO_BROKER="$2"
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
|
@ -136,11 +136,17 @@ case $key in
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
--worker-memory)
|
--worker-memory)
|
||||||
WO_WORKER_MEMORY="$2"
|
WO_WORKER_MEMORY="$2"
|
||||||
export WO_WORKER_MEMORY
|
export WO_WORKER_MEMORY
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
|
;;
|
||||||
|
--worker-cpus)
|
||||||
|
WO_WORKER_CPUS="$2"
|
||||||
|
export WO_WORKER_CPUS
|
||||||
|
shift # past argument
|
||||||
|
shift # past value
|
||||||
;;
|
;;
|
||||||
*) # unknown option
|
*) # unknown option
|
||||||
POSITIONAL+=("$1") # save it in an array for later
|
POSITIONAL+=("$1") # save it in an array for later
|
||||||
|
@ -185,6 +191,7 @@ usage(){
|
||||||
echo " --gpu Use GPU NodeODM nodes (Linux only) (default: disabled)"
|
echo " --gpu Use GPU NodeODM nodes (Linux only) (default: disabled)"
|
||||||
echo " --settings Path to a settings.py file to enable modifications of system settings (default: None)"
|
echo " --settings Path to a settings.py file to enable modifications of system settings (default: None)"
|
||||||
echo " --worker-memory Maximum amount of memory allocated for the worker process (default: unlimited)"
|
echo " --worker-memory Maximum amount of memory allocated for the worker process (default: unlimited)"
|
||||||
|
echo " --worker-cpus Maximum number of CPUS allocated for the worker process (default: all)"
|
||||||
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
@ -371,6 +378,7 @@ start(){
|
||||||
echo "Default Nodes: $WO_DEFAULT_NODES"
|
echo "Default Nodes: $WO_DEFAULT_NODES"
|
||||||
echo "Settings: $WO_SETTINGS"
|
echo "Settings: $WO_SETTINGS"
|
||||||
echo "Worker memory limit: $WO_WORKER_MEMORY"
|
echo "Worker memory limit: $WO_WORKER_MEMORY"
|
||||||
|
echo "Worker cpus limit: $WO_WORKER_CPUS"
|
||||||
echo "================================"
|
echo "================================"
|
||||||
echo "Make sure to issue a $0 down if you decide to change the environment."
|
echo "Make sure to issue a $0 down if you decide to change the environment."
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -445,6 +453,10 @@ start(){
|
||||||
command+=" -f docker-compose.worker-memory.yml"
|
command+=" -f docker-compose.worker-memory.yml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$WO_WORKER_CPUS" ]; then
|
||||||
|
command+=" -f docker-compose.worker-cpu.yml"
|
||||||
|
fi
|
||||||
|
|
||||||
command="$command up"
|
command="$command up"
|
||||||
|
|
||||||
if [[ $detached = true ]]; then
|
if [[ $detached = true ]]; then
|
||||||
|
|
Ładowanie…
Reference in New Issue