From dacae26396181291dee47c15259fd28bb08897ce Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 25 Mar 2023 00:02:21 -0400 Subject: [PATCH] pelican: Add configuration for Pelican Docker apps --- pillar/kingfisher_process.sls | 38 +++++++++++++++++++++++++++++++++++ salt/top.sls | 4 +++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/pillar/kingfisher_process.sls b/pillar/kingfisher_process.sls index 6217c3bc..65c9ffbf 100644 --- a/pillar/kingfisher_process.sls +++ b/pillar/kingfisher_process.sls @@ -39,6 +39,14 @@ apache: documentroot: /home/ocdskfs/scrapyd proxypass: http://localhost:6800/ authname: Kingfisher Scrapyd + pelican: + configuration: pelican + servername: pelican.open-contracting.org + context: + port: 8004 + # Need to sync with `docker_apps.pelican_frontend.port`. + django_port: 8001 + timeout: 300 postgres: # If the replica becomes unavailable, we can temporarily enable public access. @@ -61,6 +69,12 @@ postgres: # Weekly full backup 15 05 * * 3 postgres pgbackrest backup --stanza=kingfisher --type=full 2>&1 | grep -v "unable to remove file.*We encountered an internal error\. Please try again\.\|expire command encountered 1 error.s., check the log file for details" +docker: + user: deployer + uid: 1005 + docker_compose: + version: 1.29.2 + kingfisher_collect: user: ocdskfs autoremove: True @@ -104,3 +118,27 @@ python_apps: target: ocdskingfisherviews config: kingfisher-summarize/logging.json: salt://kingfisher/summarize/files/logging.json + +docker_apps: + pelican_backend: + target: pelican-backend + env: + RABBIT_EXCHANGE_NAME: &PELICAN_BACKEND_RABBIT_EXCHANGE_NAME pelican_backend_data_support_production + # 2021-10-27: on kingfisher-process, out of 6.12318e+07 data items, 195009 or 0.3% are over 30 kB. + KINGFISHER_PROCESS_MAX_SIZE: 30000 + pelican_frontend: + target: pelican-frontend + port: 8001 + host_dir: /data/storage/pelican-frontend + reports: true + env: + DJANGO_PROXY: True + ALLOWED_HOSTS: pelican.open-contracting.org + SECURE_HSTS_SECONDS: 31536000 + RABBIT_EXCHANGE_NAME: *PELICAN_BACKEND_RABBIT_EXCHANGE_NAME + CORS_ALLOWED_ORIGINS: https://pelican.open-contracting.org + # Avoid warning: "Matplotlib created a temporary config/cache directory at /.config/matplotlib because the + # default path (/tmp/matplotlib-........) is not a writable directory; it is highly recommended to set the + # MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib + # and to better support multiprocessing." + MPLCONFIGDIR: /dev/shm/matplotlib diff --git a/salt/top.sls b/salt/top.sls index 23b470da..bf7f5ab7 100644 --- a/salt/top.sls +++ b/salt/top.sls @@ -33,12 +33,14 @@ base: 'kingfisher-process': - postgres.main - - redis + - rabbitmq - kingfisher - kingfisher.collect - kingfisher.collect.incremental - kingfisher.process - kingfisher.summarize + - pelican.backend + - pelican.frontend 'prometheus': - prometheus