OpenHistoricalMap / issues

File your issues here, regardless of repo until we get all our repos squared away; we don't want to miss anything.
Creative Commons Zero v1.0 Universal
19 stars 1 forks source link

Improve map style deployment process #792

Closed danrademacher closed 2 weeks ago

danrademacher commented 6 months ago

Until this week, the process of deploying updates to our map styles into the Rails application has been tedious and manual.

@Rub21 wrote a script to make it less so: https://github.com/OpenHistoricalMap/ohm-deploy/blob/main/images/web/update_map_styles.py

This is a huge improvement, but there's one more part of the process:

The stylesheets reference spritesheets ~and glyphs~ that live on the map-styles repo in these lines:

For the main OHM style, we had an issue long ago where we were editing the spritesheet to test style updates, and that was breaking the live production map. As a stopgap we made this script that simply copies the style json and spritesheets into _production versions and then we reference those in the tegola style: https://github.com/OpenHistoricalMap/map-styles/blob/staging/ohm_timeslider_tegola/make_production_version.py

To build on the improved deployment method Ruben has developed, I propose the following changes:

UPDATED: We rarely chang efonts, so we could leave the fonts as is in map-styles repo and just copy over the spritesheets.

danrademacher commented 6 months ago

Changes to map-styles are in a PR ready for review by @vknoppkewetzel and @tsinn. But before we merge that we have to remove the dependency on the spritesheet served out of map-styles or we will break the map on the live site.

danrademacher commented 6 months ago

Changes on the website code ended up being very minor -- keep the base style ERB since it still loads Maplibre RTL plugin (see https://github.com/OpenHistoricalMap/ohm-website/pull/247)

So I think what's left is these steps:

  1. Update the deploy script to also copy over the spritesheets.
  2. Deploy that once to remove live dependencies on spritesheets from map-styles repo.
  3. Then merge https://github.com/OpenHistoricalMap/map-styles/pull/29
  4. Update the deploy script to target main/main.json instead of ohm_timeslider_tegola/ohm_timeslider_tegola_production.json and associated spritesheets.
  5. Deploy that
  6. Update the documentation in the map-style repo for how all this works.
Rub21 commented 5 months ago

@danrademacher could you check the progress is here https://github.com/OpenHistoricalMap/ohm-deploy/pull/327, it is ready to go to production.

danrademacher commented 5 months ago

Ok, just confirmed that all spritesheets are coming from staging.openhisotircalmap.org on staging: image

hmm. now we have merge conflicts on the map-styles between this WIP PR https://github.com/OpenHistoricalMap/map-styles/pull/29 and the latest map styles. So I'll need to resolve those and merge to get latest map style code into main branch before we deploy this to production.

danrademacher commented 5 months ago

@Rub21 I merged the changes in map-styles and this new PR should be ready to merge to staging: https://github.com/OpenHistoricalMap/ohm-deploy/pull/328/

If that works, then this is good for production

Rub21 commented 5 months ago

@danrademacher seems the Styles has broken in overpass-turbo:

image
danrademacher commented 5 months ago

Ah drat. That's the one place we were pulling the stylehseet live! Once we deploy the new method to production, we could modify Overpass Turbo to point at the production website mapstyle JSON, which is better

that's a change to this line https://github.com/OpenHistoricalMap/overpass-turbo/blob/master/js/configs.js#L6

Rub21 commented 5 months ago

nice, so this is ready to go production!

Rub21 commented 5 months ago

The changes are already in production : https://www.openhistoricalmap.org/

1ec5 commented 5 months ago

That's the one place we were pulling the stylehseet live!

Oh, there’s more…

There’s no telling how many people followed the documentation to hard-code the old URL. But I’m glad we’ve simplified the URL to something that makes more sense.

danrademacher commented 5 months ago

Oy, OK, hard lesson learned here. As a stop gap, I could make a copy of the main map style and spritesheet under the old name. Then roll this out more thoughtfully.

1ec5 commented 5 months ago

I’m not sure there’s a great solution. Copying the file would erase the file’s edit history, so it would be more difficult to track down regressions in the future. I wonder if GitHub Pages supports any kind of rewrite rule or symbolic link that would let us keep a redirect around. Anyways, “main” is a good enough name; no need to overthink it right now.

Rub21 commented 2 weeks ago

Can we close this ticket?

danrademacher commented 2 weeks ago

We still have one open task here:

I don't quite remember right now if we ever had a method to locally pull in the latest map styles for testing. I think that's still copy-paste by hand. Actually, I'm make a new ticket for just that bit.