Closed josiekre closed 5 years ago
@josiekre I just pushed a fix for this, adding additional search steps to find the location of OSRM in node user directories. I tested this on docker and was able to get it to work:
Dockerfile:
FROM node:11
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
USER node
RUN git clone https://github.com/sharedstreets/sharedstreets-js.git /tmp/
RUN npm install -g sharedstreets
Docker image build:
docker build --tag shst-image .
Run match on test data:
docker run -it --rm shst-image shst match /tmp/test/geojson/line_2.in.geojson --out=/tmp/out.geojso
Thanks for investigating the docker steps -- I think that this will be useful of other users, especially those on Windows. The tricky part is making it easy to access data stored on the host computer from inside the docker container. I'm going to investigate if there are standardized approaches for dockerized CLI workflows and will push up this image once we can document the steps.
feature: #53 adding manual override for OSRM path
Worked! Thanks for the quick fix.
Using the following Dockerfile with the fix from #50, points are matching from the tests but lines are not. There's a problem finding the OSRM module.
I looked into
src/graph.ts
.getOSRMDirectory()
should be finding the path correctly given where I can find it inside the Docker.https://github.com/sharedstreets/sharedstreets-js/blob/9b08e316381180cd5859002522e745fb2c955c13/src/graph.ts#L43-L46
Inside the Docker, OSRM gets installed at
/home/node/.npm-global/lib/node_modules/sharedstreets/node_modules/osrm/
.