Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build ontop of cpu-docker-compose #77

Merged
merged 10 commits into from
Jan 7, 2019
Merged

Build ontop of cpu-docker-compose #77

merged 10 commits into from
Jan 7, 2019

Conversation

pgporada
Copy link
Member

  • Updated the grafana dashboard to match the picture in examples. This was mistakenly missed by me.
  • Added grafana and related configs so it's plug and play with docker-compose.

Copy link
Contributor

@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool, thanks @pgporada 👍 Once #76 is reviewed and merged I'll merge this (assuming there isn't any required feedback that cascades into this PR)

Is setting the providers.options.path to /etc/grafana/provisioning/dashboards all that it took to get Grafana to automatically add the dashboard JSON? Very handy!

@cpu
Copy link
Contributor

cpu commented Dec 19, 2018

@pgporada Can you pull master into this branch so that CI will pass? Thanks!

@coveralls
Copy link

coveralls commented Dec 19, 2018

Pull Request Test Coverage Report for Build 534

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 67.809%

Totals Coverage Status
Change from base Build 512: 0.0%
Covered Lines: 811
Relevant Lines: 1196

💛 - Coveralls

@pgporada
Copy link
Member Author

Is setting the providers.options.path to /etc/grafana/provisioning/dashboards all that it took to get Grafana to automatically add the dashboard JSON? Very handy!

Grafana v5 allows someone to place a dashboard json file in a specified path and Grafana will automatically
ingest it. http://docs.grafana.org/administration/provisioning/

Copy link
Contributor

@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the iteration @pgporada !

.travis.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pgporada ! Once #76 is merged this is ready to go.

…#76)

This adds docker support for building images for `ct-test-srv`, `ct-woodpecker`,
and `ct-malformed`, and an end-to-end environment for testing `ct-woodpecker`
and Prometheus alerts backed by its metrics.

The provided `docker-compose.yml` can be used to create a `ct-test-srv`
container providing two certificate transparency logs `log-one` and `log-two`.
A `ct-woodpecker` container is configured to monitor both logs storing the data
in the mounted sqlite3 db `storage.sqlite`. 

A `prometheus` container is configured to scrape the `ct-woodpecker` container
metrics, and to use an `alertmanager` container to process any alerts. For now
the `alertmanager` container uses an `/echo` endpoint on one of the
`ct-test-srv` logs as a webhook POST target so that alerts are printed to stdout
via the `ct-test-srv`. The `prometheus` container comes configured with the
alerts from #70 as
a starting-point (thanks @pgporada!)

To allow testing alert rules the `ct-test-srv` now has a way to add generic mock
responses for any path. This can be used (for e.g.) to configure one of the logs
to return a 500 error for `/ct/v1/add-chain` for a period of time.

To use the docker environment, first make sure you have a `storage.sqlite` db
created in the project root: `rm storage.sqlite 2>/dev/null ; cat
storage/schema.sqlite | sqlite3 ./storage.sqlite`

Then start the containers: `docker-compose up`

You can access Prometheus at: `http://localhost:9090`

You can break certificate submission for `log-two` by running: `curl -X POST -d
'{"path":"/ct/v1/add-chain","code":404,"response":{"error":"oh noes!"}}'
localhost:4601/add-mock`

Shortly afterwards (2-4m) you can expect the `CertSubmissionErrors` alert to be
firing in `http://localhost:9090/alerts` based on the `ct-woodpecker` container
being unable to submit certificates to `log-two`.

You can cause the alert to recover by fixing `log-two`'s certificate submission
by running: `curl -X POST -d '{"path":"/ct/v1/add-chain"}'
localhost:4601/clear-mock`

Prometheus scrape data will be maintained in Docker volume called
`ct-woodpecker_prometheus_data`. If you remove your docker-compose containers
make sure to also `docker volume rm ct-woodpecker_prometheus_data` to reset the
Prometheus data volume.
@cpu
Copy link
Contributor

cpu commented Jan 4, 2019

@pgporada #76 is merged. Can you catch this branch up with master when you have a chance?

Copy link
Contributor

@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 ☑️

@cpu cpu merged commit f1afff1 into letsencrypt:cpu-docker-compose Jan 7, 2019
@pgporada pgporada deleted the phil-docker-compose branch January 7, 2019 19:00
@cpu
Copy link
Contributor

cpu commented Jan 7, 2019

I did not notice that this merged into cpu-docker-compose and not master. Going to coordinate on a do-over PR :'(

@cpu cpu mentioned this pull request Jan 7, 2019
cpu pushed a commit that referenced this pull request Jan 7, 2019
Following on #76 the
`docker-compose` environment now also includes Grafana configured to display the
example dashboards graphing metrics from the Prometheus container.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants