-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix start of osrm-contract #469
Conversation
Really? Here's the output of
|
Yep, that's wrong |
What's wrong? the osrm-contract help? If so, since when? Was there a recent change? Would this fix fail on some versions? It works here because the file is called |
So I don't have a file $mode.osrm anymore here. Might be a new version thing. |
So checking the behavior of the osrm code: So basically, mode.osrm is the same as mode or mode.osm We can still investigate why we do not have an "mode".osrm file generated anymore. Otherwise, we can keep the diff as is, or we can make it so the cmd is with "$mode.osrm" instead of just "$mode". |
commit 21888334dd1e0fbbd25cc62c725eb33bb7968147
|
it's super confusing and documentation is not well updated yet. So I'll change this PR to be mode.osrm |
40e621e
to
59ee3e5
Compare
With version 5.25, both the current and preceding version work. With 5.27, the contraction works, but the runtime doesn't. Don't you need to update also the osrm-routed path in the OSRMProcessManager.ts file? |
hum, probably yes |
59ee3e5
to
11b3b4e
Compare
updated, @tahini if you have the chance to test on your side, let me know |
// contract parameter need to match the prefix of the osm file passed to extract | ||
// in our case it's the mode name. The .osrm is not generated in the latest osrm-extract | ||
// but the name is still accepted as a base path | ||
const osrmProcess = spawn('osrm-contract', [`${mode}.osrm`], { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's another one in the restart function, which is the one that used. But I confirm that ${mode}.osrm
works with both 5.25 and 5.27.1, but *.osrm
fails with 5.27.1. Maybe call the start from the restart, or do we need both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess might have a leftover .osrm file locally that made my test pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a subtle difference between them. But I've now put the args in a common function.
@@ -130,7 +130,7 @@ const start = function(parameters = {} as any): Promise<any> { | |||
return new Promise((resolve, reject) => { | |||
const command = 'osrm-routed'; | |||
const commandArgs = [ | |||
osrmDirectoryPath + '/*.osrm', | |||
osrmDirectoryPath + `/${mode}.osrm`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other comment applies to this line, not the one from OSRMServicePreparation, sorry.
11b3b4e
to
a3ddb48
Compare
I've made sure to erase the old .osrm in my latest test round. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It corresponds to what was working here when tested with both 5.25 and 5.27.1.
Just remove the whitespace so we don't need to add a commit to run yarn format
later and it's good
@@ -118,6 +118,14 @@ const configureAllOsrmServers = async function(startServers = true): Promise<voi | |||
} | |||
}; | |||
|
|||
function getOsrmRoutedStartArgs(osrmDirectory: string, mode: string, port: string) : string[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn format
would remove a whitespace before the ':' on this line
osrm-contract expect the file prefix when starting. The latest osrm-extract don't generate a .osrm file anymore by default (only in debug mode) so we cannot use the *.osrm trick anymore. We have to pass the actual file name prefix
a3ddb48
to
7876015
Compare
Fixed my yarn format command, so should be good |
osrm-contract expect the file prefix when starting. I don't know how the previous command worked