@aws/ml-container-creator 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/parameter-schema-v2.json +2065 -0
- package/package.json +4 -4
- package/servers/lib/catalogs/jumpstart-public.json +101 -16
- package/servers/lib/catalogs/models.json +182 -26
- package/src/app.js +1 -389
- package/src/lib/bootstrap-command-handler.js +75 -1078
- package/src/lib/bootstrap-profile-manager.js +634 -0
- package/src/lib/bootstrap-provisioners.js +421 -0
- package/src/lib/config-loader.js +405 -0
- package/src/lib/config-manager.js +59 -1685
- package/src/lib/config-mcp-client.js +118 -0
- package/src/lib/config-validator.js +634 -0
- package/src/lib/cuda-resolver.js +140 -0
- package/src/lib/e2e-catalog-validator.js +251 -3
- package/src/lib/e2e-ci-recorder.js +103 -0
- package/src/lib/generated/cli-options.js +8 -4
- package/src/lib/generated/parameter-matrix.js +671 -0
- package/src/lib/generated/validation-rules.js +2 -2
- package/src/lib/marketplace-flow.js +276 -0
- package/src/lib/mcp-query-runner.js +768 -0
- package/src/lib/parameter-schema-validator.js +62 -18
- package/src/lib/prompt-runner.js +41 -1504
- package/src/lib/prompts/feature-prompts.js +172 -0
- package/src/lib/prompts/index.js +48 -0
- package/src/lib/prompts/infrastructure-prompts.js +690 -0
- package/src/lib/prompts/model-prompts.js +552 -0
- package/src/lib/prompts/project-prompts.js +70 -0
- package/src/lib/prompts.js +2 -1446
- package/src/lib/registry-command-handler.js +135 -3
- package/src/lib/secrets-prompt-runner.js +251 -0
- package/src/lib/template-variable-resolver.js +398 -0
- package/config/parameter-schema.json +0 -88
|
@@ -18,13 +18,14 @@ import { fileURLToPath } from 'node:url';
|
|
|
18
18
|
const __filename = fileURLToPath(import.meta.url);
|
|
19
19
|
const __dirname = path.dirname(__filename);
|
|
20
20
|
|
|
21
|
-
const BUNDLED_SCHEMA_PATH = path.resolve(__dirname, '..', '..', 'config', 'parameter-schema.json');
|
|
21
|
+
const BUNDLED_SCHEMA_PATH = path.resolve(__dirname, '..', '..', 'config', 'parameter-schema-v2.json');
|
|
22
22
|
|
|
23
|
-
const SUPPORTED_SCHEMA_VERSION = '
|
|
23
|
+
const SUPPORTED_SCHEMA_VERSION = '2.0.0';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Maps ConfigManager parameter keys to schema
|
|
27
|
-
* Format: 'deploymentTarget.
|
|
26
|
+
* Maps ConfigManager parameter keys to their schema paths in parameter-schema-v2.json.
|
|
27
|
+
* Format: 'deploymentTarget.group.shortName' for the old nested schema format.
|
|
28
|
+
* The validator resolves these paths against both old and new schema formats.
|
|
28
29
|
*/
|
|
29
30
|
const PARAMETER_NAME_MAP = {
|
|
30
31
|
endpointInitialInstanceCount: 'realtime-inference.endpoint.initialInstanceCount',
|
|
@@ -38,6 +39,21 @@ const PARAMETER_NAME_MAP = {
|
|
|
38
39
|
icModelWeight: 'realtime-inference.inferenceComponent.modelWeight'
|
|
39
40
|
};
|
|
40
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Maps parameter keys to their AWS API references for error messages.
|
|
44
|
+
*/
|
|
45
|
+
const API_REFERENCE_MAP = {
|
|
46
|
+
endpointInitialInstanceCount: 'CreateEndpointConfig.ProductionVariants.InitialInstanceCount',
|
|
47
|
+
endpointDataCapturePercent: 'CreateEndpointConfig.DataCaptureConfig.InitialSamplingPercentage',
|
|
48
|
+
endpointVariantName: 'CreateEndpointConfig.ProductionVariants.VariantName',
|
|
49
|
+
endpointVolumeSize: 'CreateEndpointConfig.ProductionVariants.VolumeSizeInGB',
|
|
50
|
+
icCpuCount: 'CreateInferenceComponent.Specification.ComputeResourceRequirements.NumberOfCpuCoresRequired',
|
|
51
|
+
icMemorySize: 'CreateInferenceComponent.Specification.ComputeResourceRequirements.MinMemoryRequiredInMb',
|
|
52
|
+
icGpuCount: 'CreateInferenceComponent.Specification.ComputeResourceRequirements.NumberOfAcceleratorDevicesRequired',
|
|
53
|
+
icCopyCount: 'CreateInferenceComponent.RuntimeConfig.CopyCount',
|
|
54
|
+
icModelWeight: 'CreateInferenceComponent.RuntimeConfig.ModelWeight'
|
|
55
|
+
};
|
|
56
|
+
|
|
41
57
|
export default class ParameterSchemaValidator {
|
|
42
58
|
/**
|
|
43
59
|
* @param {string|Object} schemaSource - File path to schema JSON, or schema object override
|
|
@@ -88,15 +104,17 @@ export default class ParameterSchemaValidator {
|
|
|
88
104
|
*/
|
|
89
105
|
_checkSchemaVersion() {
|
|
90
106
|
const version = this.schema && this.schema.schemaVersion;
|
|
91
|
-
if (version && version !== SUPPORTED_SCHEMA_VERSION) {
|
|
92
|
-
console.warn(`Schema version ${version}
|
|
107
|
+
if (version && version !== SUPPORTED_SCHEMA_VERSION && version !== '1.0.0') {
|
|
108
|
+
console.warn(`Schema version ${version} may not be fully compatible with this validator`);
|
|
93
109
|
}
|
|
94
110
|
}
|
|
95
111
|
|
|
96
112
|
/**
|
|
97
113
|
* Resolve a parameter name to its schema constraint object.
|
|
114
|
+
* Supports both the old nested format (deploymentTargets.{target}.{group}.{param})
|
|
115
|
+
* and the new flat format (parameters.{key}).
|
|
98
116
|
* @param {string} parameterName - ConfigManager key (e.g., 'endpointVolumeSize')
|
|
99
|
-
* @param {string} [deploymentTarget] - Deployment target override
|
|
117
|
+
* @param {string} [deploymentTarget] - Deployment target override
|
|
100
118
|
* @returns {Object|null} Constraint object or null if not found
|
|
101
119
|
*/
|
|
102
120
|
_resolveConstraint(parameterName, deploymentTarget) {
|
|
@@ -105,22 +123,48 @@ export default class ParameterSchemaValidator {
|
|
|
105
123
|
return null;
|
|
106
124
|
}
|
|
107
125
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
// Try old nested format first: deploymentTargets.{target}.{group}.{param}
|
|
127
|
+
const deploymentTargets = this.schema && this.schema.deploymentTargets;
|
|
128
|
+
if (deploymentTargets) {
|
|
129
|
+
const parts = schemaPath.split('.');
|
|
130
|
+
const [defaultTarget, group, shortName] = parts;
|
|
131
|
+
const target = deploymentTarget || defaultTarget;
|
|
112
132
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
133
|
+
const targetObj = deploymentTargets[target];
|
|
134
|
+
if (targetObj && targetObj[group] && targetObj[group][shortName]) {
|
|
135
|
+
const constraint = targetObj[group][shortName];
|
|
136
|
+
return {
|
|
137
|
+
type: constraint.type,
|
|
138
|
+
min: constraint.min,
|
|
139
|
+
max: constraint.max,
|
|
140
|
+
pattern: constraint.pattern,
|
|
141
|
+
default: constraint.default,
|
|
142
|
+
description: constraint.description,
|
|
143
|
+
apiReference: constraint.apiReference || API_REFERENCE_MAP[parameterName] || `parameter-schema-v2.json#${parameterName}`
|
|
144
|
+
};
|
|
145
|
+
}
|
|
116
146
|
}
|
|
117
147
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
148
|
+
// Try new flat format: parameters.{key}
|
|
149
|
+
const params = this.schema && this.schema.parameters;
|
|
150
|
+
if (params && params[parameterName]) {
|
|
151
|
+
const param = params[parameterName];
|
|
152
|
+
if (!param.validation || Object.keys(param.validation).length === 0) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
type: param.type,
|
|
158
|
+
min: param.validation.min,
|
|
159
|
+
max: param.validation.max,
|
|
160
|
+
pattern: param.validation.pattern,
|
|
161
|
+
default: param.default,
|
|
162
|
+
description: param.description,
|
|
163
|
+
apiReference: API_REFERENCE_MAP[parameterName] || `parameter-schema-v2.json#${parameterName}`
|
|
164
|
+
};
|
|
121
165
|
}
|
|
122
166
|
|
|
123
|
-
return
|
|
167
|
+
return null;
|
|
124
168
|
}
|
|
125
169
|
|
|
126
170
|
/**
|