Skip to content

Commit fd055a9

Browse files
Pin compose topology identity for split-role services
1 parent 64f4121 commit fd055a9

5 files changed

Lines changed: 39 additions & 1 deletion

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,10 @@ execution through local Laravel queue workers. Set
672672
`DW_SERVER_TOPOLOGY_SHAPE` and `DW_SERVER_PROCESS_CLASS` when a deployment
673673
splits scheduler, matching, or execution work away from the default
674674
`server_http_node` so discovery reports the live node identity instead of a
675-
generic HTTP shape. `topology.matching_role` adds the live matching-role
675+
generic HTTP shape. The published Compose artifacts set these per service for
676+
the supported `server`, `worker`, and `scheduler` nodes, so `GET /api/cluster/info`
677+
and local diagnostics report the same node class the operator actually
678+
deployed. `topology.matching_role` adds the live matching-role
676679
deployment knobs for that node: `queue_wake_enabled`, the matching-role
677680
`shape` (`in_worker` or `dedicated`), who owns the broad-poll wake
678681
(`worker_loop` or `dedicated_repair_pass`), the active `task_dispatch_mode`

docker-compose.published.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ services:
4444
- "${SERVER_PORT:-8080}:8080"
4545
environment:
4646
<<: *server-environment
47+
DW_SERVER_TOPOLOGY_SHAPE: standalone_server
48+
DW_SERVER_PROCESS_CLASS: server_http_node
4749
depends_on:
4850
bootstrap:
4951
condition: service_completed_successfully
@@ -63,6 +65,8 @@ services:
6365
command: php artisan queue:work --sleep=1 --tries=3 --max-time=3600
6466
environment:
6567
<<: *server-environment
68+
DW_SERVER_TOPOLOGY_SHAPE: standalone_server
69+
DW_SERVER_PROCESS_CLASS: worker_node
6670
depends_on:
6771
bootstrap:
6872
condition: service_completed_successfully
@@ -81,6 +85,8 @@ services:
8185
sh -c 'while true; do php artisan schedule:evaluate --limit=100; php artisan activity:timeout-enforce --limit=100; php artisan history:prune --limit=100; sleep 10; done'
8286
environment:
8387
<<: *server-environment
88+
DW_SERVER_TOPOLOGY_SHAPE: standalone_server
89+
DW_SERVER_PROCESS_CLASS: scheduler_node
8490
depends_on:
8591
bootstrap:
8692
condition: service_completed_successfully

docker-compose.small-cluster.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ services:
5151
environment:
5252
<<: *server-environment
5353
DW_SERVER_ID: server-a
54+
DW_SERVER_TOPOLOGY_SHAPE: standalone_server
55+
DW_SERVER_PROCESS_CLASS: server_http_node
5456
depends_on:
5557
bootstrap:
5658
condition: service_completed_successfully
@@ -70,6 +72,8 @@ services:
7072
environment:
7173
<<: *server-environment
7274
DW_SERVER_ID: server-b
75+
DW_SERVER_TOPOLOGY_SHAPE: standalone_server
76+
DW_SERVER_PROCESS_CLASS: server_http_node
7377
depends_on:
7478
bootstrap:
7579
condition: service_completed_successfully
@@ -90,6 +94,8 @@ services:
9094
environment:
9195
<<: *server-environment
9296
DW_SERVER_ID: scheduler
97+
DW_SERVER_TOPOLOGY_SHAPE: standalone_server
98+
DW_SERVER_PROCESS_CLASS: scheduler_node
9399
depends_on:
94100
bootstrap:
95101
condition: service_completed_successfully

tests/Unit/DedicatedMatchingComposeContractTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@ public function test_override_uses_the_same_image_alias_as_published_compose():
5858
}
5959
}
6060

61+
public function test_published_compose_pins_topology_identity_for_supported_processes(): void
62+
{
63+
$published = $this->read('docker-compose.published.yml');
64+
65+
foreach ([
66+
'DW_SERVER_TOPOLOGY_SHAPE: standalone_server',
67+
'DW_SERVER_PROCESS_CLASS: server_http_node',
68+
'DW_SERVER_PROCESS_CLASS: worker_node',
69+
'DW_SERVER_PROCESS_CLASS: scheduler_node',
70+
] as $needle) {
71+
$this->assertStringContainsString(
72+
$needle,
73+
$published,
74+
"published compose must contain {$needle} so long-running services advertise their real role class",
75+
);
76+
}
77+
}
78+
6179
public function test_readme_documents_the_override_alongside_the_dedicated_daemon_section(): void
6280
{
6381
$readme = $this->read('README.md');
@@ -69,6 +87,8 @@ public function test_readme_documents_the_override_alongside_the_dedicated_daemo
6987
'-f docker-compose.dedicated-matching.yml',
7088
'php artisan workflow:v2:repair-pass --loop',
7189
'DW_V2_MATCHING_ROLE_QUEUE_WAKE',
90+
'DW_SERVER_TOPOLOGY_SHAPE',
91+
'DW_SERVER_PROCESS_CLASS',
7292
] as $needle) {
7393
$this->assertStringContainsString(
7494
$needle,

tests/Unit/SmallClusterContractTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ public function test_compose_harness_proves_the_narrow_cluster_shape(): void
6161
'pgsql:',
6262
'DW_SERVER_ID: server-a',
6363
'DW_SERVER_ID: server-b',
64+
'DW_SERVER_TOPOLOGY_SHAPE: standalone_server',
65+
'DW_SERVER_PROCESS_CLASS: server_http_node',
66+
'DW_SERVER_PROCESS_CLASS: scheduler_node',
6467
'CACHE_STORE: redis',
6568
'QUEUE_CONNECTION: redis',
6669
] as $needle) {

0 commit comments

Comments
 (0)