Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pelican: Add configuration for Pelican Docker apps #417

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions pillar/kingfisher_process.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
4 changes: 3 additions & 1 deletion salt/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down