# Number of worker processes to spawn.
# Set to 0 to run everything in a single process without clustering.
# Use 'ncpu' to run as many workers as there are CPU units
num_workers: 0

# Log error messages and gracefully restart a worker if v8 reports that it
# uses more heap (note: not RSS) than this many mb.
worker_heap_limit_mb: 250

# Logger info
logging:
  level: info
  streams:
    - type: debug
#  streams:
#  # Use gelf-stream -> logstash
#  - type: gelf
#    host: logstash1003.eqiad.wmnet
#    port: 12201

# Statsd metrics reporter
metrics:
  #type: log
  #host: localhost
  #port: 8125

services:
  - name: tilerator
    # a relative path or the name of an npm package, if different from name
    module: ./app.js
    # optionally, a version constraint of the npm package
    # version: ^0.4.0
    # per-service config
    conf:
      port: 16534

      # restrict to localhost access only
      interface: localhost

      # more per-service config settings
      # the location of the spec, defaults to spec.yaml if not specified
      spec: ./spec.template.yaml
      # allow cross-domain requests to the API (default '*')
      cors: '*'
      # to disable use:
      # cors: false
      # to restrict to a particular domain, use:
      # cors: restricted.domain.org
      # content for the CSP headers
      # csp: false  # uncomment this line to disable sending them
      # URL of the outbound proxy to use (complete with protocol)
      # proxy: http://my.proxy.org:8080
      # the list of domains for which not to use the proxy defined above
      # no_proxy_list:
      #   - domain1.com
      #   - domain2.org
      # the list of incoming request headers that can be logged; if left empty,
      # the following headers are allowed: cache-control, content-length,
      # content-type, if-match, user-agent, x-request-id
      # log_header_whitelist:
      #   - cache-control
      #   - content-length
      #   - content-type
      #   - if-match
      #   - user-agent
      #   - x-request-id

      sources: ./sources.dev.yaml

      variables:
        cassandra-user: cassandra
        cassandra-pswd: cassandra
        cassandra-servers:
        - localhost
        osmdb-user: ''
        osmdb-pswd: ''

      modules:
      - tilelive-tmstyle
      - "@kartotherian/autogen"
      - "@kartotherian/cassandra"
      - "@kartotherian/layermixer"
      - "@kartotherian/overzoom"
      - "@kartotherian/postgres"
      - "@kartotherian/substantial"
      - "@kartotherian/tilelive-tmsource"
      - "@kartotherian/tilelive-vector"
      - "@kartotherian/babel"

      # URI for the eventlogging service (optional)
      eventlogging_service_uri: http://localhost:8085/v1/events
      # Sources for which tiles in shared cache should be invalidated on resource change (optional)
      sources_to_invalidate:
      - osm
      - osm-intl
      # Domain of tile server (if sending invalidation events)
      tile_server_domain: maps.localhost

      # If true, do not enable admin interface
      daemonOnly: true

      # If true, runs this instance without processing tiles
      # This could be good for queue management
      uiOnly: false

      # Set different timeout for tile generation in case mapnik stuck on
      # locked resource while reading Postgres
      tileTimeOut: 90000
