Skip to content

wybert/routing_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Routing App

How to run locally

Create a env

conda env create --file environment.yml

Run the App

conda activate routing_app
# panel serve testing_app.ipynb
panel serve --port 5006 --address 0.0.0.0 --allow-websocket-origin=199.94.60.108:5006 testing_app.ipynb 

How to run using docker

build and run the docker image

docker build -t routing_app:0.1 .  
docker run -p 5006:5006 routing_app:0.1

build and push the docker image to docker hub

push to docker hub

docker build --platform=linux/amd64 -t routing_app:1.3 .
docker tag routing_app:1.3 happybeetles/routing_app
docker push happybeetles/routing_app

About the backend

  1. Download the planet.osm.pbf file from here
  2. follow the instruction here
wget https://download.bbbike.org/osm/planet/planet-latest.osm.pbf
# it may take a while
# sudo docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/planet-latest.osm.pbf || echo "osrm-extract failed"

Deployment in openshift

  1. Deploy the backend first, you can do it using the Openshift web portal to deploy the backend from this Github repo.
  2. Please find the backend service ip address in the Openshift web portal, and update the backend service ip address in the routing_app.py file. change the following line in the routing_app.py file.
# create a router object 
router = OSRMRouter(mode="driving",
                    base_url="http://<ip_address_of_the_backend_service>:5000"
                    )
  1. Build the Docker image and push it to the docker hub. You can use the following command to build the docker image.
docker build --platform=linux/amd64 -t routing_app:1.3 .
docker tag routing_app:1.3 happybeetles/routing_app
docker push happybeetles/routing_app

You need to login to your own docker hub account before you can push the image to the docker hub. My docker hub account is happybeetles, you need to change it to your own docker hub account.

  1. Deploy the frontend using the Openshift web portal from the Docker image you just pushed to the docker hub. For Openshift setting, you need use this url routing-ui-gis-data-science-big-data-projects-at-cga.apps.shift.nerc.mghpcc.org for the frontend service

  2. Once done, visit the frontend service url routing-ui-gis-data-science-big-data-projects-at-cga.apps.shift.nerc.mghpcc.org, you should be able to see the frontend.

Tips

If you don't have enough memory, you may need to create a swap file. Create a biger swap file, please refer to here

To do

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published