Skip to content

Commit 3609fd7

Browse files
authored
Merge pull request #509 from docker/dependabot/go_modules/cmd/cli/go-modules-cli-6da54486f1
chore(deps): bump the go-modules-cli group across 1 directory with 13 updates
2 parents 536b0b4 + 8914508 commit 3609fd7

File tree

11 files changed

+173
-248
lines changed

11 files changed

+173
-248
lines changed

cmd/cli/commands/df.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/docker/go-units"
77
"github.com/docker/model-runner/cmd/cli/commands/completion"
88
"github.com/docker/model-runner/cmd/cli/desktop"
9-
"github.com/olekukonko/tablewriter"
109
"github.com/spf13/cobra"
1110
)
1211

@@ -29,21 +28,8 @@ func newDFCmd() *cobra.Command {
2928

3029
func diskUsageTable(df desktop.DiskUsage) string {
3130
var buf bytes.Buffer
32-
table := tablewriter.NewWriter(&buf)
33-
34-
table.SetHeader([]string{"TYPE", "SIZE"})
35-
36-
table.SetBorder(false)
37-
table.SetColumnSeparator("")
38-
table.SetHeaderLine(false)
39-
table.SetTablePadding(" ")
40-
table.SetNoWhiteSpace(true)
41-
42-
table.SetColumnAlignment([]int{
43-
tablewriter.ALIGN_LEFT, // TYPE
44-
tablewriter.ALIGN_LEFT, // SIZE
45-
})
46-
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
31+
table := newTable(&buf)
32+
table.Header([]string{"TYPE", "SIZE"})
4733

4834
table.Append([]string{"Models", units.CustomSize("%.2f%s", float64(df.ModelsDiskUsage), 1000.0, []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"})})
4935
if df.DefaultBackendDiskUsage != 0 {

cmd/cli/commands/list.go

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -197,27 +197,8 @@ func prettyPrintModels(models []dmrm.Model) string {
197197
})
198198

199199
var buf bytes.Buffer
200-
table := tablewriter.NewWriter(&buf)
201-
202-
table.SetHeader([]string{"MODEL NAME", "PARAMETERS", "QUANTIZATION", "ARCHITECTURE", "MODEL ID", "CREATED", "CONTEXT", "SIZE"})
203-
204-
table.SetBorder(false)
205-
table.SetColumnSeparator("")
206-
table.SetHeaderLine(false)
207-
table.SetTablePadding(" ")
208-
table.SetNoWhiteSpace(true)
209-
210-
table.SetColumnAlignment([]int{
211-
tablewriter.ALIGN_LEFT, // MODEL
212-
tablewriter.ALIGN_LEFT, // PARAMETERS
213-
tablewriter.ALIGN_LEFT, // QUANTIZATION
214-
tablewriter.ALIGN_LEFT, // ARCHITECTURE
215-
tablewriter.ALIGN_LEFT, // MODEL ID
216-
tablewriter.ALIGN_LEFT, // CREATED
217-
tablewriter.ALIGN_RIGHT, // CONTEXT
218-
tablewriter.ALIGN_LEFT, // SIZE
219-
})
220-
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
200+
table := newTable(&buf)
201+
table.Header([]string{"MODEL NAME", "PARAMETERS", "QUANTIZATION", "ARCHITECTURE", "MODEL ID", "CREATED", "CONTEXT", "SIZE"})
221202

222203
for _, row := range rows {
223204
appendRow(table, row.tag, row.model)

cmd/cli/commands/ps.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/docker/go-units"
99
"github.com/docker/model-runner/cmd/cli/commands/completion"
1010
"github.com/docker/model-runner/cmd/cli/desktop"
11-
"github.com/olekukonko/tablewriter"
1211
"github.com/spf13/cobra"
1312
)
1413

@@ -31,23 +30,8 @@ func newPSCmd() *cobra.Command {
3130

3231
func psTable(ps []desktop.BackendStatus) string {
3332
var buf bytes.Buffer
34-
table := tablewriter.NewWriter(&buf)
35-
36-
table.SetHeader([]string{"MODEL NAME", "BACKEND", "MODE", "LAST USED"})
37-
38-
table.SetBorder(false)
39-
table.SetColumnSeparator("")
40-
table.SetHeaderLine(false)
41-
table.SetTablePadding(" ")
42-
table.SetNoWhiteSpace(true)
43-
44-
table.SetColumnAlignment([]int{
45-
tablewriter.ALIGN_LEFT, // MODEL
46-
tablewriter.ALIGN_LEFT, // BACKEND
47-
tablewriter.ALIGN_LEFT, // MODE
48-
tablewriter.ALIGN_LEFT, // LAST USED
49-
})
50-
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
33+
table := newTable(&buf)
34+
table.Header([]string{"MODEL NAME", "BACKEND", "MODE", "LAST USED"})
5135

5236
for _, status := range ps {
5337
modelName := status.ModelName

cmd/cli/commands/utils.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"errors"
66
"fmt"
7+
"io"
78
"os"
89
"strings"
910

@@ -13,6 +14,9 @@ import (
1314
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/name"
1415
"github.com/docker/model-runner/pkg/inference/backends/vllm"
1516
"github.com/moby/term"
17+
"github.com/olekukonko/tablewriter"
18+
"github.com/olekukonko/tablewriter/renderer"
19+
"github.com/olekukonko/tablewriter/tw"
1620
"github.com/spf13/cobra"
1721
)
1822

@@ -218,3 +222,34 @@ func addRunnerFlags(cmd *cobra.Command, opts runnerFlagOptions) {
218222
cmd.Flags().StringVar(opts.ProxyCert, "proxy-cert", "", "Path to a CA certificate file for proxy SSL inspection")
219223
}
220224
}
225+
226+
// newTable creates a new table with Docker CLI-style formatting:
227+
// no borders, no column separators, no header line, left-aligned, and 2-space padding.
228+
func newTable(w io.Writer) *tablewriter.Table {
229+
return tablewriter.NewTable(w,
230+
tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{
231+
Borders: tw.BorderNone,
232+
Settings: tw.Settings{
233+
Separators: tw.Separators{
234+
BetweenColumns: tw.Off,
235+
},
236+
Lines: tw.Lines{
237+
ShowHeaderLine: tw.Off,
238+
},
239+
},
240+
})),
241+
tablewriter.WithConfig(tablewriter.Config{
242+
Header: tw.CellConfig{
243+
Formatting: tw.CellFormatting{
244+
AutoFormat: tw.Off,
245+
},
246+
Alignment: tw.CellAlignment{Global: tw.AlignLeft},
247+
Padding: tw.CellPadding{Global: tw.Padding{Left: "", Right: " "}},
248+
},
249+
Row: tw.CellConfig{
250+
Alignment: tw.CellAlignment{Global: tw.AlignLeft},
251+
Padding: tw.CellPadding{Global: tw.Padding{Left: "", Right: " "}},
252+
},
253+
}),
254+
)
255+
}

cmd/cli/desktop/context.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ import (
1919
"github.com/docker/model-runner/cmd/cli/pkg/standalone"
2020
"github.com/docker/model-runner/cmd/cli/pkg/types"
2121
"github.com/docker/model-runner/pkg/inference"
22+
"github.com/moby/moby/client"
2223
)
2324

2425
// isDesktopContext returns true if the CLI instance points to a Docker Desktop
2526
// context and false otherwise.
2627
func isDesktopContext(ctx context.Context, cli *command.DockerCli) bool {
2728
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
2829
defer cancel()
29-
serverInfo, _ := cli.Client().Info(ctx)
30+
serverInfo, _ := cli.Client().Info(ctx, client.InfoOptions{})
3031

3132
// We don't currently support Docker Model Runner in Docker Desktop for
3233
// Linux, so we won't treat that as a Docker Desktop case (though it will
@@ -44,16 +45,16 @@ func isDesktopContext(ctx context.Context, cli *command.DockerCli) bool {
4445
}
4546

4647
// docker run -it --rm --privileged --pid=host justincormack/nsenter1 /bin/sh -c 'cat /etc/os-release'
47-
return serverInfo.OperatingSystem == "Docker Desktop"
48+
return serverInfo.Info.OperatingSystem == "Docker Desktop"
4849
}
4950

5051
func IsDesktopWSLContext(ctx context.Context, cli *command.DockerCli) bool {
5152
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
5253
defer cancel()
53-
serverInfo, _ := cli.Client().Info(ctx)
54+
serverInfo, _ := cli.Client().Info(ctx, client.InfoOptions{})
5455

55-
return strings.Contains(serverInfo.KernelVersion, "-microsoft-standard-WSL2") &&
56-
serverInfo.OperatingSystem == "Docker Desktop"
56+
return strings.Contains(serverInfo.Info.KernelVersion, "-microsoft-standard-WSL2") &&
57+
serverInfo.Info.OperatingSystem == "Docker Desktop"
5758
}
5859

5960
// isCloudContext returns true if the CLI instance points to a Docker Cloud
@@ -138,14 +139,14 @@ func wakeUpCloudIfIdle(ctx context.Context, cli *command.DockerCli) error {
138139
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
139140
defer cancel()
140141

141-
info, err := cli.Client().Info(ctx)
142+
info, err := cli.Client().Info(ctx, client.InfoOptions{})
142143
if err != nil {
143144
return fmt.Errorf("failed to get Docker info: %w", err)
144145
}
145146

146147
// Check if the cloud.docker.run.engine label is set to "idle".
147148
isIdle := false
148-
for _, label := range info.Labels {
149+
for _, label := range info.Info.Labels {
149150
if label == "cloud.docker.run.engine=idle" {
150151
isIdle = true
151152
break
@@ -170,12 +171,12 @@ func wakeUpCloudIfIdle(ctx context.Context, cli *command.DockerCli) error {
170171
}
171172

172173
// Verify Docker Cloud is no longer idle.
173-
info, err = cli.Client().Info(ctx)
174+
info, err = cli.Client().Info(ctx, client.InfoOptions{})
174175
if err != nil {
175176
return fmt.Errorf("failed to verify Docker Cloud wake-up: %w", err)
176177
}
177178

178-
for _, label := range info.Labels {
179+
for _, label := range info.Info.Labels {
179180
if label == "cloud.docker.run.engine=idle" {
180181
return fmt.Errorf("failed to wake up Docker Cloud from idle state")
181182
}

cmd/cli/go.mod

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@ go 1.24.0
55
require (
66
github.com/charmbracelet/glamour v0.10.0
77
github.com/containerd/errdefs v1.0.0
8-
github.com/docker/cli v28.3.0+incompatible
9-
github.com/docker/cli-docs-tool v0.10.0
10-
github.com/docker/docker v28.3.3+incompatible
8+
github.com/docker/cli v29.1.3+incompatible
9+
github.com/docker/cli-docs-tool v0.11.0
10+
github.com/docker/docker v28.5.2+incompatible
1111
github.com/docker/go-connections v0.6.0
1212
github.com/docker/go-units v0.5.0
13-
github.com/docker/model-runner v1.0.3
13+
github.com/docker/model-runner v1.0.10
1414
github.com/docker/model-runner/pkg/go-containerregistry v0.0.0-20251121150728-6951a2a36575
1515
github.com/emirpasic/gods/v2 v2.0.0-alpha
1616
github.com/fatih/color v1.18.0
17-
github.com/mattn/go-runewidth v0.0.16
17+
github.com/mattn/go-runewidth v0.0.19
18+
github.com/moby/moby/client v0.2.1
1819
github.com/moby/term v0.5.2
1920
github.com/muesli/termenv v0.16.0
20-
github.com/nxadm/tail v1.4.8
21-
github.com/olekukonko/tablewriter v0.0.5
21+
github.com/nxadm/tail v1.4.11
22+
github.com/olekukonko/tablewriter v1.1.2
2223
github.com/pkg/errors v0.9.1
23-
github.com/spf13/cobra v1.10.1
24-
github.com/spf13/pflag v1.0.9
24+
github.com/spf13/cobra v1.10.2
25+
github.com/spf13/pflag v1.0.10
2526
github.com/stretchr/testify v1.11.1
26-
github.com/testcontainers/testcontainers-go v0.39.0
27-
github.com/testcontainers/testcontainers-go/modules/registry v0.39.0
28-
go.opentelemetry.io/otel v1.37.0
29-
go.uber.org/mock v0.5.0
27+
github.com/testcontainers/testcontainers-go v0.40.0
28+
github.com/testcontainers/testcontainers-go/modules/registry v0.40.0
29+
go.opentelemetry.io/otel v1.39.0
30+
go.uber.org/mock v0.6.0
3031
golang.org/x/sync v0.19.0
3132
golang.org/x/sys v0.39.0
3233
golang.org/x/term v0.38.0
@@ -40,12 +41,16 @@ require (
4041
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
4142
github.com/aymerick/douceur v0.2.0 // indirect
4243
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
44+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4345
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
4446
github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 // indirect
4547
github.com/charmbracelet/x/ansi v0.8.0 // indirect
4648
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
4749
github.com/charmbracelet/x/exp/slice v0.0.0-20250327172914-2fdc97757edf // indirect
4850
github.com/charmbracelet/x/term v0.2.1 // indirect
51+
github.com/clipperhouse/displaywidth v0.6.0 // indirect
52+
github.com/clipperhouse/stringish v0.1.1 // indirect
53+
github.com/clipperhouse/uax29/v2 v2.3.0 // indirect
4954
github.com/containerd/containerd/v2 v2.1.5 // indirect
5055
github.com/containerd/errdefs/pkg v0.3.0 // indirect
5156
github.com/containerd/log v0.1.0 // indirect
@@ -54,23 +59,19 @@ require (
5459
github.com/containerd/typeurl/v2 v2.2.3 // indirect
5560
github.com/cpuguy83/dockercfg v0.3.2 // indirect
5661
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
57-
github.com/creack/pty v1.1.24 // indirect
5862
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5963
github.com/distribution/reference v0.6.0 // indirect
6064
github.com/dlclark/regexp2 v1.11.0 // indirect
6165
github.com/docker/distribution v2.8.3+incompatible // indirect
6266
github.com/docker/docker-credential-helpers v0.9.3 // indirect
6367
github.com/ebitengine/purego v0.8.4 // indirect
64-
github.com/elastic/go-sysinfo v1.15.4 // indirect
65-
github.com/elastic/go-windows v1.0.2 // indirect
6668
github.com/felixge/httpsnoop v1.0.4 // indirect
6769
github.com/fsnotify/fsnotify v1.9.0 // indirect
6870
github.com/fvbommel/sortorder v1.1.0 // indirect
6971
github.com/go-logr/logr v1.4.3 // indirect
7072
github.com/go-logr/stdr v1.2.2 // indirect
7173
github.com/go-ole/go-ole v1.3.0 // indirect
7274
github.com/gogo/protobuf v1.3.2 // indirect
73-
github.com/google/go-containerregistry v0.20.6 // indirect
7475
github.com/google/uuid v1.6.0 // indirect
7576
github.com/gorilla/css v1.0.1 // indirect
7677
github.com/gorilla/mux v1.8.1 // indirect
@@ -94,6 +95,7 @@ require (
9495
github.com/moby/docker-image-spec v1.3.1 // indirect
9596
github.com/moby/go-archive v0.1.0 // indirect
9697
github.com/moby/locker v1.0.1 // indirect
98+
github.com/moby/moby/api v1.52.0 // indirect
9799
github.com/moby/patternmatcher v0.6.0 // indirect
98100
github.com/moby/sys/atomicwriter v0.1.0 // indirect
99101
github.com/moby/sys/sequential v0.6.0 // indirect
@@ -104,37 +106,39 @@ require (
104106
github.com/morikuni/aec v1.0.0 // indirect
105107
github.com/muesli/reflow v0.3.0 // indirect
106108
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
109+
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect
110+
github.com/olekukonko/errors v1.1.0 // indirect
111+
github.com/olekukonko/ll v0.1.3 // indirect
107112
github.com/opencontainers/go-digest v1.0.0 // indirect
108113
github.com/opencontainers/image-spec v1.1.1 // indirect
109114
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
110115
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
111116
github.com/prometheus/client_model v0.6.2 // indirect
112117
github.com/prometheus/common v0.67.4 // indirect
113-
github.com/prometheus/procfs v0.15.1 // indirect
114118
github.com/rivo/uniseg v0.4.7 // indirect
115119
github.com/russross/blackfriday/v2 v2.1.0 // indirect
116120
github.com/shirou/gopsutil/v4 v4.25.6 // indirect
117121
github.com/sirupsen/logrus v1.9.3 // indirect
118122
github.com/smallnest/ringbuffer v0.0.0-20241116012123-461381446e3d // indirect
119-
github.com/theupdateframework/notary v0.7.1-0.20210315103452-bf96a202a09a // indirect
120123
github.com/tklauser/go-sysconf v0.3.12 // indirect
121124
github.com/tklauser/numcpus v0.6.1 // indirect
122125
github.com/vbatts/tar-split v0.12.1 // indirect
123126
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
124127
github.com/yuin/goldmark v1.7.8 // indirect
125128
github.com/yuin/goldmark-emoji v1.0.5 // indirect
126129
github.com/yusufpapurcu/wmi v1.2.4 // indirect
127-
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
130+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
128131
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
129132
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect
130133
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
131134
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect
132-
go.opentelemetry.io/otel/metric v1.37.0 // indirect
135+
go.opentelemetry.io/otel/metric v1.39.0 // indirect
133136
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
134137
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
135-
go.opentelemetry.io/otel/trace v1.37.0 // indirect
138+
go.opentelemetry.io/otel/trace v1.39.0 // indirect
136139
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
137140
go.yaml.in/yaml/v2 v2.4.3 // indirect
141+
go.yaml.in/yaml/v3 v3.0.4 // indirect
138142
golang.org/x/crypto v0.43.0 // indirect
139143
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
140144
golang.org/x/mod v0.28.0 // indirect

0 commit comments

Comments
 (0)