Skip to content

Commit 7af6ca6

Browse files
committed
fix(stack): refresh x402 runtime image pins
1 parent 98fa406 commit 7af6ca6

7 files changed

Lines changed: 35 additions & 5 deletions

File tree

internal/embed/embed_image_pin_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,34 @@ func TestEmbeddedImages_NamedImagesAreDigestPinned(t *testing.T) {
224224
}
225225
}
226226

227+
func TestEmbeddedImages_X402ControllerAndBuyerUseFixPins(t *testing.T) {
228+
cases := []struct {
229+
file string
230+
ref string
231+
}{
232+
{
233+
file: "base/templates/x402.yaml",
234+
ref: "ghcr.io/obolnetwork/serviceoffer-controller:f5d94fc@sha256:c6aa6259e3a6bc61a5f4f7203d8c68cfdd861a8d365f9629d234d13b949bf48e",
235+
},
236+
{
237+
file: "base/templates/llm.yaml",
238+
ref: "ghcr.io/obolnetwork/x402-buyer:f5d94fc@sha256:0c431eda44e9e2fe5dd50c82cf4885f9be5037e592478781c51e9c510171265c",
239+
},
240+
}
241+
242+
for _, tc := range cases {
243+
t.Run(tc.ref, func(t *testing.T) {
244+
data, err := ReadInfrastructureFile(tc.file)
245+
if err != nil {
246+
t.Fatalf("read %s: %v", tc.file, err)
247+
}
248+
if !strings.Contains(string(data), "image: "+tc.ref) {
249+
t.Fatalf("%s must pin current x402 bundle image %q", tc.file, tc.ref)
250+
}
251+
})
252+
}
253+
}
254+
227255
// TestEmbeddedImages_CloudflaredHelmTagIsDigestPinned covers the cloudflared
228256
// chart, which uses the Helm idiom `image.repository` + `image.tag` rather
229257
// than a literal `image:` line. The chart template renders

internal/embed/infrastructure/base/templates/llm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,14 @@ spec:
293293
- name: x402-buyer
294294
# Pinned by sha256 digest (multi-arch manifest list, amd64+arm64)
295295
# so the deployed sidecar is byte-for-byte identical across QA
296-
# hosts. The :b13254e tag is preserved for human readability; the
296+
# hosts. The :f5d94fc tag is preserved for human readability; the
297297
# digest is authoritative.
298298
# Previous tag-only pin allowed the local-build path to silently
299299
# reuse a 5-day-old `:latest` image and ate the release-smoke 503
300300
# investigation: stale buyer serialized X-PAYMENT with empty
301301
# authorization fields → facilitator /verify 400 → 503 cascade
302302
# across flow-08/11/14/13. See internal/embed/embed_image_pin_test.go.
303-
image: ghcr.io/obolnetwork/x402-buyer:b13254e@sha256:446d730fefbe1860e8b3245289aa8979d765ae977b7f0eaa053543e2468313cb
303+
image: ghcr.io/obolnetwork/x402-buyer:f5d94fc@sha256:0c431eda44e9e2fe5dd50c82cf4885f9be5037e592478781c51e9c510171265c
304304
imagePullPolicy: IfNotPresent
305305
# PSS Restricted: Go distroless:nonroot image already runs as
306306
# UID 65532; only the state dir under /state needs to be writeable

internal/embed/infrastructure/base/templates/x402.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ spec:
327327
type: RuntimeDefault
328328
containers:
329329
- name: controller
330-
image: ghcr.io/obolnetwork/serviceoffer-controller:b13254e@sha256:f83bd7e55bdc5d87edb49c04e7fd9257097364e2d43e769c19dfd7c8b47d07af
330+
image: ghcr.io/obolnetwork/serviceoffer-controller:f5d94fc@sha256:c6aa6259e3a6bc61a5f4f7203d8c68cfdd861a8d365f9629d234d13b949bf48e
331331
imagePullPolicy: IfNotPresent
332332
securityContext:
333333
allowPrivilegeEscalation: false

internal/hermes/hermes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ func generateValues(namespace, hostname, dashboardHostname, agentBaseURL, token,
781781
- sh
782782
- -ec
783783
- |
784-
mkdir -p /data/.hermes/home /data/.hermes/workspace
784+
mkdir -p /data/.hermes/home /data/.hermes/workspace /data/.hermes/logs
785785
if [ ! -x /opt/hermes/.venv/bin/hermes ]; then
786786
echo "Hermes binary missing from image: /opt/hermes/.venv/bin/hermes" >&2
787787
exit 1

internal/hermes/hermes_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ func TestGenerateValues_UsesHermesNativeNames(t *testing.T) {
140140
`value: "hermes-obol-agent"`,
141141
"OBOL_SKILLS_DIR",
142142
"/data/.hermes/obol-skills",
143+
"/data/.hermes/logs",
143144
"containerPort: 8642",
144145
"containerPort: 9119",
145146
"fsGroupChangePolicy: OnRootMismatch",

internal/serviceoffercontroller/agent_render.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func buildAgentProfileInitContainer() map[string]any {
222222
"image": hermesImage(),
223223
"imagePullPolicy": "IfNotPresent",
224224
"command": []any{"/bin/sh", "-ceu"},
225-
"args": []any{`mkdir -p /data/.hermes/home /data/.hermes/workspace /data/.hermes/obol-skills
225+
"args": []any{`mkdir -p /data/.hermes/home /data/.hermes/workspace /data/.hermes/logs /data/.hermes/obol-skills
226226
227227
seed=/profile-seed/profile.tar.gz
228228
marker=/data/.hermes/.obol-profile-seed-imported

internal/serviceoffercontroller/agent_render_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ func TestAgentManifests_ProfileSeedInitContainer(t *testing.T) {
213213
"/profile-seed/profile.tar.gz",
214214
".obol-profile-seed-imported",
215215
"/data/.hermes/SOUL.md",
216+
"/data/.hermes/logs",
216217
"cp -R",
217218
} {
218219
if !strings.Contains(script, must) {

0 commit comments

Comments
 (0)