Kafka consumer that consumes messages produced by applications and updates state in Remediations database and Redis accordingly.
- node.js 10
docker-compose -f build/docker-compose.yml up
npm ci
docker-compose -f build/docker-compose.yml up zookeeper
docker-compose -f build/docker-compose.yml up kafka
docker-compose -f build/docker-compose.yml up db
npm run db:ims
npm start
Metrics can be found at http://localhost:9006/metrics
To run the linter, unit and integration tests run:
npm run verify
Run node test/producer.js
to produce a test message and send it to Kafka.
In addition to the consumer itself this repository also hosts a script that cleans up playbook_runs
, playbook_run_executors
and playbook_run_systems
that failed to reach a final state. More specifically, it:
- looks for
playbook_run_systems
that haven't received an updated in more than 6 hours and failed to reach one of the final statuses (success, failure, canceled). These records are set thecanceled
status. - looks for
playbook_run_executors
that haven't received an update in more than 15 minutes and did not reach one of the final statuses despite all theirplaybook_run_systems
being finished. The status of these records is set based on the status of its systems:failure
if any of the systems failedcanceled
if any of the systems was canceledsuccess
otherwise
- looks for
playbook_runs
that haven't received an update in more than 15 minutes and did not reach one of the final statuses despite theirplaybook_run_executors
being finished. The status of these records is set based on the status of its executors:failure
if any of the executors failedcanceled
if any of the executors was canceledsuccess
otherwise
Upon any change in the master branch the branch is tested, an image is built and deployed in CI and QA environments automatically. This process is controlled by the deployment Jenkinsfile.
The image can then be promoted to production using a Jenkins job. Use the git commit SHA as the REVISION when running the job.
For questions or comments join #platform-automation-standup at ansible.slack.com.