Open-Historical-Map-Labs / openhistoricalmap-docker

A dockerized configuration to create the OpenHistoricalMap backend
9 stars 3 forks source link

Query/infopanel question #20

Closed danrademacher closed 5 years ago

danrademacher commented 5 years ago

Jeff asked me whether we could work on info panel updates alongside DevSeed's upcoming work on Nominatim. So I'm looking more closely at that and had a question about whether there's a first-run super-low-effort thing to do:

On the Dev AWS site has an info panel that queries OSM, shows features that don’t exist and then tries to link to them with node IDs from OSM but on OHM infrastructure, which leads of course to 404s.

That's about to happen here if I click any of these links: image

In the Parameter Store as shown here, we have:

{
          "name": "OSM_overpass_url",
          "value": "//overpass-api.de/api/interpreter"
        },

Is a first step in getting info panel working simply to replace that parameter with the production OHM Overpass API URL, which as of a week or two ago is now running over https?

danrademacher commented 5 years ago

For the record, we'd change that to https://overpass-api.openhistoricalmap.org/api/interpreter

danrademacher commented 5 years ago

Hmm apparently not. I went into AWS ECS definition and I see we are already using correct Overpass: image

And then I thought, duh, maybe these links are 404ing because we're not hosting the DB

So something like this: image links to http://openhistoricalmap-1936150974.us-east-1.elb.amazonaws.com/node/262639984

So maybe that should be: http://openhistoricalmap.org/node/262639984

Nope, nothing there. But here's an ice cream store: https://www.openstreetmap.org/node/262639984

mojodna commented 5 years ago

(I've been fiddling with this.)

OSM_overpass_url (and OSM_nominatim_url) are both used at build-time to output JavaScript with appropriate parameters, so changing it in the ECS Task Definition has no effect (sadly).

I've moved the values into Parameter Store (using the same names), updated the CodeBuild environment to load them, the buildspec to pass them into the build (as --build-arg), and updated the codebuild-website-service-role IAM role to grant it access to parameters (ssm:getParameters et al).

The build pipeline is running now. I suspect that I may need to update the Dockerfile to explicitly specify that they can be provided as build args, but I want to see how this does first.

(I'm covering Nominatim in this to save future-us from some pain.)

danrademacher commented 5 years ago

Oh great! So my original hunch was on-target sorta. That's always gratifying ;)

mojodna commented 5 years ago

Yes, very much so! I didn't expect it to be a build-time thing either.

mojodna commented 5 years ago

Alas, it looks like I did need to update the Dockerfile: https://github.com/OpenHistoricalMap/openhistoricalmap-docker/commit/134bc69c875e4b957e6e7c902d024cc60493a24e

mojodna commented 5 years ago

image

The OHM Overpass doesn't seem to like having 2 concurrent requests made to it (1 for nearby, 1 for enclosing features), but it's working on the OHM website end of things.