Skip to content

Commit 96af7b7

Browse files
authored
Merge pull request #36 from docker/bump-model-distribution
Bump model distribution
2 parents 84ed5fd + f79622e commit 96af7b7

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.23.7
55
require (
66
github.com/containerd/containerd/v2 v2.0.4
77
github.com/containerd/platforms v1.0.0-rc.1
8-
github.com/docker/model-distribution v0.0.0-20250423075433-587f475e591d
8+
github.com/docker/model-distribution v0.0.0-20250512190053-b3792c042d57
99
github.com/jaypipes/ghw v0.16.0
1010
github.com/opencontainers/go-digest v1.0.0
1111
github.com/opencontainers/image-spec v1.1.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBi
3737
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
3838
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
3939
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
40-
github.com/docker/model-distribution v0.0.0-20250423075433-587f475e591d h1:lyxdxjNHTSyQ2w1rjbuu5pbgX42AD3kmxWLNv3mdqQ4=
41-
github.com/docker/model-distribution v0.0.0-20250423075433-587f475e591d/go.mod h1:dThpO9JoG5Px3i+rTluAeZcqLGw8C0qepuEL4gL2o/c=
40+
github.com/docker/model-distribution v0.0.0-20250512190053-b3792c042d57 h1:ZqfKknb+0/uJid8XLFwSl/osjE+WuS6o6I3dh3ZqO4U=
41+
github.com/docker/model-distribution v0.0.0-20250512190053-b3792c042d57/go.mod h1:dThpO9JoG5Px3i+rTluAeZcqLGw8C0qepuEL4gL2o/c=
4242
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
4343
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
4444
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=

pkg/inference/models/manager.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"strings"
1313

1414
"github.com/docker/model-distribution/distribution"
15+
"github.com/docker/model-distribution/registry"
1516
"github.com/docker/model-distribution/types"
1617
"github.com/docker/model-runner/pkg/inference"
1718
"github.com/docker/model-runner/pkg/logging"
@@ -129,17 +130,17 @@ func (m *Manager) handleCreateModel(w http.ResponseWriter, r *http.Request) {
129130
// Pull the model. In the future, we may support additional operations here
130131
// besides pulling (such as model building).
131132
if err := m.PullModel(r.Context(), request.From, w); err != nil {
132-
if errors.Is(err, distribution.ErrInvalidReference) {
133+
if errors.Is(err, registry.ErrInvalidReference) {
133134
m.log.Warnf("Invalid model reference %q: %v", request.From, err)
134135
http.Error(w, "Invalid model reference", http.StatusBadRequest)
135136
return
136137
}
137-
if errors.Is(err, distribution.ErrUnauthorized) {
138+
if errors.Is(err, registry.ErrUnauthorized) {
138139
m.log.Warnf("Unauthorized to pull model %q: %v", request.From, err)
139140
http.Error(w, "Unauthorized", http.StatusUnauthorized)
140141
return
141142
}
142-
if errors.Is(err, distribution.ErrModelNotFound) {
143+
if errors.Is(err, registry.ErrModelNotFound) {
143144
m.log.Warnf("Failed to pull model %q: %v", request.From, err)
144145
http.Error(w, "Model not found", http.StatusNotFound)
145146
return
@@ -388,7 +389,7 @@ func (m *Manager) handlePushModel(w http.ResponseWriter, r *http.Request, model
388389
http.Error(w, "Model not found", http.StatusNotFound)
389390
return
390391
}
391-
if errors.Is(err, distribution.ErrUnauthorized) {
392+
if errors.Is(err, registry.ErrUnauthorized) {
392393
m.log.Warnf("Unauthorized to push model %q: %v", model, err)
393394
http.Error(w, "Unauthorized", http.StatusUnauthorized)
394395
return

0 commit comments

Comments
 (0)