@zhuoyuezs/ml-platform 0.1.8 → 0.1.10
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/README.md +7 -3
- package/package.json +1 -1
- package/checksums.json +0 -155
- package/release.json +0 -52
- package/runtime/business-client/README.md +0 -78
- package/runtime/business-client/package-lock.json +0 -19
- package/runtime/business-client/package.json +0 -23
- package/runtime/business-client/src/catalog.js +0 -206
- package/runtime/business-client/src/cli.js +0 -533
- package/runtime/business-client/src/config.js +0 -56
- package/runtime/business-client/src/http.js +0 -254
- package/skills/feature-management/SKILL.md +0 -479
- package/skills/feature-management/agents/openai.yaml +0 -4
- package/skills/feature-management/assets/catalog-template/catalog.json +0 -23
- package/skills/feature-management/assets/catalog-template/datasets/example_temperature_training.v1.json +0 -40
- package/skills/feature-management/assets/catalog-template/feature_sets/example_temperature_core.v1.json +0 -14
- package/skills/feature-management/assets/catalog-template/features/example_temperature_mean_5m.v1.json +0 -28
- package/skills/feature-management/assets/catalog-template/operator_package/pyproject.toml +0 -12
- package/skills/feature-management/assets/catalog-template/operator_package/src/business_feature_operator_template/__init__.py +0 -39
- package/skills/feature-management/assets/catalog-template/operator_package/tests/test_operator.py +0 -83
- package/skills/feature-management/assets/catalog-template/operators/example_temperature_features.v1.json +0 -58
- package/skills/feature-management/assets/catalog-template/parameters/example_temperature.v1.json +0 -58
- package/skills/feature-management/references/commands.md +0 -358
- package/skills/feature-management/references/contracts.md +0 -719
- package/skills/feature-management/references/operator-authoring.md +0 -175
- package/skills/feature-management/references/platform-capability-guide.md +0 -75
- package/skills/feature-management/references/supervised-datasets.md +0 -101
- package/skills/model-lifecycle-management/SKILL.md +0 -38
- package/skills/model-lifecycle-management/agents/openai.yaml +0 -4
- package/skills/model-lifecycle-management/references/discovery.md +0 -89
- package/skills/model-lifecycle-management/references/evaluation.md +0 -172
- package/skills/model-lifecycle-management/references/packaging.md +0 -51
- package/skills/model-lifecycle-management/references/training-contracts.md +0 -139
- package/skills/model-lifecycle-management/references/training.md +0 -81
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# Model Packaging Commands
|
|
2
|
-
|
|
3
|
-
## Request shape and managed runtime
|
|
4
|
-
|
|
5
|
-
```json
|
|
6
|
-
{
|
|
7
|
-
"model_artifact_id": "replace_registered_model_artifact_id",
|
|
8
|
-
"package_version": "1.0.0",
|
|
9
|
-
"input_modes": ["inline"]
|
|
10
|
-
}
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
The artifact must be `REGISTERED` and pass validation. Creation submits work;
|
|
14
|
-
first use `validate-model-package` for read-only contract/runtime preflight. Version defaults to `1` if omitted;
|
|
15
|
-
use an explicit immutable version (semantic versioning is a convention, not an
|
|
16
|
-
enforced three-component schema). Capture `package.package_id` and
|
|
17
|
-
`package.package_version` from the creation response.
|
|
18
|
-
|
|
19
|
-
The server resolves images and destination from the approved trainer/device
|
|
20
|
-
runtime configuration. Optional request keys `base_image`, `worker_image`,
|
|
21
|
-
`builder_image`, `destination_repository` are equality assertions against that
|
|
22
|
-
configuration, not arbitrary overrides. Omit them when using managed defaults;
|
|
23
|
-
do not guess registries or pass deployment secrets. A mismatch needs the approved
|
|
24
|
-
runtime contract, not repeated package versions. Unknown request keys return 422; do not add `runtime`, `image`, or `resources`
|
|
25
|
-
fields. Inspect the returned resolved package.
|
|
26
|
-
|
|
27
|
-
`input_modes` must be unique, include `inline`, and may additionally include
|
|
28
|
-
`feature_lookup` only when supported by the selected runtime and artifact lineage
|
|
29
|
-
has `online_eligible=true`. Do not infer online eligibility from training success.
|
|
30
|
-
Omit rather than use an empty list to request default inline behavior.
|
|
31
|
-
|
|
32
|
-
Always query the exact package ID and version; states are `PACKAGING`, `READY`,
|
|
33
|
-
`FAILED`, `CANCELLED`. A client timeout does not prove packaging failed. Retain the
|
|
34
|
-
known identity and query it before attempting another creation.
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
ml-platform --profile server validate-model-artifact <artifact-id>
|
|
38
|
-
ml-platform --profile server validate-model-package model-package-request.json
|
|
39
|
-
ml-platform --profile server create-model-package model-package-request.json
|
|
40
|
-
ml-platform --profile server get-model-package <package-id> --package-version <version>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Confirm the ModelArtifact, signature, runtime, immutable base/builder/worker image digests, input modes, semantic package version, and destination repository. Creation submits a workload and needs separate authorization. Never put registry credentials in JSON.
|
|
44
|
-
|
|
45
|
-
A deliverable package is `READY` and includes its remote image digest, immutable reference, manifest, signature and adapter hashes, runtime capabilities, and a passing test report for the same digest. Other states are not deliverable.
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
ml-platform --profile server cancel-model-package <package-id> --package-version <version>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Cancellation requires exact-package authorization. Do not rebuild an immutable failed version; correct inputs and create a new semantic package version. This Skill does not deploy images or write model-center delivery status.
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# Training request and response contracts
|
|
2
|
-
|
|
3
|
-
These examples require only the released CLI, inspected registry definitions and
|
|
4
|
-
downloaded dataset contracts. Replace example identities and business choices;
|
|
5
|
-
they are not a ready-to-submit trainer recommendation. Never import platform
|
|
6
|
-
Python modules or require a checkout to author these requests.
|
|
7
|
-
|
|
8
|
-
## TrainingRunSpec
|
|
9
|
-
|
|
10
|
-
Example forecasting sequence run:
|
|
11
|
-
|
|
12
|
-
```json
|
|
13
|
-
{
|
|
14
|
-
"schema_version": "ml_data_platform.training_run/v2",
|
|
15
|
-
"run_id": "pressure_forecast_run_01",
|
|
16
|
-
"experiment": "pressure_forecast",
|
|
17
|
-
"task": {"kind": "forecasting", "objective": "regression"},
|
|
18
|
-
"data": {
|
|
19
|
-
"artifact": {
|
|
20
|
-
"project": "default", "dataset_id": "pressure_dataset",
|
|
21
|
-
"manifest_hash": "REPLACE_WITH_RETURNED_MANIFEST_HASH"
|
|
22
|
-
},
|
|
23
|
-
"features": {"feature_set": {
|
|
24
|
-
"project": "default", "name": "pressure_features", "version": "v1"
|
|
25
|
-
}},
|
|
26
|
-
"labels": ["future_pressure"],
|
|
27
|
-
"temporal": {
|
|
28
|
-
"prediction_time_column": "event_time", "label_time_column": "label_time",
|
|
29
|
-
"frequency": "5min", "horizon": "5min", "series_keys": []
|
|
30
|
-
},
|
|
31
|
-
"splits": {
|
|
32
|
-
"assignment_column": "rowset_split", "train": ["training"],
|
|
33
|
-
"validation": ["validation"], "test": ["test"]
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"input_adapter": {
|
|
37
|
-
"kind": "sequence", "context_length": 24,
|
|
38
|
-
"context_end": "prediction_time_inclusive", "frequency": "5min",
|
|
39
|
-
"stride": 1, "gap_policy": "reject", "padding_policy": "none"
|
|
40
|
-
},
|
|
41
|
-
"label_transform": {"name": "identity", "version": "v1"},
|
|
42
|
-
"trainer": {
|
|
43
|
-
"project": "default", "name": "replace_approved_trainer", "version": "v1",
|
|
44
|
-
"parameters": {}
|
|
45
|
-
},
|
|
46
|
-
"reproducibility": {"seed": 0, "deterministic": true},
|
|
47
|
-
"evaluation": {"split": "validation", "metrics": ["mae", "rmse", "r2"]}
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
`task.kind`, objective and input kind must match inspected TrainerCapabilities.
|
|
52
|
-
`trainer.parameters` must satisfy the definition's parameter schema; `{}` only
|
|
53
|
-
works if no parameters are required. Resource/device settings belong to the Job,
|
|
54
|
-
not the Run. `run_id` is the immutable run identity, not a name/version pair.
|
|
55
|
-
Do not add guessed `version`, `model`, `dataset` or `hyperparameters` top-level keys.
|
|
56
|
-
|
|
57
|
-
For tabular input use `input_adapter: {"kind":"tabular"}`; omit sequence context
|
|
58
|
-
fields. Forecasting tasks still require `data.temporal`, even with tabular input.
|
|
59
|
-
Non-temporal regression can omit it. Do not change task kind just to evade checks.
|
|
60
|
-
`series_keys` must identify entity-key columns when multiple series coexist;
|
|
61
|
-
an empty list treats the entire artifact as one series.
|
|
62
|
-
|
|
63
|
-
Inspect `data_schema.json`, `resolved_manifest.json` and the feature Parquet via
|
|
64
|
-
`download-dataset-artifact DATASET_ID MANIFEST_HASH --project PROJECT --out-dir DIR`
|
|
65
|
-
(repeat `--file` for selective downloads). The FeatureSet reference must match
|
|
66
|
-
the artifact; the full ordered FeatureSet determines model channels. There is
|
|
67
|
-
no documented `data.features.columns` shortcut for choosing a subset.
|
|
68
|
-
|
|
69
|
-
`identity:v1` leaves labels unchanged. `difference` requires a baseline Feature
|
|
70
|
-
in `required_inputs` and at least one `online_inputs` entry, which must be a
|
|
71
|
-
subset; it must have an inverse. Do not use target transforms to fix incorrect
|
|
72
|
-
dataset label clocks or to invent unsupported transforms.
|
|
73
|
-
|
|
74
|
-
## TrainingJobRequest and identity propagation
|
|
75
|
-
|
|
76
|
-
After validation and authorized registration, use the returned `spec_hash`
|
|
77
|
-
unchanged in the Job request. Do not calculate it from raw JSON bytes.
|
|
78
|
-
|
|
79
|
-
```json
|
|
80
|
-
{
|
|
81
|
-
"run": {
|
|
82
|
-
"run_id": "pressure_forecast_run_01",
|
|
83
|
-
"spec_hash": "REPLACE_WITH_REGISTERED_SPEC_HASH"
|
|
84
|
-
},
|
|
85
|
-
"execution": {
|
|
86
|
-
"executor": "kubernetes", "device": "cpu",
|
|
87
|
-
"resources": {"cpu": "2", "memory": "4Gi"},
|
|
88
|
-
"deadline": "90min", "retry_limit": 0
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Sizing is illustrative. `spec_hash` uses `sha256:<64 hex>`. Omit `output_uri`
|
|
94
|
-
to use managed storage unless an approved contract supplies it. Runtime device
|
|
95
|
-
approval occurs during Job resolution; `validate-training-run` has no execution
|
|
96
|
-
device and cannot prove device approval. Use `validate-training-job` after Run registration to validate device and
|
|
97
|
-
execution settings without creating a Job.
|
|
98
|
-
|
|
99
|
-
| Command | Fields to retain / inspect |
|
|
100
|
-
| --- | --- |
|
|
101
|
-
| `validate-training-run` | `status=valid`, `spec_hash`, `data_schema_hash`, `feature_columns`, `label_columns` |
|
|
102
|
-
| `register-training-run` | `training_run.run_id`, top-level `spec_hash`; response `status=validated` also represents registration, not mere dry-run |
|
|
103
|
-
| `submit-training-job` | `job_spec.job_id`, `job_spec.job_spec_hash`, `job.phase`; top-level `status=accepted` is not completion |
|
|
104
|
-
| `get-training-job` | `spec` and `status`; inspect `status.phase`, then successful `status.artifact_id` |
|
|
105
|
-
| `validate-model-artifact` | Validation evidence for the exact returned artifact ID; Job success alone is insufficient |
|
|
106
|
-
|
|
107
|
-
Use `get-training-run`, `get-model-artifact` and their list commands to recover
|
|
108
|
-
identities; see [discovery.md](discovery.md). There is no training wait command.
|
|
109
|
-
Preserve the original Run JSON and IDs.
|
|
110
|
-
Poll `get-training-job` at a bounded interval (for example 15 seconds) with a
|
|
111
|
-
user-appropriate deadline; a polling timeout does not cancel or fail the Job.
|
|
112
|
-
After a submission timeout, retain the request and reconcile any known Job ID
|
|
113
|
-
before retrying. Never create a new run merely because the HTTP response was lost.
|
|
114
|
-
|
|
115
|
-
## Sequence population semantics
|
|
116
|
-
|
|
117
|
-
Context step is `frequency * stride`. Stride spaces context observations; it
|
|
118
|
-
does not select every Nth target endpoint. Inclusive context with length L covers
|
|
119
|
-
offsets `(L-1)..0`; exclusive covers `L..1`. For 24 points, 5min frequency and
|
|
120
|
-
stride 1, inclusive context starts 115min before the cutoff, exclusive 120min.
|
|
121
|
-
Keep Operator source history and endpoint-policy lookback as separate contracts.
|
|
122
|
-
|
|
123
|
-
The adapter materializes history over the full series, then assigns samples by
|
|
124
|
-
the target endpoint's split. Test endpoints may use causal Feature history from
|
|
125
|
-
earlier splits; splitting does not truncate their context. Duplicate timestamps
|
|
126
|
-
within a series are invalid. Missing early context with no padding is skipped;
|
|
127
|
-
null Features or labels also skip samples. Candidate row counts therefore are
|
|
128
|
-
not training/evaluation sample counts. Report the materialized population and
|
|
129
|
-
coverage instead of assuming all Parquet rows were used.
|
|
130
|
-
|
|
131
|
-
`gap_policy=fill` requires `padding_policy=edge` or `zero`; non-fill requires
|
|
132
|
-
`padding_policy=none`. Filling changes model inputs and needs an intended
|
|
133
|
-
business policy. `skip` and padding are not automatic fixes for rejected grids.
|
|
134
|
-
|
|
135
|
-
Training's `evaluation.metrics` uses `mae`, `rmse`, `r2`. Independent governed
|
|
136
|
-
EvaluationConfig uses versioned names such as `regression.mae`. They are different
|
|
137
|
-
contracts. Training `evaluation.split=auto` prefers nonempty test, then validation,
|
|
138
|
-
then train; choose an explicit split when reserving the test set for final review.
|
|
139
|
-
Training metrics are not a governed EvaluationResult or release gate pass.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# Training Commands
|
|
2
|
-
|
|
3
|
-
## Preflight before expensive training
|
|
4
|
-
|
|
5
|
-
Settle the final DataSchema (including split/metadata and label/time columns),
|
|
6
|
-
FeatureSet order and evaluation runtime before the first Job. See
|
|
7
|
-
[evaluation.md](evaluation.md) for inherited split bindings and runtime failures.
|
|
8
|
-
|
|
9
|
-
- Inspect exact TrainerDefinition `project/name:v1`, entrypoint, image digest,
|
|
10
|
-
capabilities and parameter schema. Similar names in different projects are
|
|
11
|
-
distinct identities; registration does not imply runtime approval.
|
|
12
|
-
- Match definition and device to the active runtime release. On `not approved
|
|
13
|
-
for device`, preserve the rejected identity, device and release ID. Use `get-model-runtime-release` to find the
|
|
14
|
-
approved binding; if the deployed release lacks discovery, request its contract;
|
|
15
|
-
do not try similar names or re-register trainers to bypass approval.
|
|
16
|
-
- The current platform Chronos2Plugin requires `[sample, context, 1]`, exactly
|
|
17
|
-
one channel. This is a platform adapter restriction, not a universal statement
|
|
18
|
-
about Chronos-2. Six-feature sequences are incompatible. Do not silently drop
|
|
19
|
-
business inputs: select a suitable trainer or agree a univariate contract.
|
|
20
|
-
- Keep labels outside FeatureSet order, verify temporal horizon against
|
|
21
|
-
`label_time - prediction_time`, and validate the complete TrainingRun before
|
|
22
|
-
registration/submission. Validation may not catch undeclared plugin limits or
|
|
23
|
-
missing dependencies in the eventual Worker.
|
|
24
|
-
|
|
25
|
-
Merge this fragment under TrainingRun `data`, alongside `artifact`, `features`,
|
|
26
|
-
`labels` and the applicable `temporal` binding:
|
|
27
|
-
|
|
28
|
-
```json
|
|
29
|
-
{
|
|
30
|
-
"splits": {
|
|
31
|
-
"assignment_column": "rowset_split",
|
|
32
|
-
"train": ["training"],
|
|
33
|
-
"validation": ["validation"],
|
|
34
|
-
"test": ["test"]
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
`train` is the consumer role; `training` is an example observed artifact value.
|
|
40
|
-
Use the actual assignment values. Evaluation inherits this original binding;
|
|
41
|
-
it does not reconstruct it from manifest `rowset_splits`. Save the submitted
|
|
42
|
-
TrainingRun JSON, validation output, Job ID and ModelArtifact ID in the user's
|
|
43
|
-
working directory so later diagnosis needs no source repository.
|
|
44
|
-
|
|
45
|
-
## Commands
|
|
46
|
-
|
|
47
|
-
Read [training-contracts.md](training-contracts.md) when authoring a Run or Job
|
|
48
|
-
JSON. It provides complete request shapes, response paths and sequence semantics.
|
|
49
|
-
|
|
50
|
-
Discover already-registered TrainerDefinitions (read-only) before authoring a
|
|
51
|
-
TrainingRunSpec or deciding whether registration is needed:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
ml-platform --profile server list-trainer-definitions
|
|
55
|
-
ml-platform --profile server get-trainer-definition <name> <version> [--project default]
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
`get-trainer-definition` returns the entrypoint, immutable training image digest,
|
|
59
|
-
`artifact_format`, `model_file`, capabilities, and parameter schema. Use it to confirm
|
|
60
|
-
the referenced `v1` definition exists and its image digest matches the approved runtime
|
|
61
|
-
release; discovery never mutates the registry. Registering a new definition is the
|
|
62
|
-
separate mutation below, and a 404 means the definition (not the model plugin) is missing.
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
ml-platform --profile server register-trainer trainer-definition.json
|
|
66
|
-
ml-platform --profile server validate-training-run training-run.json
|
|
67
|
-
ml-platform --profile server register-training-run training-run.json
|
|
68
|
-
ml-platform --profile server validate-training-job training-job-request.json
|
|
69
|
-
ml-platform --profile server submit-training-job training-job-request.json
|
|
70
|
-
ml-platform --profile server get-training-job <job-id>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
The TrainingRun binds immutable DatasetArtifact identities, DataSchema, ordered inputs, targets, InputAdapter, TrainerDefinition `v1`, reproducibility controls, and runtime identity. Validation proves compatibility only. Submit the run and Job separately after authorization and record spec hash and Job ID. Terminal success must expose a ModelArtifact ID; validate it before evaluation or packaging.
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
ml-platform --profile server validate-model-artifact <artifact-id>
|
|
77
|
-
ml-platform --profile server retry-training-job <job-id>
|
|
78
|
-
ml-platform --profile server cancel-training-job <job-id>
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Retry and cancellation require exact-Job authorization. Never change a run contract while retrying; create a new immutable run when semantic inputs change.
|