Add --worker-memory parameter

pull/1392/head
Piero Toffanin 2023-09-15 14:11:23 -04:00
rodzic 9bfdf9c320
commit 93704420c6
2 zmienionych plików z 17 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,4 @@
version: '2.1'
services:
worker:
mem_limit: ${WO_WORKER_MEMORY}

Wyświetl plik

@ -135,6 +135,12 @@ case $key in
export WO_SETTINGS
shift # past argument
shift # past value
;;
--worker-memory)
WO_WORKER_MEMORY="$2"
export WO_WORKER_MEMORY
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
@ -178,6 +184,8 @@ usage(){
echo " --detached Run WebODM in detached mode. This means WebODM will run in the background, without blocking the terminal (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 " --worker-memory Maximum amount of memory allocated for the worker process (default: unlimited)"
exit
}
@ -348,6 +356,7 @@ start(){
echo "Celery Broker: $WO_BROKER"
echo "Default Nodes: $WO_DEFAULT_NODES"
echo "Settings: $WO_SETTINGS"
echo "Worker memory limit: $WO_WORKER_MEMORY"
echo "================================"
echo "Make sure to issue a $0 down if you decide to change the environment."
echo ""
@ -418,6 +427,10 @@ start(){
command+=" -f docker-compose.settings.yml"
fi
if [ ! -z "$WO_WORKER_MEMORY" ]; then
command+=" -f docker-compose.worker-memory.yml"
fi
command="$command up"
if [[ $detached = true ]]; then