kopia lustrzana https://github.com/OpenDroneMap/WebODM
Add posibility for multiple nodes
rodzic
a6979e46b3
commit
f287715d7c
1
.env
1
.env
|
@ -8,3 +8,4 @@ WO_SSL_INSECURE_PORT_REDIRECT=80
|
||||||
WO_DEBUG=NO
|
WO_DEBUG=NO
|
||||||
WO_DEV=NO
|
WO_DEV=NO
|
||||||
WO_BROKER=redis://broker
|
WO_BROKER=redis://broker
|
||||||
|
WO_DEFAULT_NODES=1
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
from nodeodm.models import ProcessingNode
|
||||||
|
|
||||||
|
def rename_default_node(apps, schema_editor):
|
||||||
|
for default_node in ProcessingNode.objects.filter(hostname='node-odm-1'):
|
||||||
|
default_node.hostname = 'webodm_node-odm_1'
|
||||||
|
default_node.defaults = {'hostname': 'webodm_node-odm_1', 'port': 3000}
|
||||||
|
default_node.save()
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('app', '0028_task_partial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(rename_default_node),
|
||||||
|
]
|
|
@ -6,12 +6,11 @@ version: '2.1'
|
||||||
services:
|
services:
|
||||||
webapp:
|
webapp:
|
||||||
depends_on:
|
depends_on:
|
||||||
- node-odm-1
|
- node-odm
|
||||||
environment:
|
environment:
|
||||||
- WO_CREATE_DEFAULT_PNODE=YES
|
- WO_DEFAULT_NODES
|
||||||
node-odm-1:
|
node-odm:
|
||||||
image: opendronemap/nodeodm
|
image: opendronemap/nodeodm
|
||||||
container_name: node-odm-1
|
|
||||||
ports:
|
ports:
|
||||||
- "3000"
|
- "3000"
|
||||||
restart: on-failure:10
|
restart: on-failure:10
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 48cf7f01b2ab96b6fdbdcb81d4ddc5828ae66c0e
|
|
4
start.sh
4
start.sh
|
@ -57,8 +57,8 @@ fi
|
||||||
echo Running migrations
|
echo Running migrations
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
|
|
||||||
if [[ "$WO_CREATE_DEFAULT_PNODE" = "YES" ]]; then
|
if [[ "$WO_DEFAULT_NODES" > 0 ]]; then
|
||||||
echo "from nodeodm.models import ProcessingNode; ProcessingNode.objects.update_or_create(hostname='node-odm-1', defaults={'hostname': 'node-odm-1', 'port': 3000})" | python manage.py shell
|
echo -e "from nodeodm.models import ProcessingNode\nfor node_index in map(str, range(1, $WO_DEFAULT_NODES + 1)):\n\t ProcessingNode.objects.update_or_create(hostname='webodm_node-odm_' + node_index, defaults={'hostname': 'webodm_node-odm_' + node_index, 'port': 3000})" | python manage.py shell
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$WO_CREATE_MICMAC_PNODE" = "YES" ]]; then
|
if [[ "$WO_CREATE_MICMAC_PNODE" = "YES" ]]; then
|
||||||
|
|
22
webodm.sh
22
webodm.sh
|
@ -18,7 +18,7 @@ if [[ $platform = "Windows" ]]; then
|
||||||
export COMPOSE_CONVERT_WINDOWS_PATHS=1
|
export COMPOSE_CONVERT_WINDOWS_PATHS=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
load_default_node=true
|
default_nodes=1
|
||||||
dev_mode=false
|
dev_mode=false
|
||||||
|
|
||||||
# Load default values
|
# Load default values
|
||||||
|
@ -87,7 +87,8 @@ case $key in
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
--no-default-node)
|
--no-default-node)
|
||||||
load_default_node=false
|
default_nodes=0
|
||||||
|
export WO_DEFAULT_NODES=0
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
--with-micmac)
|
--with-micmac)
|
||||||
|
@ -98,6 +99,12 @@ case $key in
|
||||||
detached=true
|
detached=true
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
|
--default-nodes)
|
||||||
|
default_nodes="$2"
|
||||||
|
export WO_DEFAULT_NODES="$2"
|
||||||
|
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
|
||||||
shift # past argument
|
shift # past argument
|
||||||
|
@ -125,7 +132,8 @@ usage(){
|
||||||
echo " --port <port> Set the port that WebODM should bind to (default: $DEFAULT_PORT)"
|
echo " --port <port> Set the port that WebODM should bind to (default: $DEFAULT_PORT)"
|
||||||
echo " --hostname <hostname> Set the hostname that WebODM will be accessible from (default: $DEFAULT_HOST)"
|
echo " --hostname <hostname> Set the hostname that WebODM will be accessible from (default: $DEFAULT_HOST)"
|
||||||
echo " --media-dir <path> Path where processing results will be stored to (default: $DEFAULT_MEDIA_DIR (docker named volume))"
|
echo " --media-dir <path> Path where processing results will be stored to (default: $DEFAULT_MEDIA_DIR (docker named volume))"
|
||||||
echo " --no-default-node Do not create a default NodeODM node attached to WebODM on startup (default: disabled)"
|
echo " --no-default-node Do not create a default NodeODM node attached to WebODM on startup (default: disabled). DEPRECATED: please use the argument 'default-nodes'"
|
||||||
|
echo " --default-nodes The amount of default NodeODM nodes attached to WebODM on startup (default: 1)"
|
||||||
echo " --with-micmac Create a NodeMICMAC node attached to WebODM on startup. Experimental! (default: disabled)"
|
echo " --with-micmac Create a NodeMICMAC node attached to WebODM on startup. Experimental! (default: disabled)"
|
||||||
echo " --ssl Enable SSL and automatically request and install a certificate from letsencrypt.org. (default: $DEFAULT_SSL)"
|
echo " --ssl Enable SSL and automatically request and install a certificate from letsencrypt.org. (default: $DEFAULT_SSL)"
|
||||||
echo " --ssl-key <path> Manually specify a path to the private key file (.pem) to use with nginx to enable SSL (default: None)"
|
echo " --ssl-key <path> Manually specify a path to the private key file (.pem) to use with nginx to enable SSL (default: None)"
|
||||||
|
@ -199,7 +207,7 @@ start(){
|
||||||
|
|
||||||
command="docker-compose -f docker-compose.yml"
|
command="docker-compose -f docker-compose.yml"
|
||||||
|
|
||||||
if [[ $load_default_node = true ]]; then
|
if [[ $default_nodes > 0 ]]; then
|
||||||
command+=" -f docker-compose.nodeodm.yml"
|
command+=" -f docker-compose.nodeodm.yml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -255,6 +263,10 @@ start(){
|
||||||
command+=" -d"
|
command+=" -d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $default_nodes > 0 ]]; then
|
||||||
|
command+=" --scale node-odm=$default_nodes"
|
||||||
|
fi
|
||||||
|
|
||||||
run "$command"
|
run "$command"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,7 +350,7 @@ elif [[ $1 = "update" ]]; then
|
||||||
|
|
||||||
command="docker-compose -f docker-compose.yml"
|
command="docker-compose -f docker-compose.yml"
|
||||||
|
|
||||||
if [[ $load_default_node = true ]]; then
|
if [[ $default_nodes > 0 ]]; then
|
||||||
command+=" -f docker-compose.nodeodm.yml"
|
command+=" -f docker-compose.nodeodm.yml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue