Skip to content

Commit 31ac35a

Browse files
committed
add: documentation
1 parent b42ea78 commit 31ac35a

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,50 @@
22

33
# Alert Ingress
44
Ingress alerts for the Pi Mask Detection project. Read records from a Kafka topic and persist them to a PostgreSQL database.
5+
6+
## Prerequisites
7+
8+
This project uses a PostgreSQL instance, hosted on GCP with their [Cloud SQL](https://cloud.google.com/sql/docs/postgres) services. The tables used to create the DB are
9+
defined in the `schema.sql` file.
10+
11+
# Running on local
12+
13+
1. Install locally
14+
````shell script
15+
go install .
16+
````
17+
18+
2. Run the service:
19+
```shell script
20+
$GOPATH/bin/alertIngress
21+
```
22+
23+
# Deploying to Google Cloud Platform (_GCP_)
24+
25+
I assume you already have an existing GCP project.
26+
27+
1. First build and publish the image to Google cloud (make sure the storage bucket write access on your project)
28+
````shell script
29+
gcloud builds submit --tag gcr.io/YOUR_PROJECT_NAME/alert-ingress
30+
````
31+
32+
2. Then, create a Cloud Compute Engine instance using the image you just published. Create a permanent IP address instead of using an ephemeral one.
33+
34+
3. Copy the instance external IP address and go to your Cloud SQL instance dashboard.
35+
36+
4. Go to the `connection` tab, click `+ Add network` and paste your instance IP address.
37+
38+
39+
## Related Projects
40+
41+
This repository hosts the code responsible for the ingress of alert events from potentially several Raspberry Pi or other edge devices.
42+
The other moving parts of the projects are:
43+
44+
- [pi-mask-detection](https://github.com/fpaupier/pi-mask-detection) focuses on the detection of whether someone is wearing their mask or not, as seen per the Raspberry Pi.
45+
46+
- [alertDispatcher](https://github.com/fpaupier/alertDispatcher) is a Go module designed to run at the edge, especially a Raspberry Pi 4 B with 4Go of RAM.
47+
The [alertDispatcher](https://github.com/fpaupier/alertDispatcher) polls the local SQLite event store and publishes them to a Kafka topic.
48+
49+
- [alertIngress](https://github.com/fpaupier/alertIngress) is a Go module designed to run on a server, consuming from a Kafka topic where edge devices pushes their events. For each event consumed, the alert Ingress archives it in PostgresSQL and publishes a message to be consumed by the notification service.
50+
51+

0 commit comments

Comments
 (0)