From 432dbe9fee2b6eb30d2c47e94a37aafe48ae0bcd Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Mon, 15 Mar 2021 13:22:39 +0000 Subject: [PATCH] adding cic cache details --- apps/cic-cache/cic_cache/tasks/__init__.py | 0 apps/cic-cache/setup.cfg | 6 ++-- docker-compose.yml | 40 ++++++++++++++++++++-- 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 apps/cic-cache/cic_cache/tasks/__init__.py diff --git a/apps/cic-cache/cic_cache/tasks/__init__.py b/apps/cic-cache/cic_cache/tasks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/cic-cache/setup.cfg b/apps/cic-cache/setup.cfg index 3831269..07ceec1 100644 --- a/apps/cic-cache/setup.cfg +++ b/apps/cic-cache/setup.cfg @@ -25,6 +25,7 @@ licence_files = python_requires = >= 3.6 packages = cic_cache + cic_cache.tasks cic_cache.db cic_cache.db.models cic_cache.runnable @@ -33,5 +34,6 @@ scripts = [options.entry_points] console_scripts = - cic-cache-tracker = cic_cache.runnable.tracker:main - cic-cache-server = cic_cache.runnable.server:main + cic-cache-trackerd = cic_cache.runnable.tracker:main + cic-cache-serverd = cic_cache.runnable.server:main + cic-cache-taskerd = cic_cache.runnable.tasker:main diff --git a/docker-compose.yml b/docker-compose.yml index 7bd962b..5079aa1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -162,7 +162,43 @@ services: - -c - | if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi - /usr/local/bin/cic-cache-tracker -vv + /usr/local/bin/cic-cache-trackerd -vv + volumes: + - contract-config:/tmp/cic/config/:ro + + cic-cache-tasker: + build: + context: apps + dockerfile: cic-cache/docker/Dockerfile + environment: + CIC_REGISTRY_ADDRESS: $CIC_REGISTRY_ADDRESS # supplied at contract-config after contract provisioning + ETH_PROVIDER: ${ETH_PROVIDER:-http://eth:8545} + DATABASE_USER: ${DATABASE_USER:-grassroots} + DATABASE_PASSWORD: ${DATABASE_PASSWORD:-tralala} # this is is set at initdb see: postgres/initdb/create_db.sql + DATABASE_HOST: ${DATABASE_HOST:-postgres} + DATABASE_PORT: ${DATABASE_PORT:-5432} + DATABASE_NAME: ${DATABASE_NAME_CIC_CACHE:-cic_cache} + DATABASE_ENGINE: ${DATABASE_ENGINE:-postgres} + DATABASE_DRIVER: ${DATABASE_DRIVER:-psycopg2} + DATABASE_DEBUG: 1 + ETH_ABI_DIR: ${ETH_ABI_DIR:-/usr/local/share/cic/solidity/abi} + CIC_TRUST_ADDRESS: ${DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER:-0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C} + CIC_CHAIN_SPEC: ${CIC_CHAIN_SPEC:-evm:bloxberg:8996} + CELERY_BROKER_URL: redis://redis:6379 + CELERY_RESULT_URL: redis://redis:6379 + deploy: + restart_policy: + condition: on-failure + depends_on: + - redis + - postgres + - eth + command: + - /bin/bash + - -c + - | + if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi + /usr/local/bin/cic-cache-taskerd -vv volumes: - contract-config:/tmp/cic/config/:ro @@ -192,7 +228,7 @@ services: - | if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi "/usr/local/bin/uwsgi" \ - --wsgi-file /usr/src/cic-cache/cic_cache/runnable/server.py \ + --wsgi-file /usr/src/cic-cache/cic_cache/runnable/serverd.py \ --http :8000 \ --pyargv -vv