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

hardcoded osm path #266

Open
stefanocudini opened this issue Mar 4, 2022 · 3 comments
Open

hardcoded osm path #266

stefanocudini opened this issue Mar 4, 2022 · 3 comments
Labels

Comments

@stefanocudini
Copy link

hi

here de module
https://github.com/pelias/polylines/blob/master/docker_extract.sh#L9

it does not use the pelias.json configuration as it should but uses a hardcoded path,
this breaks the operation in case the configuration is not the standard one

and however I think that the pelias.json file is the only place to read the paths

@missinglink
Copy link
Member

Sure thing, could you please open a pull request?

The docker image should have the jq binary installed which can be used to extract the imports.openstreetmap.datapath variable from pelias.json

While you're there could you please fix the bash redirection code? It's 2>&1 all over that file, I think it should be >&2 since the intent was to write to stderr

@missinglink
Copy link
Member

We have adopted a convention over the years of using /code and /data in our docker images.

It seems that we always mount the config at /code/pelias.json but if someone decided to mount it in a different place then there's no way we can figure out where it is on disk.

So it's kind of just shifting the convention of using /data to using /code, maybe not really solving the problem?

@orangejulius
Copy link
Member

orangejulius commented Mar 4, 2022

Yeah, this little script has always been a little confusing.

One thing that's helpful is we do have a PELIAS_CONFIG environment variable that is read by the pelias-config module itself.

It's a bit messier than calling jq, but maybe we want to do something like this instead:

OSM_DATA_PATH=$(node -e "console.log(require('pelias-config').generate().imports.osm.datapath) );"

Also note that the Polylines datapath is hardcoded in here several times, we might want to handle it the same way.

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

No branches or pull requests

3 participants