openreplay/ee/recommendation
Kraiem Taha Yassine 612e41583e Api v1.15.0 (#1670)
* fix(chalice): fixed assist auto-complete
* fix(chalice): fixed exp-sessions without timezone

(cherry picked from commit e46df53ddc)
2023-11-20 16:15:12 +01:00
..
core feat(recommendations): Added services recommendation (ml_service) and trainer (ml_trainer) (#1275) 2023-06-07 15:58:33 +02:00
ml_service chore(recommendations): mlflow update, pydantic update and others (#1450) 2023-08-22 09:23:08 -04:00
ml_trainer Api v1.15.0 (#1670) 2023-11-20 16:15:12 +01:00
utils feat(recommendations): Added services recommendation (ml_service) and trainer (ml_trainer) (#1275) 2023-06-07 15:58:33 +02:00
.gitignore feat(recommendations): Added services recommendation (ml_service) and trainer (ml_trainer) (#1275) 2023-06-07 15:58:33 +02:00
Dockerfile feat(recommendations): Added services recommendation (ml_service) and trainer (ml_trainer) (#1275) 2023-06-07 15:58:33 +02:00
README.md feat(recommendations): Added services recommendation (ml_service) and trainer (ml_trainer) (#1275) 2023-06-07 15:58:33 +02:00
requirements_base.txt chore(recommendations): mlflow update, pydantic update and others (#1450) 2023-08-22 09:23:08 -04:00

Recommendations

index

  1. Build image
    1. Recommendations service image
    2. Trainer service image
  2. Trainer
    1. Env params
  3. Recommendations
    1. Env params

Build image

In order to build both recommendation image and trainer image, first a base image should be created by running the following command:

docker build -t recommendations_base .

which will add the files from core and utils which are common between ml_service and ml_trainer and will install common dependencies.

Recommendations service image

Inside ml_service run docker build to create the recommendation service image

cd ml_service/
docker build -t recommendations .
cd ../

Trainer service image

Inside ml_trainer run docker build to create the recommendation service image

cd ml_trainer/
docker build -t trainer .
cd ../

Trainer service

The trainer is an orchestration service which is in charge of training models and saving models into S3. This is made using Directed Acyclic Graphs (DAGs) in Airflow for orchestration and MLflow as a monitoring service for training model that creates a registry over S3.

Trainer env params

 pg_host=
 pg_port=
 pg_user=
 pg_password=
 pg_dbname=
 pg_host_ml=
 pg_port_ml=
 pg_user_ml=
 pg_password_ml=
 pg_dbname_ml='mlruns'
 PG_POOL='true'
 MODELS_S3_BUCKET= #'s3://path/to/bucket'
 pg_user_airflow=
 pg_password_airflow=
 pg_dbname_airflow='airflow'
 pg_host_airflow=
 pg_port_airflow=
 AIRFLOW_HOME=/app/airflow
 airflow_secret_key=
 airflow_admin_password=
 crons_train='0 0 * * *'

Recommendation service

The recommendation service is a FastAPI server that uses MLflow to read models from S3 and serve them, it also takes feedback from user and saves it into postgres for retraining purposes.

Recommendation env params

 pg_host=
 pg_port=
 pg_user=
 pg_password=
 pg_dbname=
 pg_host_ml=
 pg_port_ml=
 pg_user_ml=
 pg_password_ml=
 pg_dbname_ml='mlruns'
 PG_POOL='true'
 API_AUTH_KEY=