Page MenuHomePhabricator

Migrate linkrecommendations to mw-api-int
Closed, ResolvedPublic

Description

Switch backend mw-api calls from baremetal api_appserver cluster to kubernetes hosted mw-api-int

Event Timeline

Clement_Goubert moved this task from Incoming 🐫 to this.quarter 🍕 on the serviceops board.
Clement_Goubert added a project: Add-Link.
Clement_Goubert renamed this task from Migrate linkrecommandations to mw-api-int to Migrate linkrecommendations to mw-api-int.EditedApr 6 2023, 9:29 AM
Clement_Goubert added a subscriber: Tgr.

@kostajh @Tgr If you could provide me with a way to test that linkrecommendations works correctly after changing api backend, it'd be much appreciated :)

Change 903646 had a related patch set uploaded (by Clément Goubert; author: Clément Goubert):

[operations/deployment-charts@master] cxserver: Switch to mw-api-int-async on k8s

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

@kostajh @Tgr If you could provide me with a way to test that linkrecommendations works correctly after changing api backend, it'd be much appreciated :)

  1. Grab a title from https://simple.wikipedia.org/w/index.php?search=hasrecommendation%3Alink&title=Special%3ASearch&ns0=1
  2. Test the staging endpoint with
    1. curl "https://staging.svc.eqiad.wmnet:4005/v1/linkrecommendations/wikipedia/simple/<title_with_underscores>?threshold=0.5&max_recommendations=1"
  3. Test the internal endpoint with
    1. curl "https://linkrecommendation.discovery.wmnet:4005/v1/linkrecommendations/wikipedia/simple/<title_with_underscores>?threshold=0.5&max_recommendations=1"
  4. Test the external endpoint with
    1. curl "https://api.wikimedia.org/service/linkrecommendation/v1/linkrecommendations/wikipedia/simple/<title_with_underscores>?threshold=0.5&max_recommendations=1"
    2. curl "https://linkrecommendation.discovery.wmnet:4006/v1/linkrecommendations/wikipedia/simple/<title_with_underscores>?threshold=0.5&max_recommendations=1"

The output should be something like

{
  "links": [
    {
      "context_after": " at sea. G",
      "context_before": "ind their ",
      "link_index": 0,
      "link_target": "Longitude",
      "link_text": "longitude",
      "match_index": 0,
      "score": 0.6056926250457764,
      "wikitext_offset": 713
    }
  ],
  "links_count": 1,
  "meta": {
    "application_version": "8b645e0",
    "dataset_checksums": {
      "anchors": "d3a569ad213a1fe3e6003b120109c7ec49b73c7593abd7931eeae917f7354537",
      "model": "6b5ee9c0018c1792baa9d71c4701c4360805b63660e955b64c39f67d0f71cef4",
      "pageids": "deadca08a1ccca465b59cc1d94d98d96116171b8ffc4dc7ac1e70f0412eeac8e",
      "redirects": "ece0b58352fb5b15223520124ef3ccc8e67478e565bc40975918a156ab6958c3",
      "w2vfiltered": "1940d4ee2fad64771d743913e561a47c395c9316c34dd7a96e30a8946959694e"
    },
    "format_version": 1
  },
  "page_title": "Time zone",
  "pageid": 4003,
  "revid": 7817764
}

(without the pretty-printing)

Mentioned in SAL (#wikimedia-operations) [2023-04-17T12:59:19Z] <claime> Migrating linkrecommandation staging to mw-api-int - T334060

Mentioned in SAL (#wikimedia-operations) [2023-04-17T14:07:06Z] <claime> Migrating linkrecommandation to mw-api-int - T334060

Mentioned in SAL (#wikimedia-operations) [2023-04-17T14:12:08Z] <claime> Migrated linkrecommandation to mw-api-int - T334060

curl tests look good:

cgoubert@deploy2002:/srv/deployment-charts/helmfile.d/services/linkrecommendation$ curl "https://linkrecommendation.discovery.wmnet:4005/v1/li
nkrecommendations/wikipedia/simple/Portugal?threshold=0.5&max_recommendations=1" | jq                                                        
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                              
                                 Dload  Upload   Total   Spent    Left  Speed                                                                
100   759  100   759    0     0   1971      0 --:--:-- --:--:-- --:--:--  1971                                                               
{
  "links": [
    {
      "context_after": ". Portugal",
      "context_before": " on the ",
      "link_index": 0,
      "link_target": "Iberian Peninsula",
      "link_text": "Iberian Peninsula",
      "match_index": 0,
      "score": 0.8166778683662415,
      "wikitext_offset": 9589
    }
  ],
  "links_count": 1,
  "meta": {
    "application_version": "8b645e0",
    "dataset_checksums": {
      "anchors": "d3a569ad213a1fe3e6003b120109c7ec49b73c7593abd7931eeae917f7354537",                                                         
      "model": "6b5ee9c0018c1792baa9d71c4701c4360805b63660e955b64c39f67d0f71cef4",                                                           
      "pageids": "deadca08a1ccca465b59cc1d94d98d96116171b8ffc4dc7ac1e70f0412eeac8e",                                                         
      "redirects": "ece0b58352fb5b15223520124ef3ccc8e67478e565bc40975918a156ab6958c3",                                                       
      "w2vfiltered": "1940d4ee2fad64771d743913e561a47c395c9316c34dd7a96e30a8946959694e"                                                      
    },
    "format_version": 1
  },
  "page_title": "Portugal",
  "pageid": 3466,
  "revid": 8692778
}
cgoubert@deploy2002:/srv/deployment-charts/helmfile.d/services/linkrecommendation$ curl "https://linkrecommendation.discovery.wmnet:4006/v1/li
nkrecommendations/wikipedia/simple/Portugal?threshold=0.5&max_recommendations=1" | jq                                                        
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                              
                                 Dload  Upload   Total   Spent    Left  Speed                                                                
100   759  100   759    0     0   1851      0 --:--:-- --:--:-- --:--:--  1851                                                               
{
  "links": [
    {
      "context_after": ". Portugal",
      "context_before": " on the ",
      "link_index": 0,
      "link_target": "Iberian Peninsula",
      "link_text": "Iberian Peninsula",
      "match_index": 0,
      "score": 0.8166778683662415,
      "wikitext_offset": 9589
    }
  ],
  "links_count": 1,
  "meta": {
    "application_version": "8b645e0",
    "dataset_checksums": {
      "anchors": "d3a569ad213a1fe3e6003b120109c7ec49b73c7593abd7931eeae917f7354537",                                                         
      "model": "6b5ee9c0018c1792baa9d71c4701c4360805b63660e955b64c39f67d0f71cef4",                                                           
      "pageids": "deadca08a1ccca465b59cc1d94d98d96116171b8ffc4dc7ac1e70f0412eeac8e",                                                         
      "redirects": "ece0b58352fb5b15223520124ef3ccc8e67478e565bc40975918a156ab6958c3",                                                       
      "w2vfiltered": "1940d4ee2fad64771d743913e561a47c395c9316c34dd7a96e30a8946959694e"                                                      
    },
    "format_version": 1
  },
  "page_title": "Portugal",
  "pageid": 3466,
  "revid": 8692778
}
❯ curl "https://api.wikimedia.org/service/linkrecommendation/v1/linkrecommendations/wikipedia/simple/Portugal?threshold=0.5&max_recommendations=1" | jq 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   759  100   759    0     0    694      0  0:00:01  0:00:01 --:--:--   694
{
  "links": [
    {
      "context_after": ". Portugal",
      "context_before": " on the ",
      "link_index": 0,
      "link_target": "Iberian Peninsula",
      "link_text": "Iberian Peninsula",
      "match_index": 0,
      "score": 0.8166778683662415,
      "wikitext_offset": 9589
    }
  ],
  "links_count": 1,
  "meta": {
    "application_version": "8b645e0",
    "dataset_checksums": {
      "anchors": "d3a569ad213a1fe3e6003b120109c7ec49b73c7593abd7931eeae917f7354537",
      "model": "6b5ee9c0018c1792baa9d71c4701c4360805b63660e955b64c39f67d0f71cef4",
      "pageids": "deadca08a1ccca465b59cc1d94d98d96116171b8ffc4dc7ac1e70f0412eeac8e",
      "redirects": "ece0b58352fb5b15223520124ef3ccc8e67478e565bc40975918a156ab6958c3",
      "w2vfiltered": "1940d4ee2fad64771d743913e561a47c395c9316c34dd7a96e30a8946959694e"
    },
    "format_version": 1
  },
  "page_title": "Portugal",
  "pageid": 3466,
  "revid": 8692778
}

Marking as resolved, I'll keep an eye on https://grafana.wikimedia.org/goto/ZoPvJOEVk?orgId=1
Feel free to reopen in case there are any issues.