Skip to content

kindermax/site-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Site check

This project uses https://lets-cli.org/ task runner.

Install lets https://lets-cli.org/docs/installation.

How to use https://lets-cli.org/docs/getting_started

Architecture

alt text

Run

Python >= 3.8 required

  1. Create venv
lets vevn
  1. Run checked/producer

Locally

lets kafka
lets checker https://google.com --interval=1 --kafka-bootstrap=localhost:9093 --kafka-topic=checks

Quick check whats going on in local kafka topic:

lets kafka-console-consumer --bootstrap-server kafka:9092 --topic checks


With cloud provider (Aiven)

lets checker https://google.com \
  --interval=1 \
  --kafka-bootstrap=kafka-site-check-project-7d36.aivencloud.com:13611 \
  --kafka-topic=checks \
  --kafka-ca-path=./certs/ca.pem \
  --kafka-cert-path=./certs/service.cert \
  --kafka-key-path=./certs/service.key
  1. Run consumer

Before first run we have to migrate database schema

lets migrate-up
# or 
lets migrate-up 1 # where 1 is number of specific migration

Or lets migrate-down to rollback all migrations

Locally

lets kafka # in one terminal
lets postgres  # in another terminal
lets consumer --kafka-bootstrap=localhost:9093 --kafka-topic=checks --postgres-uri=postgres://postgres:postgres@localhost:5432/site_check

Quick check whats going on in local kafka topic:

lets kafka-console-consumer --bootstrap-server kafka:9092 --topic checks


With cloud provider (Aiven)

lets consumer \
  --kafka-bootstrap=kafka-site-check-project-7d36.aivencloud.com:13611 \
  --kafka-topic=checks \
  --kafka-ca-path=./certs/ca.pem \
  --kafka-cert-path=./certs/service.cert \
  --kafka-key-path=./certs/service.key \
  --postgres-uri="postgres://user:password@pg-site-check-project-7d36.aivencloud.com:13609/site_check?sslmode=require"

Test

lets test

Dependencies

This project uses https://github.com/jazzband/pip-tools

To install all dependencies inside venv run:

lets install-deps

To update all dependencies run:

lets update-deps

To update one package run:

lets update-deps pytest

This will regenerate requirements.txt

About

Check site for status

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages