feat: add workers autodicsovery feature (#121)

* add workers autodicsovery feature

* suppress erros while retrieving worker list

* update recipes

* fix tests and update docs

* filter health checks

* ping based workers
This commit is contained in:
2024-01-03 02:25:24 +02:00
committed by GitHub
parent fdf7a36271
commit 2d42424477
47 changed files with 1126 additions and 30 deletions

View File

@ -8,4 +8,4 @@
6. All updates from worker instances are uploaded to the web service.
7. Repository is available at `http://localhost:8080/repo`.
Note, in this configuration, workers are spawned in replicated mode, thus the backend accesses them in round-robin-like manner.
In this example, worker list is automatically defined based on the addresses they reported.

View File

@ -77,6 +77,10 @@ services:
interval: 10s
start_period: 30s
depends_on:
backend:
condition: service_healthy
command: web
configs:

View File

@ -2,7 +2,7 @@
target = configuration
[build]
workers = http://worker:8080 http://worker:8080
triggers = ahriman.core.distributed.WorkerLoaderTrigger ahriman.core.gitremote.RemotePullTrigger ahriman.core.report.ReportTrigger ahriman.core.upload.UploadTrigger ahriman.core.gitremote.RemotePushTrigger
[status]
username = demo

View File

@ -2,7 +2,7 @@
target = configuration
[build]
triggers = ahriman.core.upload.UploadTrigger ahriman.core.report.ReportTrigger
triggers = ahriman.core.distributed.WorkerTrigger ahriman.core.upload.UploadTrigger ahriman.core.report.ReportTrigger
[status]
address = http://backend:8080
@ -20,3 +20,6 @@ wait_timeout = 0
target = remote-service
[remote-service]
[worker]
address = http://$HOSTNAME:8080