conda env create --file environment.ymlconda activate routing_app
# panel serve testing_app.ipynb
panel serve --port 5006 routing_app.pychange CMD commands in Dockerfile and run,
docker build -t routing_app:0.1 .
docker run -p 5006:5006 routing_app:0.1push to docker hub, please change the happybeetles to your own user name, you need login to Dockerhub both in your terminal, you need create a repo called routing_app in your 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_appFor the whole planet service, you can following these steps,
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"- Deploy the backend first, you can do it using the Openshift web portal to deploy the backend from this Github repo.
- Please find the backend service ip address in the Openshift web portal by click on the pod's name, and update the backend service ip address in the
routing_app.pyfile. change the following line in therouting_app.pyfile.
# create a router object
router = OSRMRouter(mode="driving",
base_url="http://<ip_address_of_the_backend_service>:5000"
)- 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_appYou 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.
-
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.orgfor the frontend service -
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.
If you don't have enough memory, you may need to create a swap file. Create a biger swap file, please refer to here