Categorygithub.com/adevinta/vulcan-reports-generator

# README

vulcan-reports-generator

Micro service responsible for vulcan reports generation, upload and optionally notification.

Report generation

Report generation requests are read from a queue, where the expected payload complies with:

{
    "type": "livereport",
    "team_info": {
        "id": "4d823e6f-7c5b-4174-85ae-6c0add4d65a7",
        "name": "TestTeam",
        "recipients": ["[email protected]"]
    },
    "data": {
        ...
    },
    "auto_send": true
}
  • type indicates the type of report to generate and is used internally to load and execute the appropiate generator and repository for each type.
  • team_info contains information related to the vulcan team associated with the report and the recipients for the report notification (if auto_send param is set to true).
  • data contains data only relevant to the report generator for the specified type, so this data JSON object is not fixed, is opaque to the queue events processor and passed to the correspondent generator type.
  • auto_send indicates if generated report's notification should be sent to the specified recipients.

API

Reports generation micro service also exposes an API with the following methods:

Get Report Notification

Req:
GET /api/v1/reports/{report_type}/{report_id}/notification

Resp:
{
    "subject": "Vulcan Digest - Adevinta",
    "body": "Vulcan Weekly Digest....",
    "format": "HTML"
}

Send Report Notification:

Req:
POST /api/v1/reports/{report_type}/{report_id}/send
{
    "recipients":["[email protected]"]
}

Resp:
HTTP 200 Ok

Healthcheck

Req:
GET /healthcheck

Resp:
HTTP 200 Ok

Docker execute

These are the variables you have to use:

VariableDescriptionSample
LOG_LEVELpanic, fatal, error, warn, info, debug or trace (default info)debug
PORT8080
PG_HOSTlocalhost
PG_PORT5438
PG_USERvulcan_reportgen
PG_PASSWORDvulcan_reportgen
PG_SSLMODEone of: disable, allow, prefer, require, verify-ca, verify-fulldisable
PG_NAMEvulcan_reportgen
SQS_QUEUE_ARNSQS to push report generation requestsfrom vulcan-apiarn:aws:sqs:xxx:123456789012:yyy
SQS_NUM_PROCESSORSNumber of processors2
SES_REGIONAWS region for SES servicexxx
SES_FROMFrom address to use for AWS SES[email protected]
SES_CCComma separated list of CC email adresses strings. E.g.: "[email protected]","[email protected]"
LIVEREPORT_EMAIL_SUBJECT[Test] Live Report
docker build . -t vrg:local

# Use the default config.toml customized with env variables and mapping host AWS dir:
docker run --env-file local.env -p 8080:8080 -v $HOME/.aws:/root/.aws vrg:local

# Use custom config.toml:
docker run -v `pwd`/custom.toml:/app/config.toml -p 8080:8080 vrg:local

# Packages

No description provided by the author
No description provided by the author