Edits will be to improve readability
First off thank you for the tips @nils, sorry I didn’t get back to you til now. And sorry for my persnickety attitude online. I’ve been at this for months, and didn’t solve it til this past week. I appreciate your reply earlier, and I imagine you’re quite busy beyond trying to bring a novice programmer up to speed =].
Anyway after several months, I’ve gotten OpenRouteService up and running on my local machine. Below are some instructions that worked for me in successfully running ORS in Virtualbox on a Windows Machine. (I should add I am a lay person when it comes to web-development - I know github, GIS softwares, some python some web design, but I’m not a developer I’m not a programmer by trade.) So take my instructions with a grain of salt.
First off some background on Docker in lay-terms (skip to numbered section if you have a good understanding of docker already)
To my understanding, Windows 10 Home edition computers don’t have Hyper-V software baked into the OS. Enterprise edition does, but not Home Edition. Hyper-v enables “virtualization of your computer”… i.e. it enables windows computers to run linux software structures inside a virtualized-mini-computer on your OS. Linux structures are common for server management, and a lot of the software on github (including ORS), and github documentation often seems to assume users are on Macs or Linux systems which are more common in web-development. Thus troubleshooting or instructions (ORS included) may omit steps required for windows users.
So there are plenty of youtube videos explaining why docker is so great for programmers and developers to overcome “environment hell” (Here is one video, I felt went fairly deep in that understanding).
With that said, docker essentially creates a docker image of an application - listing everything you need to run it and all the dependency softwares, and the software scripts that depend on other software scripts to run properly. And it takes all of that, and downloads it and packages it up together and builds that docker image into a docker container. (In a vast oversimplification to baking a cake, the docker-image = recipe, docker = baker, and the container = cake…And windows is a house without a kitchen!! So you download Virtualbox and create a ‘kitchen’ inside there). In slightly more technical terms Docker is a linux based program(?), and can’t natively run on windows - so you download and run Docker-toolbox which deploys docker inside Virtualbox software, and docker runs inside ther.
So to run ORS via Docker-Toolbox (i.e. on a Windows Machine), do these following steps in combo with the github docker install documentation :
-
Setup Port Forwarding In VirtualBox
(After installing Docker-toolbox, open VirtualBox.)
1a. In VirtualBox Navigate to Settings > Network > Advance > Port Forwarding
1b. Add a new Port Forwarding Rule
1c. Setup Rule with HostPort 8080, and Guest Port 8080 (I don’t totally get this, servers and ports are kinda confusing to me, but as I understand there are 100s of ports to choose to send data/receive data on over a network. Some are reserved for certain info, others you can pick whatever port you wan to use. By setting the hostport/guestport in virtualbox this is basically making sure the virtual machine port that is sends/receives data on is linked to what shows up on your internet browser when your localhost server is up and running. So when you are making direction requests on a webmap in Google Chrome on localhost/8080, it knows to point down inside the virtual machine which is listening and ready to send and receive data back out on the 8080 port which localhost is operating on. -
Allocate Extra Memory through VirtualBox
2a. Navigate to Settings > System > Motherboard
2b. Adjust the amount of memory you use here. Mine started at 1GB and I upped it to 4GB (of 8GB total on my computer. During an earlier install, I kept erroring out because I didn’t have enough memory, and I kept following the github doc instructions (which doesn’t apply to Docker-toolbox/windows 10 Home Ed. setups). Remember, your computer isn’t running docker! Virtualbox is running docker! So if you need to adjust the memory used in the install, adjust the amount of memory dedicated in Virtualbox first! The github docs says the following regarding the memory allocation:
-
It should be mentioned that if your dataset is very large, please adjust the
-Xmxparameter of
JAVA_OPTSenvironment variable. A good rule of thumb is to give Java 2 x file size of the PBF per profile .
-
Open the
docker-entrypoint.sh
file in your code-text editor (I use Sublime-text).
3a. (You might have to run a ‘docker-machine default start’ to generate this file I think (?) I cant remember if it shows up after just downloading the openrouteservice files from a git clone…
3b. Anyway, once you open thedocker-entrypoint.sh
file Select All text
3c. (in Sublime text at least) go to View > Line Endings > Unix (You need to format the line endings from “windows line endings” to “linux/unix” line endings. Otherwise it will error out… -
You are ready to run a
docker-compose up
4a. For the state of Arizona, it takes me like 10 minutes
4b. Click Ctrl + Alt + Delete > Task Manager > Wifi to watch the Wifi graph to see it download/processing the data -
If you have any other errors in the process
5a. Delete the graphs folder, logs folder, and elevation_cache folder
5b. Delete the ORS docker-image that might be corruptly built, and try it again. You can see the docker images on your VirtualBox by runningdocker images
. Delete the ORS image by runningdocker rmi <imageID>
. You might need to delete the associated docker-container as well. List all your docker containers by runningdocker ps -a
. Delete the ORS docker-container by runningdocker rm <containerID>
5c. Rebuild the docker imagedocker-compose --build
5d. Run the rebuild ORS docker imagedocker-compose up
5e. Again, wait like 10 minutes, monitor the Wifi, and processor in Task Manager
5f. After it has all calmed down, query the service status is queryable viahttp://localhost:8080/ors/health
andhttp://localhost:8080/ors/status
for further information on the running services.
Hopefully this, in combo with the github documentation, helps someone else eventually… Don’t ask me if you have questions… It took me 3 months what it probably takes others in one afternoon to figure out…
Hope everyone is safe any healthy
Dylan