Recommendation API/Cloud VPS deploy

From Meta, a Wikimedia project coordination wiki
  1. Create instance in Cloud VPS
  2. Create a Web Proxy in Horizon
  3. Run the Cloud VPS setup script (or the portions that are relevant)
  4. Clone the repo of the desired recommendation package
  5. Install it using pip
    • If doing experimental things, uwsgi will likely need to be installed manually, and it requires a C compiler (build-essentials and python3-dev)
  6. Install database if necessary (postgresql-9.6 is used sometimes)
    • Change data_directory in /etc/postgresql/9.6/main/postgresql.conf to point at /srv
    • Create database
      sudo su postgres
      psql
      create database test;
      create role testing with password 'testing';
      grant connect on database test to testing;
      grant select on all tables in schema public to testing;
      alter default privileges in schema public grant select on tables to testing;
  7. Copy the config files to their various locations (refer to labs_setup script if doing this manually)
  8. Set the correct host name in the nginx config
  9. Modify /etc/recommendation/recommendation.ini and /etc/recommendation/recommendation.wsgi to serve the appropriate service