Skip to content

Commit e830c03

Browse files
authored
Merge pull request #172 from awslabs/fix/config_flags_tests
feat: orchestration layer — single source of truth for CLI/REST/SDK + validation gap fixes
2 parents d729c43 + 3490587 commit e830c03

File tree

254 files changed

+15018
-9060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+15018
-9060
lines changed

config/aws_templates.json

Lines changed: 20 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@
1717
"name": "EC2 Fleet Instant On-Demand",
1818
"providerApi": "EC2Fleet",
1919
"providerType": "aws",
20-
"createdAt": "2026-03-05T10:40:04.572478",
21-
"subnetIds": [],
22-
"securityGroupIds": [],
23-
"vmTypesOnDemand": {},
24-
"vmTypesPriority": {}
20+
"createdAt": "2026-03-18T16:48:20.169104"
2521
},
2622
{
2723
"templateId": "EC2Fleet-Instant-Spot",
@@ -40,11 +36,7 @@
4036
"name": "EC2 Fleet Instant Spot",
4137
"providerApi": "EC2Fleet",
4238
"providerType": "aws",
43-
"createdAt": "2026-03-05T10:40:04.572668",
44-
"subnetIds": [],
45-
"securityGroupIds": [],
46-
"vmTypesOnDemand": {},
47-
"vmTypesPriority": {}
39+
"createdAt": "2026-03-18T16:48:20.169492"
4840
},
4941
{
5042
"templateId": "EC2Fleet-Instant-Mixed",
@@ -63,11 +55,7 @@
6355
"name": "EC2 Fleet Instant Mixed",
6456
"providerApi": "EC2Fleet",
6557
"providerType": "aws",
66-
"createdAt": "2026-03-05T10:40:04.572698",
67-
"subnetIds": [],
68-
"securityGroupIds": [],
69-
"vmTypesOnDemand": {},
70-
"vmTypesPriority": {},
58+
"createdAt": "2026-03-18T16:48:20.169515",
7159
"percentOnDemand": 30
7260
},
7361
{
@@ -86,11 +74,7 @@
8674
"name": "EC2 Fleet Request On-Demand",
8775
"providerApi": "EC2Fleet",
8876
"providerType": "aws",
89-
"createdAt": "2026-03-05T10:40:04.572712",
90-
"subnetIds": [],
91-
"securityGroupIds": [],
92-
"vmTypesOnDemand": {},
93-
"vmTypesPriority": {}
77+
"createdAt": "2026-03-18T16:48:20.169526"
9478
},
9579
{
9680
"templateId": "EC2Fleet-Request-Spot",
@@ -109,11 +93,7 @@
10993
"name": "EC2 Fleet Request Spot",
11094
"providerApi": "EC2Fleet",
11195
"providerType": "aws",
112-
"createdAt": "2026-03-05T10:40:04.572727",
113-
"subnetIds": [],
114-
"securityGroupIds": [],
115-
"vmTypesOnDemand": {},
116-
"vmTypesPriority": {}
96+
"createdAt": "2026-03-18T16:48:20.169537"
11797
},
11898
{
11999
"templateId": "EC2Fleet-Request-Mixed",
@@ -133,11 +113,7 @@
133113
"name": "EC2 Fleet Request Mixed",
134114
"providerApi": "EC2Fleet",
135115
"providerType": "aws",
136-
"createdAt": "2026-03-05T10:40:04.572744",
137-
"subnetIds": [],
138-
"securityGroupIds": [],
139-
"vmTypesOnDemand": {},
140-
"vmTypesPriority": {},
116+
"createdAt": "2026-03-18T16:48:20.169552",
141117
"percentOnDemand": 40,
142118
"allocationStrategyOnDemand": "lowestPrice"
143119
},
@@ -157,11 +133,7 @@
157133
"name": "EC2 Fleet Maintain On-Demand",
158134
"providerApi": "EC2Fleet",
159135
"providerType": "aws",
160-
"createdAt": "2026-03-05T10:40:04.572757",
161-
"subnetIds": [],
162-
"securityGroupIds": [],
163-
"vmTypesOnDemand": {},
164-
"vmTypesPriority": {}
136+
"createdAt": "2026-03-18T16:48:20.169561"
165137
},
166138
{
167139
"templateId": "EC2Fleet-Maintain-Spot",
@@ -180,11 +152,7 @@
180152
"name": "EC2 Fleet Maintain Spot",
181153
"providerApi": "EC2Fleet",
182154
"providerType": "aws",
183-
"createdAt": "2026-03-05T10:40:04.572770",
184-
"subnetIds": [],
185-
"securityGroupIds": [],
186-
"vmTypesOnDemand": {},
187-
"vmTypesPriority": {}
155+
"createdAt": "2026-03-18T16:48:20.169570"
188156
},
189157
{
190158
"templateId": "EC2Fleet-Maintain-Mixed",
@@ -205,11 +173,7 @@
205173
"name": "EC2 Fleet Maintain Mixed",
206174
"providerApi": "EC2Fleet",
207175
"providerType": "aws",
208-
"createdAt": "2026-03-05T10:40:04.572781",
209-
"subnetIds": [],
210-
"securityGroupIds": [],
211-
"vmTypesOnDemand": {},
212-
"vmTypesPriority": {},
176+
"createdAt": "2026-03-18T16:48:20.169577",
213177
"percentOnDemand": 50,
214178
"allocationStrategyOnDemand": "prioritized"
215179
},
@@ -231,11 +195,7 @@
231195
"name": "Spot Fleet Request - Lowest Price",
232196
"providerApi": "SpotFleet",
233197
"providerType": "aws",
234-
"createdAt": "2026-03-05T10:40:04.572799",
235-
"subnetIds": [],
236-
"securityGroupIds": [],
237-
"vmTypesOnDemand": {},
238-
"vmTypesPriority": {}
198+
"createdAt": "2026-03-18T16:48:20.169588"
239199
},
240200
{
241201
"templateId": "SpotFleet-Request-Diversified",
@@ -255,11 +215,7 @@
255215
"name": "Spot Fleet Request - Diversified",
256216
"providerApi": "SpotFleet",
257217
"providerType": "aws",
258-
"createdAt": "2026-03-05T10:40:04.572808",
259-
"subnetIds": [],
260-
"securityGroupIds": [],
261-
"vmTypesOnDemand": {},
262-
"vmTypesPriority": {}
218+
"createdAt": "2026-03-18T16:48:20.169595"
263219
},
264220
{
265221
"templateId": "SpotFleet-Request-CapacityOptimized",
@@ -279,11 +235,7 @@
279235
"name": "Spot Fleet Request - Capacity Optimized",
280236
"providerApi": "SpotFleet",
281237
"providerType": "aws",
282-
"createdAt": "2026-03-05T10:40:04.572816",
283-
"subnetIds": [],
284-
"securityGroupIds": [],
285-
"vmTypesOnDemand": {},
286-
"vmTypesPriority": {}
238+
"createdAt": "2026-03-18T16:48:20.169601"
287239
},
288240
{
289241
"templateId": "SpotFleet-Maintain-LowestPrice",
@@ -303,11 +255,7 @@
303255
"name": "Spot Fleet Maintain - Lowest Price",
304256
"providerApi": "SpotFleet",
305257
"providerType": "aws",
306-
"createdAt": "2026-03-05T10:40:04.572823",
307-
"subnetIds": [],
308-
"securityGroupIds": [],
309-
"vmTypesOnDemand": {},
310-
"vmTypesPriority": {}
258+
"createdAt": "2026-03-18T16:48:20.169606"
311259
},
312260
{
313261
"templateId": "SpotFleet-Maintain-Diversified",
@@ -327,11 +275,7 @@
327275
"name": "Spot Fleet Maintain - Diversified",
328276
"providerApi": "SpotFleet",
329277
"providerType": "aws",
330-
"createdAt": "2026-03-05T10:40:04.572831",
331-
"subnetIds": [],
332-
"securityGroupIds": [],
333-
"vmTypesOnDemand": {},
334-
"vmTypesPriority": {}
278+
"createdAt": "2026-03-18T16:48:20.169611"
335279
},
336280
{
337281
"templateId": "SpotFleet-Maintain-CapacityOptimized",
@@ -351,11 +295,7 @@
351295
"name": "Spot Fleet Maintain - Capacity Optimized",
352296
"providerApi": "SpotFleet",
353297
"providerType": "aws",
354-
"createdAt": "2026-03-05T10:40:04.572849",
355-
"subnetIds": [],
356-
"securityGroupIds": [],
357-
"vmTypesOnDemand": {},
358-
"vmTypesPriority": {}
298+
"createdAt": "2026-03-18T16:48:20.169618"
359299
},
360300
{
361301
"templateId": "ASG-OnDemand",
@@ -372,11 +312,7 @@
372312
"name": "Auto Scaling Group On-Demand",
373313
"providerApi": "ASG",
374314
"providerType": "aws",
375-
"createdAt": "2026-03-05T10:40:04.572862",
376-
"subnetIds": [],
377-
"securityGroupIds": [],
378-
"vmTypesOnDemand": {},
379-
"vmTypesPriority": {}
315+
"createdAt": "2026-03-18T16:48:20.169628"
380316
},
381317
{
382318
"templateId": "ASG-Spot",
@@ -394,11 +330,7 @@
394330
"name": "Auto Scaling Group Spot",
395331
"providerApi": "ASG",
396332
"providerType": "aws",
397-
"createdAt": "2026-03-05T10:40:04.572877",
398-
"subnetIds": [],
399-
"securityGroupIds": [],
400-
"vmTypesOnDemand": {},
401-
"vmTypesPriority": {}
333+
"createdAt": "2026-03-18T16:48:20.169710"
402334
},
403335
{
404336
"templateId": "ASG-Mixed",
@@ -416,11 +348,7 @@
416348
"name": "Auto Scaling Group Mixed",
417349
"providerApi": "ASG",
418350
"providerType": "aws",
419-
"createdAt": "2026-03-05T10:40:04.572889",
420-
"subnetIds": [],
421-
"securityGroupIds": [],
422-
"vmTypesOnDemand": {},
423-
"vmTypesPriority": {},
351+
"createdAt": "2026-03-18T16:48:20.169719",
424352
"percentOnDemand": 30
425353
},
426354
{
@@ -438,11 +366,7 @@
438366
"name": "Run Instances On-Demand",
439367
"providerApi": "RunInstances",
440368
"providerType": "aws",
441-
"createdAt": "2026-03-05T10:40:04.572900",
442-
"subnetIds": [],
443-
"securityGroupIds": [],
444-
"vmTypesOnDemand": {},
445-
"vmTypesPriority": {}
369+
"createdAt": "2026-03-18T16:48:20.169729"
446370
},
447371
{
448372
"templateId": "RunInstances-Spot",
@@ -460,11 +384,7 @@
460384
"name": "Run Instances Spot",
461385
"providerApi": "RunInstances",
462386
"providerType": "aws",
463-
"createdAt": "2026-03-05T10:40:04.572910",
464-
"subnetIds": [],
465-
"securityGroupIds": [],
466-
"vmTypesOnDemand": {},
467-
"vmTypesPriority": {}
387+
"createdAt": "2026-03-18T16:48:20.169737"
468388
}
469389
]
470390
}

config/default_config.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@
205205
"level": "INFO",
206206
"file_path": "logs/app.log",
207207
"console_enabled": false,
208-
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s [%(pathname)s:%(lineno)d (%(funcName)s)]",
209-
"accept_propagated_setting": false
208+
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s [%(pathname)s:%(lineno)d (%(funcName)s)]"
210209
},
211210
"template": {
212211
"max_number": 10,
@@ -215,8 +214,7 @@
215214
"provider_type": "{provider_type}_templates.json",
216215
"generic": "templates.json"
217216
},
218-
"default_price_type": "ondemand",
219-
"default_provider_api": "EC2Fleet"
217+
"default_price_type": "ondemand"
220218
},
221219
"events": {
222220
"enabled": true,

dev-tools/package/generate_pyproject.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@
88
from pathlib import Path
99
from typing import Any
1010

11-
try:
12-
import tomllib
13-
except ImportError:
14-
try:
15-
import tomli as tomllib # noqa: F401
16-
except ImportError:
17-
logging.error("Neither tomllib nor tomli available. Install tomli: pip install tomli")
18-
sys.exit(1)
19-
2011
# Get project root
2112
project_root = Path(__file__).parent.parent.parent
2213

docs/root/examples/sdk_usage.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ async def demo_template_crud(sdk) -> None:
208208
provider_api="EC2Fleet",
209209
image_id="ami-0abcdef1234567890",
210210
name="SDK Demo Template",
211-
instance_type="t3.medium",
211+
configuration={"machine_types": {"t3.medium": 1}},
212212
)
213213
print(f" create_template -> {result}")
214214
except MethodExecutionError as e:
@@ -229,7 +229,7 @@ async def demo_template_crud(sdk) -> None:
229229
result = await sdk.update_template(
230230
template_id=template_id,
231231
name="SDK Demo Template (updated)",
232-
instance_type="t3.large",
232+
configuration={"machine_types": {"t3.large": 1}},
233233
)
234234
print(f" update_template -> {result}")
235235
except MethodExecutionError as e:
@@ -322,11 +322,10 @@ async def demo_return_machines(sdk, machine_ids: list[str], dry_run: bool) -> st
322322

323323
try:
324324
result = await sdk.create_return_request(machine_ids=machine_ids)
325-
return_request_id = (
326-
result.get("created_request_id") or result.get("request_id") or result.get("id")
327-
if isinstance(result, dict)
328-
else None
329-
)
325+
return_request_id = None
326+
if isinstance(result, dict):
327+
ids = result.get("created_request_ids") or []
328+
return_request_id = ids[0] if ids else result.get("request_id") or result.get("id")
330329
print(f" Return request created: {return_request_id}")
331330
return return_request_id
332331
except MethodExecutionError as e:
@@ -377,21 +376,27 @@ async def demo_batch(sdk, template_id: str, dry_run: bool) -> None:
377376

378377

379378
async def demo_serialization(sdk) -> None:
380-
"""Demonstrate raw_response and format serialization options."""
379+
"""Demonstrate raw_response and format serialization options.
380+
381+
Note: format= and raw_response= only apply to CQRS-discovered methods
382+
(e.g. list_active_requests, get_request). The 14 explicit orchestrator-backed
383+
methods (list_templates, request_machines, etc.) absorb these kwargs silently.
384+
"""
381385
print("\n[7] Serialization options...")
382386
try:
387+
# Use a CQRS-discovered method to demonstrate format= / raw_response=
383388
# JSON string output
384-
json_str = await sdk.list_templates(format="json")
389+
json_str = await sdk.list_active_requests(format="json")
385390
if isinstance(json_str, str):
386391
print(f" format='json' -> str of length {len(json_str)}")
387392

388393
# YAML string output
389-
yaml_str = await sdk.list_templates(format="yaml")
394+
yaml_str = await sdk.list_active_requests(format="yaml")
390395
if isinstance(yaml_str, str):
391396
print(f" format='yaml' -> str of length {len(yaml_str)}")
392397

393398
# Raw handler result — no dict conversion, format= is ignored
394-
raw = await sdk.list_templates(raw_response=True)
399+
raw = await sdk.list_active_requests(raw_response=True)
395400
print(f" raw_response=True -> {type(raw).__name__}")
396401
except MethodExecutionError as e:
397402
print(f" Serialization demo skipped: {e.message}")

0 commit comments

Comments
 (0)