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 ad78f0b..8953d64 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -163,7 +163,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 @@ -193,7 +229,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