Page MenuHomePhabricator

Add kafka support for tile-pregeneration events
Closed, ResolvedPublic

Description

Context

In our new architecture we decided to move from using tilerator as a map tile pregeneration queuing system backed by Redis to native tegola functionality backed by Kafka.
One of the suggested ways to publish messages to the kafka deployment on wikimedia infra is EventGate, an HTTP API where event producers can POST messages to a predefined stream based on a predefined schema.

Here is the documentation around setting up instrumentation for events: https://wikitech.wikimedia.org/wiki/Event_Platform/Instrumentation_How_To
For more information about the Event Platform here is the project documentation: https://wikitech.wikimedia.org/wiki/Event_Platform

Action items
  • Create schema for map tile invalidation events
  • Add configuration to register the event stream

Event Timeline

Change 715011 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[schemas/event/secondary@master] WIP: Map tile expiration event schema

https://gerrit.wikimedia.org/r/715011

Change 715028 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[operations/mediawiki-config@master] Configure event stream for map tile expiration

https://gerrit.wikimedia.org/r/715028

Hey @Jgiannelos, your proposed event schema looks good to me. That said, I think it belongs in the primary event schema repository as an event that (quoting the README) "directly affect[s] user-facing features."

What will be producing these events to Kafka, and what will be consuming them from Kafka?

The OSM import pipeline is going to produce the events on each run and then our tile server is going to consume them periodically and invalidate/pre-generate stale tiles.

Change 715011 abandoned by Jgiannelos:

[schemas/event/secondary@master] Map tile expiration event schema

Reason:

Primary schema repository is probably a better fit for this event since map tile invalidation is a user facing change.

https://gerrit.wikimedia.org/r/715011

Change 716219 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[schemas/event/primary@master] Map tile expiration event schema

https://gerrit.wikimedia.org/r/716219

Change 716219 merged by Ottomata:

[schemas/event/primary@master] Map tile state change event schema

https://gerrit.wikimedia.org/r/716219

Change 715028 merged by jenkins-bot:

[operations/mediawiki-config@master] Configure event stream for map tile state change

https://gerrit.wikimedia.org/r/715028

Jgiannelos updated the task description. (Show Details)

Change 721959 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[operations/mediawiki-config@master] Revert \"Configure event stream for map tile state change\"

https://gerrit.wikimedia.org/r/721959

Change 721959 merged by jenkins-bot:

[operations/mediawiki-config@master] Revert \"Configure event stream for map tile state change\"

https://gerrit.wikimedia.org/r/721959

Mentioned in SAL (#wikimedia-operations) [2021-09-20T07:20:37Z] <urbanecm> Revert undeployed config patch (https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/721959); not even pulled to deployment, so assuming it never hit prod (T289771)

Urbanecm subscribed.

@Jgiannelos Hello, you merged a patch to operations/mediawiki-config, but did not deploy it. Since I just needed to deploy something, and I noticed undeployed config code present in the repository, I reverted your patch. Feel free to do it later again, this time deploying it properly :-). As a member of the deployment group, you should be able to do it yourself following instructions at https://wikitech.wikimedia.org/wiki/Backport_windows/Deployers. If you never did it before, please do not hesitate to ask fellow deployers (I'm a frequent deployer myself, and I'm happy to answer questions if you have any).

For more background on undeployed code, please see https://wikitech.wikimedia.org/wiki/How_to_deploy_code#Problem:_undeployed_code.

Change 722611 had a related patch set uploaded (by Ottomata; author: Ottomata):

[eventgate-wikimedia@master] Update schema repo versions in docker image for maps/tile_change

https://gerrit.wikimedia.org/r/722611

Change 722611 merged by Ottomata:

[eventgate-wikimedia@master] Update schema repo versions in docker image for maps/tile_change

https://gerrit.wikimedia.org/r/722611

Change 722613 had a related patch set uploaded (by Ottomata; author: Ottomata):

[eventgate-wikimedia@master] Bump primary schema repo to get maps tile change example fix

https://gerrit.wikimedia.org/r/722613

Change 722613 merged by Ottomata:

[eventgate-wikimedia@master] Bump primary schema repo to get maps tile change example fix

https://gerrit.wikimedia.org/r/722613

Change 722618 had a related patch set uploaded (by Ottomata; author: Ottomata):

[operations/deployment-charts@master] Bump eventgate-main image version to get maps/tile_change schema

https://gerrit.wikimedia.org/r/722618

Change 722618 merged by Ottomata:

[operations/deployment-charts@master] Bump eventgate-main image version to get maps/tile_change schema

https://gerrit.wikimedia.org/r/722618

Change 730848 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[operations/mediawiki-config@master] Configure event stream for map tiles state change

https://gerrit.wikimedia.org/r/730848

Change 730848 merged by jenkins-bot:

[operations/mediawiki-config@master] Configure event stream for map tiles state change

https://gerrit.wikimedia.org/r/730848

Mentioned in SAL (#wikimedia-operations) [2021-10-21T11:07:27Z] <jgiannelos@deploy1002> Synchronized wmf-config/InitialiseSettings.php: Config: [[gerrit:730848|Configure event stream for map tiles state change (T289771)]] (duration: 01m 04s)

Change 737397 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[operations/puppet@production] maps: Force jq to generate single line output

https://gerrit.wikimedia.org/r/737397

Change 737397 merged by Alexandros Kosiaris:

[operations/puppet@production] maps: Force jq to generate single line output

https://gerrit.wikimedia.org/r/737397

Change 745255 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[operations/puppet@production] Install python client for kafka on maps masters

https://gerrit.wikimedia.org/r/745255

Change 745255 merged by Hnowlan:

[operations/puppet@production] Install python client for kafka on maps masters

https://gerrit.wikimedia.org/r/745255

Change 745274 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[operations/puppet@production] maps: Install lib to handle compressed kafka messages

https://gerrit.wikimedia.org/r/745274

Change 745274 merged by Hnowlan:

[operations/puppet@production] maps: Install lib to handle compressed kafka messages

https://gerrit.wikimedia.org/r/745274

Change 745297 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[operations/puppet@production] maps: Add kafka helper scripts

https://gerrit.wikimedia.org/r/745297

Change 745297 merged by Hnowlan:

[operations/puppet@production] maps: Add kafka helper scripts

https://gerrit.wikimedia.org/r/745297