Skip to content

Commit 59280ed

Browse files
authored
Merge pull request #723 from doringeman/bump-go
chore(go): 1.26
2 parents 3a464ee + fa647a2 commit 59280ed

File tree

10 files changed

+30
-26
lines changed

10 files changed

+30
-26
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417
2121
with:
22-
go-version: 1.25.6
22+
go-version: 1.26.0
2323
cache: true
2424

2525
- name: Install golangci-lint
2626
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20
2727
with:
28-
version: v2.7.2
28+
version: v2.10.1
2929
install-only: true
3030

3131
- name: Run linting for ${{ matrix.goos }}
@@ -45,7 +45,7 @@ jobs:
4545
- name: Set up Go
4646
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417
4747
with:
48-
go-version: 1.25.6
48+
go-version: 1.26.0
4949
cache: true
5050

5151
- name: Check go mod tidy

.github/workflows/integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417
2020
with:
21-
go-version: 1.25.6
21+
go-version: 1.26.0
2222
cache: true
2323

2424
- name: Set up Docker Buildx

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ jobs:
208208
- name: Set up Go
209209
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417
210210
with:
211-
go-version: 1.25.6
211+
go-version: 1.26.0
212212
cache: true
213213

214214
- name: Run tests

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,17 @@ linters:
141141
excludes:
142142
- G104 # G104: Errors unhandled; (TODO: reduce unhandled errors, or explicitly ignore)
143143
- G115 # G115: integer overflow conversion; (TODO: verify these: https://github.com/moby/moby/issues/48358)
144+
- G117 # G117: Exported struct field matches secret pattern; false positives on legitimate API types.
144145
- G204 # G204: Subprocess launched with variable; too many false positives.
145146
- G301 # G301: Expect directory permissions to be 0750 or less (also EXC0009); too restrictive
146147
- G302 # G302: Expect file permissions to be 0600 or less (also EXC0009); too restrictive
147148
- G304 # G304: Potential file inclusion via variable.
148149
- G306 # G306: Expect WriteFile permissions to be 0600 or less (too restrictive; also flags "0o644" permissions)
149150
- G307 # G307: Deferring unsafe method "*os.File" on type "Close" (also EXC0008); (TODO: evaluate these and fix where needed: G307: Deferring unsafe method "*os.File" on type "Close")
150151
- G504 # G504: Blocklisted import net/http/cgi: Go versions < 1.6.3 are vulnerable to Httpoxy attack: (CVE-2016-5386); (only affects go < 1.6.3)
152+
- G703 # G703: Path traversal via taint analysis; too many false positives.
153+
- G704 # G704: SSRF via taint analysis; too many false positives on internal HTTP clients.
154+
- G705 # G705: XSS via taint analysis; too many false positives.
151155

152156
govet:
153157
enable-all: true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG GO_VERSION=1.25
3+
ARG GO_VERSION=1.26
44
ARG LLAMA_SERVER_VERSION=latest
55
ARG LLAMA_SERVER_VARIANT=cpu
66
ARG LLAMA_BINARY_PATH=/com.docker.llama-server.native.linux.${LLAMA_SERVER_VARIANT}.${TARGETARCH}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Project variables
22
APP_NAME := model-runner
3-
GO_VERSION := 1.25.6
3+
GO_VERSION := 1.26.0
44
LLAMA_SERVER_VERSION := latest
55
LLAMA_SERVER_VARIANT := cpu
66
BASE_IMAGE := ubuntu:24.04

cmd/cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG GO_VERSION=1.25
3+
ARG GO_VERSION=1.26
44
ARG ALPINE_VERSION=3.23
55

66
ARG DOCS_FORMATS="md,yaml"

cmd/cli/commands/show.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ func formatModelInfo(model dmrm.Model) string {
4545
var sb strings.Builder
4646

4747
// Model ID
48-
sb.WriteString(fmt.Sprintf("Model: %s\n", model.ID))
48+
fmt.Fprintf(&sb, "Model: %s\n", model.ID)
4949

5050
// Tags
5151
if len(model.Tags) > 0 {
52-
sb.WriteString(fmt.Sprintf("Tags: %s\n", strings.Join(model.Tags, ", ")))
52+
fmt.Fprintf(&sb, "Tags: %s\n", strings.Join(model.Tags, ", "))
5353
}
5454

5555
// Created date
5656
if model.Created > 0 {
5757
created := time.Unix(model.Created, 0)
58-
sb.WriteString(fmt.Sprintf("Created: %s\n", created.Format(time.RFC3339)))
58+
fmt.Fprintf(&sb, "Created: %s\n", created.Format(time.RFC3339))
5959
}
6060

6161
// Config details
@@ -77,20 +77,20 @@ func formatModelInfo(model dmrm.Model) string {
7777

7878
for _, field := range fields {
7979
if field.value != "" {
80-
sb.WriteString(fmt.Sprintf("%-14s%s\n", field.label, field.value))
80+
fmt.Fprintf(&sb, "%-14s%s\n", field.label, field.value)
8181
}
8282
}
8383

8484
if cfg.ContextSize != nil {
85-
sb.WriteString(fmt.Sprintf("%-14s%d\n", "Context Size:", *cfg.ContextSize))
85+
fmt.Fprintf(&sb, "%-14s%d\n", "Context Size:", *cfg.ContextSize)
8686
}
8787

8888
// Helper function to print metadata sections
8989
printMetadata := func(title string, data map[string]string) {
9090
if len(data) > 0 {
91-
sb.WriteString(fmt.Sprintf("\n%s:\n", title))
91+
fmt.Fprintf(&sb, "\n%s:\n", title)
9292
for k, v := range data {
93-
sb.WriteString(fmt.Sprintf(" %s: %s\n", k, v))
93+
fmt.Fprintf(&sb, " %s: %s\n", k, v)
9494
}
9595
}
9696
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/docker/model-runner
22

3-
go 1.25.6
3+
go 1.26.0
44

55
require (
66
github.com/charmbracelet/glamour v0.10.0

pkg/inference/scheduling/runner.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,16 @@ func run(
122122
if err != nil {
123123
return nil, fmt.Errorf("unable to parse virtual backend URL: %w", err)
124124
}
125-
proxy := httputil.NewSingleHostReverseProxy(upstream)
126-
standardDirector := proxy.Director
127-
proxy.Director = func(r *http.Request) {
128-
standardDirector(r)
129-
// HACK: Most backends will be happier with a "localhost" hostname than
130-
// an "inference.docker.internal" hostname (which they may reject).
131-
r.Host = "localhost"
132-
// Remove the prefix up to the OpenAI API root.
133-
r.URL.Path = trimRequestPathToOpenAIRoot(r.URL.Path)
134-
r.URL.RawPath = trimRequestPathToOpenAIRoot(r.URL.RawPath)
125+
proxy := &httputil.ReverseProxy{
126+
Rewrite: func(pr *httputil.ProxyRequest) {
127+
pr.SetURL(upstream)
128+
// HACK: Most backends will be happier with a "localhost" hostname than
129+
// an "inference.docker.internal" hostname (which they may reject).
130+
pr.Out.Host = "localhost"
131+
// Remove the prefix up to the OpenAI API root.
132+
pr.Out.URL.Path = trimRequestPathToOpenAIRoot(pr.Out.URL.Path)
133+
pr.Out.URL.RawPath = trimRequestPathToOpenAIRoot(pr.Out.URL.RawPath)
134+
},
135135
}
136136
proxy.ModifyResponse = func(resp *http.Response) error {
137137
// CORS headers are set by the CorsMiddleware from pkg/inference/cors.go,

0 commit comments

Comments
 (0)