Skip to content

BYO agents Phase 5: self-describing OCI images (bbox agents import IMAGE) #204

Closed

Description

@JAORMX

Follow-up to #191 (epic). Depends on the manifest format from the Phase 4 follow-up. Lets an image ship its own brood-box agent definition so a single reference is enough to run it.

Scope

Read an embedded manifest declared by an OCI label or well-known path:

LABEL org.stacklok.broodbox.agent=/usr/share/broodbox/agent.yaml
COPY broodbox-agent.yaml /usr/share/broodbox/agent.yaml
bbox agents import ghcr.io/acme/aider-bbox:latest
  • Resolve the manifest by reading the OCI config label (and/or a well-known path) using go-containerregistry — this is I/O, lives in internal/infra (image inspection), invoked from cmd/bbox.
  • Parse → validate via the Phase 4 manifest path + ValidateCustomAgent (Add declarative bring-your-own agent support (#191 Phase 1) #200), then add to global config (the image-ref the manifest came from becomes the agent image).
  • Define and document the minimum image contract (sandbox user/home, shell, agent binary on PATH or explicit command) — partially overlaps with the run-image follow-up; align the two.

Open questions

  • Local-cache-presence vs. live-pull during import (and how agents doctor reports pullability).
  • Whether to verify the manifest's declared image matches the imported reference.

Acceptance criteria

bbox agents import ghcr.io/acme/aider-bbox:latest registers a runnable agent with no local YAML authoring.

Activity

  1. added
    enhancement
    on Jun 27, 2026
  2. added
    needs-triage
    on Jun 27, 2026
  3. JAORMX commented on Jul 3, 2026

    @JAORMX
    ContributorAuthor

    PR #216 implements this. Summary of the approach:

    • New internal/infra/ocimage/ package: Fetcher interface + RemoteFetcher (go-containerregistry). Pulls config + the one layer holding the manifest, pins the ref to the resolved digest, default keychain auth + 60s timeout.
    • bbox agents import IMAGE overloads the existing import <file> — auto-detected (a source is an image when it's not an existing file AND contains / or @sha256:). --name overrides the manifest's name. Reuses the validate → UpsertAgent → receipt tail.
    • Manifest extracted via the org.stacklok.broodbox.agent label, falling back to /usr/share/broodbox/agent.yaml.
    • Open questions resolved: live-pull the manifest only (full image pulled at VM run time); warn only on real repo mismatch (same-repo tag→digest pin is silent); doctor pullability deferred (would break doctor's pure/offline invariant).

    Closes #204 when merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions