Page MenuHomePhabricator

Content Recommendation API migration
Closed, ResolvedPublic

Event Timeline

calbon renamed this task from Proposed Goal: Content Recommendation API migration completed to Goal: Content Recommendation API migration completed.Jul 12 2023, 2:54 PM
calbon renamed this task from Goal: Content Recommendation API migration completed to Content Recommendation API migration completed.Jul 17 2023, 7:28 PM

In T338805, we containerized the Flask web application that runs the Content Translation Recommendation API. Here is a summary of the steps that were taken:

  1. created a docker image after wrangling dependencies and configurations that were set in 2016
  2. fetched the embedding from figshare and hosted it locally in the container
  3. tested the backend and were able to hit the recommendation-api endpoint
  4. set up the frontend and were able to interact with GapFinder

In T339890, we are working on hosting the recommendation-api container on LiftWing. Tasks completed so far are:

  1. stored the embedding on swift
  2. added a swift client to the recommendation-api
  3. created CI jobs named recommendation-api-ng
  4. published the rec-api image to the Wikimedia docker registry

We are working on making adjustments to the rec-api deployment settings until we get to a state that can run on LiftWing.

Below are the settings configured so far:

  1. added wmf-certificates to the production image
  2. python-webapp helm chart was created
  3. rec-api-ng's namespace config for ml-serve was added to admin_ng
  4. added helmfile.d deployment settings for the recommendation-api-ng

The current adjustment requires optimizing memory usage. We run memory usage tests in T339890#9155985, T339890#9156601, and T339890#9159257. The 2nd test where float was downcasted to np.float32 resulted in a x0.5 drop in memory usage. This was the best result of the 3 tests performed.

We finally got rec-api deployment settings that could run on LiftWing:

  1. a 4th test was run and this dropped the memory usage by 5x
  2. we disabled the related_articles service (as advised by the research team), the rec-api ended up running without the embedding.
  3. deployed the rec-api on staging and then finally in production
calbon renamed this task from Content Recommendation API migration completed to Content Recommendation API migration .Sep 26 2023, 2:31 PM