From 58b4b1e32960b0939292ab0bd1d4ca6c3e55ef75 Mon Sep 17 00:00:00 2001 From: Orzu Ionut Date: Mon, 10 Jan 2022 14:57:59 +0200 Subject: [PATCH] Update README to include Supervisor configs --- README.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1656c5b..bf9c9ef 100644 --- a/README.md +++ b/README.md @@ -54,14 +54,70 @@ details about installing Facebook Duckling in a section below. `php artisan migrate` +- Start Supervisor (after adding the Supervisor configs detailed below) + +`supervisorctl start all` + +- (Optional) Restart Supervisor after a config file update + +`supervisorctl reread` + +`supervisorctl update` + +`supervisorctl restart ` + +### Queues Supervisor config +Add a new Supervisor config file in the "/etc/supervisor/conf.d" path like in the example below: + +Config file path: /etc/supervisor/conf.d/queue-worker-search-and-displace-core-production.conf + +```bash +[program:queue-worker-search-and-displace-core-production] +process_name=%(program_name)s_%(process_num)02d +command=php /var/www/html/searchanddisplace-core/artisan queue:listen --queue=sd_core,default --tries=2 --timeout=180 +autostart=true +autorestart=true +user=www-data +numprocs=3 +redirect_stderr=true +stdout_logfile=/var/log/queue/queue-worker-search-and-displace-core-production.log +``` + +The value for the 'command' key should reflect the app path (in the example above the app's path is "/var/www/html/searchanddisplace-core"). + +The 'stdout_logfile' value is the log file. All parent directories must already exist. + ### Facebook Duckling - `$ apt-get install libpcre3-dev` -- `$ cd ..` -- `$ git clone https://github.com/facebook/duckling.git && cd duckling` +- Go to the directory in which you want to deploy the app (e.g. /var/www/html) +- `$ git clone https://github.com/facebook/duckling.git` +- `$ cd duckling` - `$ curl -sSL https://get.haskellstack.org/ | sh` -- `$ stack build && stack exec duckling-example-exe` +- `$ stack build` +- `$ stack exec duckling-example-exe` - `$ stack test` +### Facebook Duckling Supervisor config +Add a new Supervisor config file in the "/etc/supervisor/conf.d" path like in the example below: + +Config file path: /etc/supervisor/conf.d/duckling-worker-search-and-displace-core-production.conf + +```bash +[program:duckling-worker-search-and-displacecore-production] +process_name=%(program_name)s_%(process_num)02d +directory=/var/www/html/fb-duckling +command=sudo -S stack exec duckling-example-exe +autostart=true +autorestart=true +user=root +numprocs=1 +redirect_stderr=true +stdout_logfile=/var/log/queue/duckling-worker-search-and-displace-core-production.log +``` +The value for the 'directory' key should reflect the Facebook Duckling app path (in the example above the path is "/var/www/html/fb-duckling"). + +The 'stdout_logfile' value is the log file. All parent directories must already exist. + ### Converting documents from MD to ODT - `$ apt-get install pandoc`