Files
CosmicClash/compose.allocated-smoke.yml
T
Josh Creek 8ba045063d fix(compose): give the allocated smoke's allocator its signing key
Making cmd/allocator refuse to start without join-signing material was
right -- an allocator that binds allocations it can never publish rosters
for strands every match silently -- but I updated the Kubernetes
manifests and the kind fixture without updating the Compose one. The
allocator container exited at startup, so no allocation was ever bound
and verify-allocated-compose failed with "allocator did not bind a
provider allocation".

Mount the same join-signing-keys.json fixture the game server already
uses and name the key it was written with. Caught by running the target
locally rather than by CI after a push.
2026-09-05 18:19:56 +01:00

118 lines
5.3 KiB
YAML

services:
database:
image: postgres:17-alpine
environment:
POSTGRES_DB: cosmic_clash_test
POSTGRES_USER: cosmic_clash_test
POSTGRES_PASSWORD: cosmic_clash_test
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cosmic_clash_test -d cosmic_clash_test"]
interval: 1s
timeout: 3s
retries: 30
control-plane:
build:
context: .
target: testkit-api
environment:
COSMIC_CLASH_POSTGRES_DSN: postgres://cosmic_clash_test:cosmic_clash_test@database:5432/cosmic_clash_test?sslmode=disable
COSMIC_CLASH_WORKLOAD_SECRET: compose-workload-secret
command: ["--listen=0.0.0.0:8080", "--migrations=/opt/cosmic-clash/migrations"]
depends_on:
database:
condition: service_healthy
ports:
- "18080:8080"
matcher:
build:
context: .
target: matcher
environment:
COSMIC_CLASH_POSTGRES_DSN: postgres://cosmic_clash_test:cosmic_clash_test@database:5432/cosmic_clash_test?sslmode=disable
command: ["--dsn=postgres://cosmic_clash_test:cosmic_clash_test@database:5432/cosmic_clash_test?sslmode=disable", "--migrations=/opt/cosmic-clash/migrations", "--playlist=casual", "--size=6", "--interval=1s"]
depends_on:
database:
condition: service_healthy
agones-provider:
image: python:3.12-alpine
command: ["python3", "/opt/fake_agones_provider.py"]
environment:
FAKE_AGONES_TLS_CERT: /run/cosmic-clash/fake-agones.crt
FAKE_AGONES_TLS_KEY: /run/cosmic-clash/fake-agones.key
volumes:
- ./scripts/fake_agones_provider.py:/opt/fake_agones_provider.py:ro
- ${COMPOSE_SMOKE_DIR:-/tmp/cosmic-clash-allocated-smoke}/fake-agones.crt:/run/cosmic-clash/fake-agones.crt:ro
- ${COMPOSE_SMOKE_DIR:-/tmp/cosmic-clash-allocated-smoke}/fake-agones.key:/run/cosmic-clash/fake-agones.key:ro
allocator:
build:
context: .
target: allocator
environment:
COSMIC_CLASH_POSTGRES_DSN: postgres://cosmic_clash_test:cosmic_clash_test@database:5432/cosmic_clash_test?sslmode=disable
COSMIC_CLASH_AGONES_URL: https://agones-provider:8443
COSMIC_CLASH_AGONES_NAMESPACE: cosmic-clash
COSMIC_CLASH_WORKLOAD_SECRET: compose-workload-secret
COSMIC_CLASH_KUBERNETES_TOKEN_PATH: /run/cosmic-clash/kubernetes-token
COSMIC_CLASH_KUBERNETES_CA_PATH: /run/cosmic-clash/fake-agones.crt
# The allocator signs one join authorisation per participant and publishes
# the assignment roster, so it needs the same key material the game server
# verifies with. It refuses to start without them rather than binding
# allocations that could never become joinable.
command: ["--dsn=postgres://cosmic_clash_test:cosmic_clash_test@database:5432/cosmic_clash_test?sslmode=disable", "--migrations=/opt/cosmic-clash/migrations", "--interval=1s", "--transport=enet", "--join-authorisations-key-file=/run/secrets/cosmic-clash/join-signing-keys.json", "--join-authorisations-key-id=compose-key-1"]
depends_on:
database:
condition: service_healthy
agones-provider:
condition: service_started
volumes:
- ${COMPOSE_SMOKE_DIR:-/tmp/cosmic-clash-allocated-smoke}/kubernetes-token:/run/cosmic-clash/kubernetes-token:ro
- ${COMPOSE_SMOKE_DIR:-/tmp/cosmic-clash-allocated-smoke}/fake-agones.crt:/run/cosmic-clash/fake-agones.crt:ro
- ${COMPOSE_SMOKE_DIR:-/tmp/cosmic-clash-allocated-smoke}/join-signing-keys.json:/run/secrets/cosmic-clash/join-signing-keys.json:ro
maintenance:
build:
context: .
target: maintenance
environment:
COSMIC_CLASH_POSTGRES_DSN: postgres://cosmic_clash_test:cosmic_clash_test@database:5432/cosmic_clash_test?sslmode=disable
command: ["--dsn=postgres://cosmic_clash_test:cosmic_clash_test@database:5432/cosmic_clash_test?sslmode=disable", "--migrations=/opt/cosmic-clash/migrations", "--interval=1h", "--initial-connect-interval=1s"]
depends_on:
database:
condition: service_healthy
game-server:
build:
context: .
target: game-server
command:
- --drain-url=http://127.0.0.1:7780/drain
- --drain-token-env=COSMIC_CLASH_DRAIN_TOKEN
- --drain-grace=10s
- --
- /opt/cosmic-clash/cosmic-clash-server
- --port=31001
- --allocated-mode
- --match-id=compose-match-0001
- --server-id=compose-server-0001
- --playlist-version=casual
- --playlist=casual
- --client-build=build-1
- --assignment-expiry-unix=4102444800
- --server-image-digest=sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- --transport=enet
- --region=EU
- --join-authorisations-file=/run/cosmic-clash/join-roster.json
- --join-authorisations-key-file=/run/secrets/cosmic-clash/join-signing-keys.json
- --readiness-port=7780
environment:
COSMIC_CLASH_DRAIN_TOKEN: compose-drain-token
COSMIC_CLASH_CONTROL_PLANE_URL: http://control-plane:8080
COSMIC_CLASH_WORKLOAD_TOKEN: ${COSMIC_CLASH_COMPOSE_WORKLOAD_TOKEN:?allocated smoke workload token is required}
volumes:
- ${COMPOSE_SMOKE_DIR:-/tmp/cosmic-clash-allocated-smoke}/join-roster.json:/run/cosmic-clash/join-roster.json:ro
- ${COMPOSE_SMOKE_DIR:-/tmp/cosmic-clash-allocated-smoke}/join-signing-keys.json:/run/secrets/cosmic-clash/join-signing-keys.json:ro