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
Python >= 3.8 required
- Create venv
lets vevn- Run checked/producer
Locally
lets kafka
lets checker https://google.com --interval=1 --kafka-bootstrap=localhost:9093 --kafka-topic=checksQuick 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- 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 migrationOr 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_checkQuick 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"lets testThis project uses https://github.com/jazzband/pip-tools
To install all dependencies inside venv run:
lets install-depsTo update all dependencies run:
lets update-depsTo update one package run:
lets update-deps pytestThis will regenerate requirements.txt
