Skip to content

Commit c68b9d7

Browse files
committed
fix: add format field to integration test packageOptions and regenerate docs
The --format flag was added to the package command but: 1. Integration tests constructed packageOptions directly without setting format, causing validation to fail with 'invalid --format value ""' 2. Reference docs were not regenerated after adding the new flag Set format: "docker" in all three test packageOptions structs and regenerate docs with 'make docs'.
1 parent 40aa227 commit c68b9d7

3 files changed

Lines changed: 26 additions & 11 deletions

File tree

cmd/cli/commands/integration_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,7 @@ func TestIntegration_PackageModel(t *testing.T) {
10541054
opts := packageOptions{
10551055
ggufPath: absPath,
10561056
tag: targetTag,
1057+
format: "docker",
10571058
}
10581059

10591060
// Execute the package command using the helper function with test client
@@ -1089,6 +1090,7 @@ func TestIntegration_PackageModel(t *testing.T) {
10891090
ggufPath: absPath,
10901091
tag: targetTag,
10911092
contextSize: 4096,
1093+
format: "docker",
10921094
}
10931095

10941096
// Create a command for context
@@ -1121,6 +1123,7 @@ func TestIntegration_PackageModel(t *testing.T) {
11211123
opts := packageOptions{
11221124
ggufPath: absPath,
11231125
tag: targetTag,
1126+
format: "docker",
11241127
}
11251128

11261129
// Create a command for context

cmd/cli/docs/reference/docker_model_package.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ options:
7171
experimentalcli: false
7272
kubernetes: false
7373
swarm: false
74+
- option: format
75+
value_type: string
76+
default_value: docker
77+
description: |
78+
output artifact format: "docker" (default) or "cncf" (CNCF ModelPack spec)
79+
deprecated: false
80+
hidden: false
81+
experimental: false
82+
experimentalcli: false
83+
kubernetes: false
84+
swarm: false
7485
- option: from
7586
value_type: string
7687
description: reference to an existing model to repackage

cmd/cli/docs/reference/model_package.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,18 @@ Packaging behavior:
4242

4343
### Options
4444

45-
| Name | Type | Default | Description |
46-
|:--------------------|:--------------|:--------|:---------------------------------------------------------------------------------------|
47-
| `--chat-template` | `string` | | absolute path to chat template file (must be Jinja format) |
48-
| `--context-size` | `uint64` | `0` | context size in tokens |
49-
| `--dduf` | `string` | | absolute path to DDUF archive file (Diffusers Unified Format) |
50-
| `--from` | `string` | | reference to an existing model to repackage |
51-
| `--gguf` | `string` | | absolute path to gguf file |
52-
| `-l`, `--license` | `stringArray` | | absolute path to a license file |
53-
| `--mmproj` | `string` | | absolute path to multimodal projector file |
54-
| `--push` | `bool` | | push to registry (if not set, the model is loaded into the Model Runner content store) |
55-
| `--safetensors-dir` | `string` | | absolute path to directory containing safetensors files and config |
45+
| Name | Type | Default | Description |
46+
|:--------------------|:--------------|:---------|:---------------------------------------------------------------------------------------|
47+
| `--chat-template` | `string` | | absolute path to chat template file (must be Jinja format) |
48+
| `--context-size` | `uint64` | `0` | context size in tokens |
49+
| `--dduf` | `string` | | absolute path to DDUF archive file (Diffusers Unified Format) |
50+
| `--format` | `string` | `docker` | output artifact format: "docker" (default) or "cncf" (CNCF ModelPack spec) |
51+
| `--from` | `string` | | reference to an existing model to repackage |
52+
| `--gguf` | `string` | | absolute path to gguf file |
53+
| `-l`, `--license` | `stringArray` | | absolute path to a license file |
54+
| `--mmproj` | `string` | | absolute path to multimodal projector file |
55+
| `--push` | `bool` | | push to registry (if not set, the model is loaded into the Model Runner content store) |
56+
| `--safetensors-dir` | `string` | | absolute path to directory containing safetensors files and config |
5657

5758

5859
<!---MARKER_GEN_END-->

0 commit comments

Comments
 (0)