feat: enhance EvoBGP with new command-line options for the evobgp-agent, including a watch command for periodic configuration updates. Update go.mod with additional dependencies and improve Docker Compose setup for new services, including NATS and various worker components.
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
# docker compose --profile reference up -d --build
|
||||
# docker compose --profile microvps up -d --build
|
||||
#
|
||||
# reference: 5× Go (api + scheduler + ingest + render + deploy) + postgres + NATS JetStream + bird2 + agent + web.
|
||||
# microvps: evobgp-all + postgres + bird2 + agent (без брокера).
|
||||
#
|
||||
# Опция microVPS_sqlite из плана (без контейнера Postgres): требует реализации store на SQLite в приложении;
|
||||
# пока используйте microvps с контейнерным Postgres (единые миграции).
|
||||
#
|
||||
# Профиль reference: Web UI на http://localhost:3000 (nginx → /v1 и /metrics на evobgp-api:8080).
|
||||
#
|
||||
# Очистка неиспользуемых данных Docker (PowerShell; осторожно с -v):
|
||||
@@ -20,6 +26,13 @@ x-logging: &default-logging
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
x-env-ref: &env-ref
|
||||
EVOBGP_DATABASE_URL: postgres://evobgp:evobgp@postgres:5432/evobgp?sslmode=disable
|
||||
EVOBGP_BROKER_URL: nats://nats:4222
|
||||
|
||||
x-env-micro: &env-micro
|
||||
EVOBGP_DATABASE_URL: postgres://evobgp:evobgp@postgres:5432/evobgp?sslmode=disable
|
||||
|
||||
services:
|
||||
postgres:
|
||||
profiles: ["reference", "microvps"]
|
||||
@@ -43,6 +56,19 @@ services:
|
||||
cpus: "1.0"
|
||||
memory: 384M
|
||||
|
||||
nats:
|
||||
profiles: ["reference"]
|
||||
image: nats:2.10-alpine
|
||||
restart: unless-stopped
|
||||
command: ["-js", "-m", "8222"]
|
||||
ports:
|
||||
- "4222:4222"
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 256M
|
||||
|
||||
evobgp-api:
|
||||
profiles: ["reference"]
|
||||
build:
|
||||
@@ -55,18 +81,23 @@ services:
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_started
|
||||
bird2:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
<<: *env-ref
|
||||
EVOBGP_HTTP_ADDR: ":8080"
|
||||
EVOBGP_SEED_DEMO: "1"
|
||||
EVOBGP_BIRDC_SOCKET: /run/bird/bird.ctl
|
||||
EVOBGP_BIRDC_INTERVAL: 30s
|
||||
# Для прямого доступа к API с dev-сервера Vite (порт 5173); в Docker UI трафик идёт через evobgp-web proxy.
|
||||
EVOBGP_BIRD_ACTIVE_DIR: /etc/bird
|
||||
EVOBGP_BIRD_STAGING_DIR: /tmp/evobgp-bird-staging
|
||||
EVOBGP_CORS_ORIGINS: "http://localhost:5173,http://127.0.0.1:5173,http://localhost:3000,http://127.0.0.1:3000"
|
||||
volumes:
|
||||
- bird_etc:/etc/bird
|
||||
- bird_run:/run/bird:ro
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
@@ -75,6 +106,101 @@ services:
|
||||
cpus: "1.0"
|
||||
memory: 512M
|
||||
|
||||
evobgp-scheduler:
|
||||
profiles: ["reference"]
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: deploy/docker/gobinary/Dockerfile
|
||||
args:
|
||||
BIN: evobgp-scheduler
|
||||
INSTALL_BIRDC: "0"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_started
|
||||
environment:
|
||||
<<: *env-ref
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.25"
|
||||
memory: 128M
|
||||
|
||||
evobgp-ingest:
|
||||
profiles: ["reference"]
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: deploy/docker/gobinary/Dockerfile
|
||||
args:
|
||||
BIN: evobgp-ingest
|
||||
INSTALL_BIRDC: "0"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_started
|
||||
environment:
|
||||
<<: *env-ref
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.25"
|
||||
memory: 128M
|
||||
|
||||
evobgp-render:
|
||||
profiles: ["reference"]
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: deploy/docker/gobinary/Dockerfile
|
||||
args:
|
||||
BIN: evobgp-render
|
||||
INSTALL_BIRDC: "0"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_started
|
||||
environment:
|
||||
<<: *env-ref
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.25"
|
||||
memory: 128M
|
||||
|
||||
evobgp-deploy:
|
||||
profiles: ["reference"]
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: deploy/docker/gobinary/Dockerfile
|
||||
args:
|
||||
BIN: evobgp-deploy
|
||||
INSTALL_BIRDC: "0"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_started
|
||||
environment:
|
||||
<<: *env-ref
|
||||
EVOBGP_BIRD_ACTIVE_DIR: /etc/bird
|
||||
volumes:
|
||||
- bird_etc:/etc/bird:ro
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.25"
|
||||
memory: 128M
|
||||
|
||||
evobgp-web:
|
||||
profiles: ["reference"]
|
||||
build:
|
||||
@@ -109,11 +235,15 @@ services:
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
<<: *env-micro
|
||||
EVOBGP_HTTP_ADDR: ":8080"
|
||||
EVOBGP_SEED_DEMO: "1"
|
||||
EVOBGP_BIRDC_SOCKET: /run/bird/bird.ctl
|
||||
EVOBGP_BIRDC_INTERVAL: 30s
|
||||
EVOBGP_BIRD_ACTIVE_DIR: /etc/bird
|
||||
EVOBGP_BIRD_STAGING_DIR: /tmp/evobgp-bird-staging
|
||||
volumes:
|
||||
- bird_etc:/etc/bird
|
||||
- bird_run:/run/bird:ro
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
@@ -157,8 +287,8 @@ services:
|
||||
volumes:
|
||||
- bird_etc:/etc/bird
|
||||
- bird_run:/run/bird
|
||||
entrypoint: ["/bin/sh", "-c"]
|
||||
command: ["sleep infinity"]
|
||||
entrypoint: ["/usr/local/bin/evobgp-agent"]
|
||||
command: ["watch", "-socket=/run/bird/bird.ctl", "-watch-interval=30s"]
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
resources:
|
||||
|
||||
Reference in New Issue
Block a user