initial nodemicmac integration

pull/668/head
Jon-Pierre Stoermer 2019-05-09 18:24:27 -06:00
rodzic 0d485fc1f3
commit 6384f8966f
3 zmienionych plików z 36 dodań i 2 usunięć

Wyświetl plik

@ -0,0 +1,17 @@
# Chaining this file to the main docker-compose file adds
# a default processing node instance. This is best for users
# who are just getting started with WebODM.
version: '2.1'
services:
webapp:
entrypoint: /bin/bash -c "chmod +x /webodm/*.sh && /bin/bash -c \"/webodm/wait-for-postgres.sh db /webodm/wait-for-it.sh -t 0 broker:6379 -- /webodm/start.sh --create-micmac-pnode\""
depends_on:
- node-micmac-1
node-micmac-1:
image: dronemapper/node-micmac
container_name: node-micmac-1
ports:
- "3001"
restart: on-failure:10
oom_score_adj: 500

Wyświetl plik

@ -45,6 +45,8 @@ if [ "$1" = "--setup-devenv" ] || [ "$2" = "--setup-devenv" ]; then
npm install
cd nodeodm/external/NodeODM
npm install
cd nodeodm/external/NodeMICMAC
npm install
cd /webodm
echo Setup pip requirements...
@ -61,6 +63,10 @@ if [[ "$1" = "--create-default-pnode" ]]; 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
fi
if [[ "$1" = "--create-micmac-pnode" ]]; then
echo "from nodeodm.models import ProcessingNode; ProcessingNode.objects.update_or_create(hostname='node-micmac-1', defaults={'hostname': 'node-micmac-1', 'port': 3001})" | python manage.py shell
fi
export WO_HOST="${WO_HOST:=localhost}"
export WO_PORT="${WO_PORT:=8000}"

Wyświetl plik

@ -89,6 +89,10 @@ case $key in
load_default_node=false
shift # past argument
;;
--micmac-node)
load_micmac_node=true
shift # past argument
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
@ -117,6 +121,7 @@ usage(){
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 " --no-default-node Do not create a default NodeODM node attached to WebODM on startup (default: disabled)"
echo " --micmac-node 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-key <path> Manually specify a path to the private key file (.pem) to use with nginx to enable SSL (default: None)"
echo " --ssl-cert <path> Manually specify a path to the certificate file (.pem) to use with nginx to enable SSL (default: None)"
@ -194,6 +199,10 @@ start(){
command+=" -f docker-compose.nodeodm.yml"
fi
if [[ $load_micmac_node = true ]]; then
command+=" -f docker-compose.nodemicmac.yml"
fi
if [[ $dev_mode = true ]]; then
command+=" -f docker-compose.dev.yml"
fi
@ -240,13 +249,14 @@ start(){
}
down(){
run "docker-compose -f docker-compose.yml -f docker-compose.nodeodm.yml down --remove-orphans"
run "docker-compose -f docker-compose.yml -f docker-compose.nodeodm.yml -f docker-compose.nodemicmac.yml down --remove-orphans"
}
rebuild(){
run "docker-compose down --remove-orphans"
run "rm -fr node_modules/ || sudo rm -fr node_modules/"
run "rm -fr nodeodm/external/NodeODM || sudo rm -fr nodeodm/external/NodeODM"
run "rm -fr nodeodm/external/NodeMICMAC || sudo rm -fr nodeodm/external/NodeMICMAC"
run "docker-compose -f docker-compose.yml -f docker-compose.build.yml build --no-cache"
#run "docker images --no-trunc -aqf \"dangling=true\" | xargs docker rmi"
echo -e "\033[1mDone!\033[0m You can now start WebODM by running $0 start"
@ -298,7 +308,7 @@ if [[ $1 = "start" ]]; then
elif [[ $1 = "stop" ]]; then
environment_check
echo "Stopping WebODM..."
run "docker-compose -f docker-compose.yml -f docker-compose.nodeodm.yml stop"
run "docker-compose -f docker-compose.yml -f docker-compose.nodeodm.yml -f docker-compose.nodemicmac.yml stop"
elif [[ $1 = "restart" ]]; then
environment_check
echo "Restarting WebODM..."
@ -317,6 +327,7 @@ elif [[ $1 = "update" ]]; then
echo "Updating WebODM..."
run "git pull origin master"
run "docker pull opendronemap/nodeodm"
run "docker pull dronemapper/node-micmac"
run "docker pull opendronemap/webodm_db"
run "docker pull opendronemap/webodm_webapp"
echo -e "\033[1mDone!\033[0m You can now start WebODM by running $0 start"