Files
CosmicClash/compose.allocated-smoke.yml
T

113 lines
4.7 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
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"]
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
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-key
- --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-key:/run/secrets/cosmic-clash/join-signing-key:ro