From cd1fdd48f4a41dab5a132918710aba84ad432efc Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 1 Dec 2016 10:39:42 -0500 Subject: [PATCH 1/5] Python version check, docker-compose with nodeodm instance --- docker-compose.nodeodm.yml | 12 ++++++++++++ docker-compose.yml | 2 ++ start.sh | 25 +++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 docker-compose.nodeodm.yml diff --git a/docker-compose.nodeodm.yml b/docker-compose.nodeodm.yml new file mode 100644 index 00000000..ddb2965f --- /dev/null +++ b/docker-compose.nodeodm.yml @@ -0,0 +1,12 @@ +# 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. + +services: + webapp: + entrypoint: /bin/bash -c "chmod +x /webodm/*.sh && /webodm/wait-for-it.sh db:5432 -- /webodm/start.sh --create-default-pnode" + node-odm-1: + image: pierotofy/nodeodm + container_name: node-odm-1 + ports: + - "3000" diff --git a/docker-compose.yml b/docker-compose.yml index 02bbc673..4e7797f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,5 @@ +# This configuration does not include a processing node +# Which makes for faster setup times version: '2' services: db: diff --git a/start.sh b/start.sh index 8b1a8516..68c5b8ba 100644 --- a/start.sh +++ b/start.sh @@ -1,4 +1,25 @@ #!/bin/bash + +echo -e "\e[92m" +echo " _ __ __ ____ ____ __ ___" +echo "| | / /__ / /_ / __ \/ __ \/ |/ /" +echo "| | /| / / _ \/ __ \/ / / / / / / /|_/ / " +echo "| |/ |/ / __/ /_/ / /_/ / /_/ / / / / " +echo "|__/|__/\___/_.___/\____/_____/_/ /_/ " +echo +echo -e "\e[39m" + +python -c "import sys;ret = 1 if sys.version_info <= (3, 0) else 0;print('Checking python version... ' + ('3.x, good!' if ret == 0 else '2.x'));sys.exit(ret);" +if [ $? -eq 1 ]; then + echo + echo "====================" + echo "You're almost there!" + echo "====================" + echo -e "\e[33mYour system is currently using Python 2.x. You need to install or configure your system to use Python 3.x. Check out http://docs.python-guide.org/en/latest/dev/virtualenvs/ for information on how to setup Python 3.x alongside your Python 2.x install.\e[39m" + echo + exit +fi + echo Building asssets... webpack @@ -6,4 +27,8 @@ echo Running migrations python manage.py makemigrations python manage.py migrate +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 + python manage.py runserver 0.0.0.0:8000 \ No newline at end of file From 7b9d231cc7891f06637407c21a1741e3c2b8bfc8 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 1 Dec 2016 11:35:26 -0500 Subject: [PATCH 2/5] Changed README --- README.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 74c2b3ab..e022cf0f 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,17 @@ If you know Python, web technologies (JS, HTML, CSS, etc.) or both, make a fork, ## Getting Started -The quickest way to get started is by using Docker. +Install the following applications (if they are not installed already): + - [Docker](https://www.docker.com/) + - [Python](https://www.python.org/downloads/) + - [Git](https://git-scm.com/downloads) -* From the Docker Quickstart Terminal (Windows / OSX) or from the command line (Linux) type: +* From the Docker Quickstart Terminal (Windows) or from the command line (OSX/Linux) type: ``` git clone https://github.com/OpenDroneMap/WebODM cd WebODM pip install docker-compose -docker-compose up +docker-compose -f docker-compose.yml -f docker-compose.nodeodm.yml up ``` * If you're on Windows/OSX, find the IP of your Docker machine by running this command from your Docker Quickstart Terminal: @@ -33,14 +36,9 @@ Linux users can connect to 127.0.0.1. * Open a Web Browser to `http://:8000` * Log in with the default credentials: "admin:admin" -### Need a processing node for testing? +### Add More Processing Nodes -At startup, WebODM needs to be linked to one or more processing nodes running [node-OpenDroneMap](https://github.com/pierotofy/node-OpenDroneMap). It's recommended that you setup your own processing nodes, but if you just want to do some quick tests, use the following: - -``` -Hostname: nodeodm.masseranolabs.com -Port: 80 -``` +WebODM can be linked to one or more processing nodes running [node-OpenDroneMap](https://github.com/pierotofy/node-OpenDroneMap). The default configuration already includes a "node-odm-1" processing node which runs on the same machine as WebODM, just to help you get started. As you become more familiar with WebODM, you might want to install the processing node on a separate machine. ## Run it natively @@ -55,7 +53,11 @@ On Linux, make sure you have: apt-get install binutils libproj-dev gdal-bin ``` -On Windows use the [OSGeo4W](https://trac.osgeo.org/osgeo4w/) installer to install GDAL. +On Windows use the [OSGeo4W](https://trac.osgeo.org/osgeo4w/) installer to install GDAL. MacOS users can use: + +``` +brew install postgres postgis +``` Then these steps should be sufficient to get you up and running: From ed85655d2d7046c8880f9bf483c89e21a1f7b3a2 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 1 Dec 2016 16:37:16 +0000 Subject: [PATCH 3/5] Modified nodeodm.yml docker-compose --- docker-compose.nodeodm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.nodeodm.yml b/docker-compose.nodeodm.yml index ddb2965f..067bbebf 100644 --- a/docker-compose.nodeodm.yml +++ b/docker-compose.nodeodm.yml @@ -2,6 +2,7 @@ # a default processing node instance. This is best for users # who are just getting started with WebODM. +version: '2' services: webapp: entrypoint: /bin/bash -c "chmod +x /webodm/*.sh && /webodm/wait-for-it.sh db:5432 -- /webodm/start.sh --create-default-pnode" From 9867b2c1dd44f2c2b93b6d829e640c98740a81e3 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 1 Dec 2016 11:42:53 -0500 Subject: [PATCH 4/5] Added docker docs link --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e022cf0f..a98092b1 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Install the following applications (if they are not installed already): - [Python](https://www.python.org/downloads/) - [Git](https://git-scm.com/downloads) -* From the Docker Quickstart Terminal (Windows) or from the command line (OSX/Linux) type: +* From the Docker Quickstart Terminal (Windows) or from the command line (OSX / Linux) type: ``` git clone https://github.com/OpenDroneMap/WebODM cd WebODM @@ -25,7 +25,7 @@ pip install docker-compose docker-compose -f docker-compose.yml -f docker-compose.nodeodm.yml up ``` -* If you're on Windows/OSX, find the IP of your Docker machine by running this command from your Docker Quickstart Terminal: +* If you're on Windows / OSX, find the IP of your Docker machine by running this command from your Docker Quickstart Terminal: ``` docker-machine ip @@ -36,9 +36,11 @@ Linux users can connect to 127.0.0.1. * Open a Web Browser to `http://:8000` * Log in with the default credentials: "admin:admin" +We recommend that you read the [Docker Documentation](https://docs.docker.com/) to familiarize with the application lifecycle, setup and teardown. + ### Add More Processing Nodes -WebODM can be linked to one or more processing nodes running [node-OpenDroneMap](https://github.com/pierotofy/node-OpenDroneMap). The default configuration already includes a "node-odm-1" processing node which runs on the same machine as WebODM, just to help you get started. As you become more familiar with WebODM, you might want to install the processing node on a separate machine. +WebODM can be linked to one or more processing nodes running [node-OpenDroneMap](https://github.com/pierotofy/node-OpenDroneMap). The default configuration already includes a "node-odm-1" processing node which runs on the same machine as WebODM, just to help you get started. As you become more familiar with WebODM, you might want to install processing nodes on separate machines. ## Run it natively From 75b892117ab0266650e7556c60ec9d8c68c2b60c Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 1 Dec 2016 11:50:33 -0500 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a98092b1..c7643b8d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you know Python, web technologies (JS, HTML, CSS, etc.) or both, make a fork, ## Getting Started -Install the following applications (if they are not installed already): +* Install the following applications (if they are not installed already): - [Docker](https://www.docker.com/) - [Python](https://www.python.org/downloads/) - [Git](https://git-scm.com/downloads)