diff --git a/README.md b/README.md index 74c2b3ab..c7643b8d 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,20 @@ 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: +* 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 @@ -33,14 +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" -### Need a processing node for testing? +We recommend that you read the [Docker Documentation](https://docs.docker.com/) to familiarize with the application lifecycle, setup and teardown. -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: +### Add More Processing Nodes -``` -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 processing nodes on separate machines. ## Run it natively @@ -55,7 +55,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: diff --git a/docker-compose.nodeodm.yml b/docker-compose.nodeodm.yml new file mode 100644 index 00000000..067bbebf --- /dev/null +++ b/docker-compose.nodeodm.yml @@ -0,0 +1,13 @@ +# 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' +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