Repository navigation
Expand file tree
/
Copy pathcompose.test.yaml
More file actions
157 lines (147 loc) · 5.06 KB
/
Copy pathcompose.test.yaml
File metadata and controls
157 lines (147 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# The test setup: every agent talks to a fake LLM instead of a real provider (contract/fake-llm.mjs),
# so the tests cost nothing and give the same answer every time. Real API keys are not used.
# Two more backends talk to the demo model, as the demo does without agent/.env.
#
# Contract tests, both backends and the separate agent service:
# docker compose -f compose.yaml -f compose.test.yaml --profile dotnet --profile node --profile agent up -d --build
# Browser tests, one backend behind the web server:
# docker compose -f compose.yaml -f compose.test.yaml --profile node up -d --build
services:
fake-llm:
build:
context: contract
additional_contexts:
demo-model: demo-model
dockerfile_inline: |
FROM node:24-alpine
COPY --from=demo-model server.mjs /demo-model/
COPY fake-llm.mjs /contract/
CMD ["node", "/contract/fake-llm.mjs"]
ports:
- 127.0.0.1:${FAKE_LLM_PORT:-4000}:4000
dotnet-api:
environment: &fake-model
MODEL: anthropic/claude-sonnet-5-5
ANTHROPIC_API_KEY: test-key
ANTHROPIC_BASE_URL: http://fake-llm:4000/v1
DEBUG_TRAFFIC: "on"
depends_on:
fake-llm:
condition: service_started
node-api:
environment: *fake-model
depends_on:
fake-llm:
condition: service_started
agent:
environment:
<<: *fake-model
# Both backends answer under data-api in this setup, so the agent service names one.
DATA_API_URL: http://node-api:8080
depends_on:
fake-llm:
condition: service_started
# The same backends with a model in OpenAI's Chat Completions format (Mistral; OpenAI and Gemini
# use the same path in the .NET backend), so both API formats are tested.
dotnet-api-mistral:
profiles: [dotnet]
build: backends/dotnet
environment:
ConnectionStrings__Analytics: Server=sqlserver;Database=AdventureWorksDW;User Id=AnalyticsReader;Password=${ANALYTICS_READER_PASSWORD};TrustServerCertificate=True
DATA_SCOPE: "*"
MODEL: mistral/mistral-large-latest
MISTRAL_API_KEY: test-key
MISTRAL_BASE_URL: http://fake-llm:4000/v1
DEBUG_TRAFFIC: "on"
ports:
- 127.0.0.1:8083:8080
depends_on:
sqlserver:
condition: service_healthy
fake-llm:
condition: service_started
node-api-mistral:
profiles: [node]
build: backends/node
environment:
DATABASE_URL: postgres://analytics_reader:${ANALYTICS_READER_PASSWORD}@postgres:5432/adventureworks
DATA_SCOPE: "*"
MODEL: mistral/mistral-large-latest
MISTRAL_API_KEY: test-key
MISTRAL_BASE_URL: http://fake-llm:4000/v1
DEBUG_TRAFFIC: "on"
ports:
- 127.0.0.1:8084:8080
depends_on:
postgres:
condition: service_healthy
fake-llm:
condition: service_started
# Mastra with an OpenAI model: it uses OpenAI's Responses API, the .NET backend Chat Completions.
node-api-openai:
profiles: [node]
build: backends/node
environment:
DATABASE_URL: postgres://analytics_reader:${ANALYTICS_READER_PASSWORD}@postgres:5432/adventureworks
DATA_SCOPE: "*"
MODEL: openai/gpt-test
OPENAI_API_KEY: test-key
OPENAI_BASE_URL: http://fake-llm:4000/v1
DEBUG_TRAFFIC: "on"
ports:
- 127.0.0.1:8085:8080
depends_on:
postgres:
condition: service_healthy
fake-llm:
condition: service_started
# Both backends with the demo model, configured by agent/demo.env alone.
dotnet-api-demo:
profiles: [dotnet]
build: backends/dotnet
environment:
ConnectionStrings__Analytics: Server=sqlserver;Database=AdventureWorksDW;User Id=AnalyticsReader;Password=${ANALYTICS_READER_PASSWORD};TrustServerCertificate=True
DATA_SCOPE: "*"
env_file: agent/demo.env
ports:
- 127.0.0.1:8086:8080
depends_on:
sqlserver:
condition: service_healthy
node-api-demo:
profiles: [node]
build: backends/node
environment:
DATABASE_URL: postgres://analytics_reader:${ANALYTICS_READER_PASSWORD}@postgres:5432/adventureworks
DATA_SCOPE: "*"
env_file: agent/demo.env
ports:
- 127.0.0.1:8087:8080
depends_on:
postgres:
condition: service_healthy
# Both backends with a model whose API key is missing: they start, and the chat says what to set.
dotnet-api-nokey:
profiles: [dotnet]
build: backends/dotnet
environment:
ConnectionStrings__Analytics: Server=sqlserver;Database=AdventureWorksDW;User Id=AnalyticsReader;Password=${ANALYTICS_READER_PASSWORD};TrustServerCertificate=True
DATA_SCOPE: "*"
MODEL: mistral/mistral-large-latest
ports:
- 127.0.0.1:8088:8080
depends_on:
sqlserver:
condition: service_healthy
node-api-nokey:
profiles: [node]
build: backends/node
environment:
DATABASE_URL: postgres://analytics_reader:${ANALYTICS_READER_PASSWORD}@postgres:5432/adventureworks
DATA_SCOPE: "*"
MODEL: mistral/mistral-large-latest
ports:
- 127.0.0.1:8089:8080
depends_on:
postgres:
condition: service_healthy