scientist-softserv / princeton-manifold

Transforming scholarly publications into living digital works.
http://manifoldapp.org
GNU General Public License v3.0
0 stars 0 forks source link

Rework prod to use requests instead of sockets #3

Open bkiahstroud opened 2 weeks ago

bkiahstroud commented 2 weeks ago

Story

By default, the Manifold application relies on sockets to communicate between services (e.g. between the client (frontend) and API (backend)).

This restricts how we can deploy to our infra. Most importantly, all services that communicate across sockets must be in the same pod. This prevents us from being able to scale vertically or horizontally.

The application code should be altered to allow for services to communicate with each other using requests rather than sockets.

Implementation Suggestions

Loose steps:

  1. Add k8 Services for cable and client
  2. Split deployment into API, client, nginx
  3. Change the labels in the services to match the new deployments (unique names)
  4. Change nginx configuration to use ports instead of unix sockets1 4a) See nginx/config/default.conf

1 See code below

upstream manifold_api {
  server unix:/manifold_sockets/manifold-api;
  # Replace sockets with this pattern (syntax may be incorrect):
  # server princeton-manifold-api:3020
 }
jillpe commented 1 week ago

We need this to be completed before the site is officially live - we could potentially have this be the first thing we do in the maintenance contract