diff --git a/docker/conf/counters_journal_client.yml b/docker/conf/counters_journal_client.yml --- a/docker/conf/counters_journal_client.yml +++ b/docker/conf/counters_journal_client.yml @@ -8,6 +8,12 @@ group_id: swh.counters.journal_client object_types: - content + - directory - origin - - revision + - origin_visit + - origin_visit_status - release + - revision + - skipped_content + - snapshot + diff --git a/docker/conf/web.yml b/docker/conf/web.yml --- a/docker/conf/web.yml +++ b/docker/conf/web.yml @@ -64,3 +64,10 @@ search: {} instance_name: archive-docker.softwareheritage.org + +counters: + cls: remote + url: http://swh-counters:5011/ +counters_backend: swh-counters +history_counters_url: http://swh-counters:5011/counters_history/history.json + diff --git a/docker/docker-compose.counters.yml b/docker/docker-compose.counters.yml deleted file mode 100644 --- a/docker/docker-compose.counters.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: "2.1" - -services: - swh-counters: - image: swh/stack - build: ./ - entrypoint: /entrypoint.sh - environment: - SWH_CONFIG_FILENAME: /etc/softwareheritage/counters/server.yml - env_file: - - ./env/common_python.env - ports: - - 5011:5011 - depends_on: - redis: - condition: service_healthy - volumes: - - "./conf/counters.yml:/etc/softwareheritage/counters/server.yml:ro" - - "./services/swh-counters/entrypoint.sh:/entrypoint.sh:ro" - healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:5011/" ] - interval: 10s - timeout: 5s - retries: 10 - - swh-counters-journal-client: - image: swh/stack - build: ./ - entrypoint: /entrypoint.sh - env_file: - - ./env/common_python.env - depends_on: - kafka: - condition: service_healthy - redis: - condition: service_healthy - swh-counters: - condition: service_healthy - volumes: - - "./conf/counters_journal_client.yml:/etc/softwareheritage/counters/journal_client.yml:ro" - - "./services/swh-counters-journal-client/entrypoint.sh:/entrypoint.sh:ro" - - redis: - image: redis - volumes: - - redis-data:/data - ports: - - 6379 - command: - - "--save" - - "60" - - "1" # flush every minutes - healthcheck: - test: [ "CMD", "redis-cli", "PING" ] - interval: 1s - timeout: 5s - retries: 10 - -volumes: - redis-data: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -105,6 +105,23 @@ image: memcached restart: unless-stopped + redis: + image: redis + volumes: + - redis-data:/data + ports: + - 6379 + command: + - "--save" + - "60" + - "1" # flush every minutes + healthcheck: + test: [ "CMD", "redis-cli", "PING" ] + interval: 1s + timeout: 5s + retries: 10 + + nginx: image: nginx volumes: @@ -557,3 +574,45 @@ volumes: - "./conf/scheduler_journal_client.yml:/etc/softwareheritage/scheduler/journal_client.yml:ro" - "./services/swh-scheduler-journal-client/entrypoint.sh:/entrypoint.sh:ro" + + swh-counters: + image: swh/stack + build: ./ + entrypoint: /entrypoint.sh + environment: + SWH_CONFIG_FILENAME: /etc/softwareheritage/counters/server.yml + env_file: + - ./env/common_python.env + ports: + - 5011:5011 + depends_on: + redis: + condition: service_healthy + volumes: + - "./conf/counters.yml:/etc/softwareheritage/counters/server.yml:ro" + - "./services/swh-counters/entrypoint.sh:/entrypoint.sh:ro" + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:5011/" ] + interval: 10s + timeout: 5s + retries: 10 + + swh-counters-journal-client: + image: swh/stack + build: ./ + entrypoint: /entrypoint.sh + env_file: + - ./env/common_python.env + depends_on: + kafka: + condition: service_healthy + redis: + condition: service_healthy + swh-counters: + condition: service_healthy + volumes: + - "./conf/counters_journal_client.yml:/etc/softwareheritage/counters/journal_client.yml:ro" + - "./services/swh-counters-journal-client/entrypoint.sh:/entrypoint.sh:ro" + +volumes: + redis-data: