Monorepo consolidation: workspace, shared types, transport plans, docker/swam assets
This commit is contained in:
21
swarm/dev.json
Normal file
21
swarm/dev.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"services": [
|
||||
{
|
||||
"name": "gateway",
|
||||
"image": "cloudlysis/gateway:dev",
|
||||
"mode": "replicated",
|
||||
"replicas": "1/1",
|
||||
"updated_at": null
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "task-1",
|
||||
"service": "gateway",
|
||||
"node": "node-1",
|
||||
"desired_state": "running",
|
||||
"current_state": "running",
|
||||
"error": null
|
||||
}
|
||||
]
|
||||
}
|
||||
55
swarm/stacks/control-plane.yml
Normal file
55
swarm/stacks/control-plane.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
control-api:
|
||||
image: cloudlysis/control-api:dev
|
||||
environment:
|
||||
CONTROL_API_ADDR: "0.0.0.0:8080"
|
||||
CONTROL_PLACEMENT_PATH: "/etc/control/placement.json"
|
||||
CONTROL_SWARM_STATE_PATH: "/etc/control/swarm_state.json"
|
||||
CONTROL_SELF_URL: "http://control-api:8080"
|
||||
configs:
|
||||
- source: control_placement_dev
|
||||
target: /etc/control/placement.json
|
||||
- source: control_swarm_state_dev
|
||||
target: /etc/control/swarm_state.json
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- target: 8080
|
||||
published: 8080
|
||||
protocol: tcp
|
||||
mode: ingress
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
control-ui:
|
||||
image: cloudlysis/control-ui:dev
|
||||
environment:
|
||||
VITE_CONTROL_API_URL: "http://control-api:8080"
|
||||
networks:
|
||||
- public
|
||||
- internal
|
||||
ports:
|
||||
- target: 80
|
||||
published: 8081
|
||||
protocol: tcp
|
||||
mode: ingress
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
configs:
|
||||
control_placement_dev:
|
||||
file: ../../placement/dev.json
|
||||
control_swarm_state_dev:
|
||||
file: ../../swarm/dev.json
|
||||
|
||||
networks:
|
||||
public:
|
||||
driver: overlay
|
||||
internal:
|
||||
driver: overlay
|
||||
152
swarm/stacks/observability.yml
Normal file
152
swarm/stacks/observability.yml
Normal file
@@ -0,0 +1,152 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
victoria-metrics:
|
||||
image: victoriametrics/victoria-metrics:v1.120.0
|
||||
command:
|
||||
- "-retentionPeriod=30d"
|
||||
networks:
|
||||
- internal
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
vmagent:
|
||||
image: victoriametrics/vmagent:v1.120.0
|
||||
command:
|
||||
- "-promscrape.config=/etc/vmagent/scrape.yml"
|
||||
- "-remoteWrite.url=http://victoria-metrics:8428/api/v1/write"
|
||||
configs:
|
||||
- source: vmagent_scrape
|
||||
target: /etc/vmagent/scrape.yml
|
||||
networks:
|
||||
- internal
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
loki:
|
||||
image: grafana/loki:3.5.5
|
||||
command:
|
||||
- "-config.file=/etc/loki/config.yml"
|
||||
configs:
|
||||
- source: loki_config
|
||||
target: /etc/loki/config.yml
|
||||
networks:
|
||||
- internal
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
tempo:
|
||||
image: grafana/tempo:2.8.2
|
||||
command:
|
||||
- "-config.file=/etc/tempo/config.yml"
|
||||
configs:
|
||||
- source: tempo_config
|
||||
target: /etc/tempo/config.yml
|
||||
networks:
|
||||
- internal
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:12.1.1
|
||||
environment:
|
||||
GF_SECURITY_ADMIN_USER: "admin"
|
||||
GF_SECURITY_ADMIN_PASSWORD__FILE: "/run/secrets/grafana_admin_password"
|
||||
GF_AUTH_ANONYMOUS_ENABLED: "false"
|
||||
configs:
|
||||
- source: grafana_datasources
|
||||
target: /etc/grafana/provisioning/datasources/datasources.yml
|
||||
- source: grafana_dashboards_provider
|
||||
target: /etc/grafana/provisioning/dashboards/dashboards.yml
|
||||
- source: dashboard_operations_overview
|
||||
target: /var/lib/grafana/dashboards/operations_overview.json
|
||||
- source: dashboard_http_detail
|
||||
target: /var/lib/grafana/dashboards/http_detail.json
|
||||
- source: dashboard_logs
|
||||
target: /var/lib/grafana/dashboards/logs.json
|
||||
- source: dashboard_traces
|
||||
target: /var/lib/grafana/dashboards/traces.json
|
||||
- source: dashboard_event_bus
|
||||
target: /var/lib/grafana/dashboards/event_bus.json
|
||||
- source: dashboard_workers
|
||||
target: /var/lib/grafana/dashboards/workers.json
|
||||
- source: dashboard_storage
|
||||
target: /var/lib/grafana/dashboards/storage.json
|
||||
- source: dashboard_cluster
|
||||
target: /var/lib/grafana/dashboards/cluster.json
|
||||
- source: dashboard_noisy_neighbor_tenant_health
|
||||
target: /var/lib/grafana/dashboards/noisy_neighbor_tenant_health.json
|
||||
- source: dashboard_api_regression_deployment
|
||||
target: /var/lib/grafana/dashboards/api_regression_deployment.json
|
||||
- source: dashboard_storage_event_bus_bottlenecks
|
||||
target: /var/lib/grafana/dashboards/storage_event_bus_bottlenecks.json
|
||||
- source: dashboard_infrastructure_exhaustion
|
||||
target: /var/lib/grafana/dashboards/infrastructure_exhaustion.json
|
||||
secrets:
|
||||
- grafana_admin_password
|
||||
networks:
|
||||
- public
|
||||
- internal
|
||||
ports:
|
||||
- target: 3000
|
||||
published: 3000
|
||||
protocol: tcp
|
||||
mode: ingress
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
configs:
|
||||
vmagent_scrape:
|
||||
file: ../../observability/vmagent/scrape.yml
|
||||
loki_config:
|
||||
file: ../../observability/loki/config.yml
|
||||
tempo_config:
|
||||
file: ../../observability/tempo/config.yml
|
||||
grafana_datasources:
|
||||
file: ../../observability/grafana/provisioning/datasources/datasources.yml
|
||||
grafana_dashboards_provider:
|
||||
file: ../../observability/grafana/provisioning/dashboards/dashboards.yml
|
||||
dashboard_operations_overview:
|
||||
file: ../../observability/grafana/dashboards/operations_overview.json
|
||||
dashboard_http_detail:
|
||||
file: ../../observability/grafana/dashboards/http_detail.json
|
||||
dashboard_logs:
|
||||
file: ../../observability/grafana/dashboards/logs.json
|
||||
dashboard_traces:
|
||||
file: ../../observability/grafana/dashboards/traces.json
|
||||
dashboard_event_bus:
|
||||
file: ../../observability/grafana/dashboards/event_bus.json
|
||||
dashboard_workers:
|
||||
file: ../../observability/grafana/dashboards/workers.json
|
||||
dashboard_storage:
|
||||
file: ../../observability/grafana/dashboards/storage.json
|
||||
dashboard_cluster:
|
||||
file: ../../observability/grafana/dashboards/cluster.json
|
||||
dashboard_noisy_neighbor_tenant_health:
|
||||
file: ../../observability/grafana/dashboards/noisy_neighbor_tenant_health.json
|
||||
dashboard_api_regression_deployment:
|
||||
file: ../../observability/grafana/dashboards/api_regression_deployment.json
|
||||
dashboard_storage_event_bus_bottlenecks:
|
||||
file: ../../observability/grafana/dashboards/storage_event_bus_bottlenecks.json
|
||||
dashboard_infrastructure_exhaustion:
|
||||
file: ../../observability/grafana/dashboards/infrastructure_exhaustion.json
|
||||
|
||||
secrets:
|
||||
grafana_admin_password:
|
||||
external: true
|
||||
|
||||
networks:
|
||||
public:
|
||||
driver: overlay
|
||||
internal:
|
||||
driver: overlay
|
||||
132
swarm/stacks/platform.yml
Normal file
132
swarm/stacks/platform.yml
Normal file
@@ -0,0 +1,132 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
nats:
|
||||
image: nats:2.10-alpine
|
||||
command: ["-js", "-m", "8222"]
|
||||
ports:
|
||||
- "4222:4222"
|
||||
- "8222:8222"
|
||||
volumes:
|
||||
- nats_data:/data
|
||||
deploy:
|
||||
replicas: 1
|
||||
|
||||
gateway:
|
||||
image: cloudlysis/gateway:dev
|
||||
environment:
|
||||
GATEWAY_ADDR: 0.0.0.0:8080
|
||||
GATEWAY_GRPC_ADDR: 0.0.0.0:8081
|
||||
GATEWAY_STORAGE_PATH: /data/gateway.mdbx
|
||||
GATEWAY_ROUTING_NATS_URL: nats://nats:4222
|
||||
GATEWAY_ROUTING_NATS_BUCKET: gateway.routing
|
||||
GATEWAY_ROUTING_NATS_KEY: routing.json
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "8081:8081"
|
||||
volumes:
|
||||
- gateway_data:/data
|
||||
deploy:
|
||||
replicas: 2
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
failure_action: rollback
|
||||
rollback_config:
|
||||
parallelism: 1
|
||||
order: stop-first
|
||||
|
||||
aggregate:
|
||||
image: cloudlysis/aggregate:dev
|
||||
environment:
|
||||
AGGREGATE_NATS_URL: nats://nats:4222
|
||||
AGGREGATE_STORAGE_PATH: /data
|
||||
AGGREGATE_HTTP_ADDR: 0.0.0.0:8080
|
||||
AGGREGATE_GRPC_ADDR: 0.0.0.0:50051
|
||||
volumes:
|
||||
- aggregate_data:/data
|
||||
deploy:
|
||||
replicas: 3
|
||||
placement:
|
||||
constraints:
|
||||
- node.labels.tenant_range != ""
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
projection:
|
||||
image: cloudlysis/projection:dev
|
||||
environment:
|
||||
PROJECTION_NATS_URL: nats://nats:4222
|
||||
PROJECTION_STREAM_NAME: AGGREGATE_EVENTS
|
||||
PROJECTION_DURABLE_NAME: projection
|
||||
PROJECTION_STORAGE_PATH: /data
|
||||
PROJECTION_MANIFEST_PATH: /config/projection-manifest.yaml
|
||||
PROJECTION_MULTI_TENANT: "true"
|
||||
PROJECTION_MAX_IN_FLIGHT: "128"
|
||||
PROJECTION_ACK_TIMEOUT_MS: "30000"
|
||||
PROJECTION_MAX_DELIVER: "10"
|
||||
PROJECTION_CONSUMER_MODE: single
|
||||
volumes:
|
||||
- projection_data:/data
|
||||
configs:
|
||||
- source: projection_manifest
|
||||
target: /config/projection-manifest.yaml
|
||||
deploy:
|
||||
replicas: 2
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
failure_action: rollback
|
||||
|
||||
runner_saga:
|
||||
image: cloudlysis/runner:dev
|
||||
environment:
|
||||
RUNNER_NATS_URL: nats://nats:4222
|
||||
RUNNER_MODE: saga
|
||||
RUNNER_HTTP_ADDR: 0.0.0.0:8080
|
||||
RUNNER_STORAGE_PATH: /data/runner.mdbx
|
||||
RUNNER_SAGA_MANIFEST_PATH: /config/sagas.yaml
|
||||
RUNNER_EFFECTS_MANIFEST_PATH: /config/effects.yaml
|
||||
volumes:
|
||||
- runner_saga_data:/data
|
||||
configs:
|
||||
- source: runner_sagas
|
||||
target: /config/sagas.yaml
|
||||
- source: runner_effects
|
||||
target: /config/effects.yaml
|
||||
deploy:
|
||||
replicas: 1
|
||||
|
||||
runner_effect:
|
||||
image: cloudlysis/runner:dev
|
||||
environment:
|
||||
RUNNER_NATS_URL: nats://nats:4222
|
||||
RUNNER_MODE: effect
|
||||
RUNNER_HTTP_ADDR: 0.0.0.0:8081
|
||||
RUNNER_STORAGE_PATH: /data/runner.mdbx
|
||||
RUNNER_EFFECTS_MANIFEST_PATH: /config/effects.yaml
|
||||
volumes:
|
||||
- runner_effect_data:/data
|
||||
configs:
|
||||
- source: runner_effects
|
||||
target: /config/effects.yaml
|
||||
deploy:
|
||||
replicas: 1
|
||||
|
||||
configs:
|
||||
projection_manifest:
|
||||
file: ../../projection/projection-manifest.yaml
|
||||
runner_sagas:
|
||||
file: ../../runner/config/sagas.yaml
|
||||
runner_effects:
|
||||
file: ../../runner/config/effects.yaml
|
||||
|
||||
volumes:
|
||||
aggregate_data:
|
||||
gateway_data:
|
||||
nats_data:
|
||||
projection_data:
|
||||
runner_effect_data:
|
||||
runner_saga_data:
|
||||
14
swarm/tenant-placement.yaml
Normal file
14
swarm/tenant-placement.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
virtual_nodes_per_node: 200
|
||||
|
||||
nodes:
|
||||
- node_id: "node-a"
|
||||
tenant_range: "00-3f"
|
||||
- node_id: "node-b"
|
||||
tenant_range: "40-7f"
|
||||
- node_id: "node-c"
|
||||
tenant_range: "80-bf"
|
||||
|
||||
tenants:
|
||||
tenant-a: "node-a"
|
||||
tenant-b: "node-b"
|
||||
|
||||
Reference in New Issue
Block a user