Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is defined the profile name ? #3946

Closed
pocman opened this issue Apr 14, 2017 · 6 comments
Closed

Where is defined the profile name ? #3946

pocman opened this issue Apr 14, 2017 · 6 comments

Comments

@pocman
Copy link

pocman commented Apr 14, 2017

Hi,

In the documentation, it's said that Mode of transportation, is determined statically by the Lua profile that is used to prepare the data using osrm-extract.

I ran osrm-extract with 4 profiles car.lua, car_datacity.lua, bicycle.lua and bicycle_datacity.lua but I can't use car_datacity and bicycle_datacity as profile values in my requests (car is working for .osrm generated with both car.lua, car_datacity.lua, same for bicycle).

Are the profile defined by some value inside the .lua file ?
Can I changed that by hand in the .osrm files or do I need to run osrm-extract again ?

@danpat
Copy link
Member

danpat commented Apr 14, 2017

osrm-routed can only serve requests for one .osrm file at a time. One .lua profile creates one set of .osrm files.

In order to support multiple profiles, you will need to run osrm-extract/osrm-contract multiple times and copy the resulting .osrm files to different names/locations, then run multiple copies of osrm-routed on different TCP ports.

@daniel-j-h
Copy link
Member

Closing as not acitonable on our side here.
We want to support this in the future :) nothing for now, though.

@pocman
Copy link
Author

pocman commented Apr 14, 2017

Not so fast cowboy.
I do have 4 docker running 4 different osrm versions extracted with 4 different profiles.

My issue is that I don't understand how profile name (in the API) are derived from the Lua profiles. I'm using an elastic load balancer and I need to root each request to the appropriate docker instance.
For example driving is a valid request profile but I never used a driving.lua file...

@pocman
Copy link
Author

pocman commented Apr 14, 2017 via email

@danpat
Copy link
Member

danpat commented Apr 14, 2017

@pocman The profile name in the URL for osrm-routed isn't actually used - it's there for API future-proofness for when we finally do support osrm-routed/libosrm.a loading multiple profiles into memory in a single instance. Right now it's just an unused token in the URL path.

If you've got a load balancer, you would do the following:

  1. Run osrm-extract/osrm-contract for each of your .lua profiles, saving the datafiles into separate locations.
  2. Run 4 copies of osrm-routed on different TCP ports, each pointing to a different datafile set.
  3. In your load balancer, setup routing rules to look at the profile part of the URL, and send requests to the appropriate backend - osrm-routed ignores the profile string in the URL, so you can pass the requests through unmodified.

@danpat
Copy link
Member

danpat commented Apr 14, 2017

This is the ticket for multiple profile support:

#10

The ticket is a bit old (#10!!!), but believe it or not, we have plans to implement this over the next few months, after 6 years of a holding pattern :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants