Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lblod/delta-producer-report-generator
https://github.com/lblod/delta-producer-report-generator
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lblod/delta-producer-report-generator
- Owner: lblod
- License: mit
- Created: 2021-05-17T14:31:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-22T07:13:24.000Z (about 3 years ago)
- Last Synced: 2024-04-16T06:37:00.355Z (9 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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:
```yaml
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:```json
{
"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](https://github.com/mu-semtech/delta-notifier).
It should be configured as such :```js
{
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](https://docs.docker.com/compose/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](https://github.com/mu-semtech/mu-javascript-template), we would recommend
reading "[Developing with the template](https://github.com/mu-semtech/mu-javascript-template#developing-with-the-template)"### Developing in the `mu.semte.ch` stack
Paste the following snip-it in your `docker-compose.override.yml`:
````yaml
delta-producer-report-generator:
image: semtech/mu-javascript-template:1.4.0
environment:
NODE_ENV: "development"
volumes:
- /absolute/path/to/your/sources/:/app/
````