Skip to content

lblod/delta-producer-report-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

delta-producer-report-generator

Service that generates reports or warning emails about deltas.

Installation

docker-compose.yml

To add the service to your mu.semte.ch stack, add the following snippet to docker-compose.yml:

services:
  delta-producer-report-generator:
    image: lblod/delta-producer-report-generator:x.x.x
    environment:
      EMAIL_FROM: "[email protected]"
      EMAIL_TO: "[email protected]"
      OUTBOX: "http://a/uri"
      APP_NAME: "An app name"
    volumes:
      - ./config/delta/report-generator:/config

Add configuration

Configure which job types you want to monitor and get an email when it fails. An example of the config.json file:

{
  "monitoredJobTypes": [
    "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialCacheGraphSyncing/SomeTheme",
    "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/SomeTheme",
    "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/SomeTheme"
  ]
}

Wire the deltas

This service works by receiving deltas from the delta-notifier. It should be configured as such :

  {
    match: {
      predicate: {
        type: 'uri',
        value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
      },
      object: {
        type: 'uri',
        value: 'http://redpencil.data.gift/vocabularies/deltas/Error'
      }
    },
    callback: {
      url: 'http://delta-producer-report-generator/delta',
      method: 'POST'
    },
    options: {
      resourceFormat: 'v0.0.1',
      gracePeriod: 1000,
      ignoreFromSelf: true
    }
  },
  {
    match: {
      predicate: {
        type: 'uri',
        value: 'http://www.w3.org/ns/adms#status'
      }
    },
    callback: {
      url: 'http://delta-producer-report-generator/delta',
      method: 'POST'
    },
    options: {
      resourceFormat: 'v0.0.1',
      gracePeriod: 1000,
      ignoreFromSelf: true
    }
  }

Environment variables

Provided environment variables by the service. These can be added in within the docker declaration.

Name Description Default
EMAIL_FROM Email address from which emails are sent
EMAIL_TO Email address to which emails are sent
OUTBOX Outbox URI (for deliver-email-service)
APP_NAME The name of the app, to help differentiating emails

Development

For a more detailed look in how to develop a microservices based on the mu-javascript-template, we would recommend reading "Developing with the template"

Developing in the mu.semte.ch stack

Paste the following snip-it in your docker-compose.override.yml:

delta-producer-report-generator:
  image: semtech/mu-javascript-template:1.4.0
  environment:
    NODE_ENV: "development"
  volumes:
    - /absolute/path/to/your/sources/:/app/