Skip to content

Add agent base image composition enhancement#296

Open
hhpatel14 wants to merge 2 commits into
konveyor:masterfrom
hhpatel14:agentic-platform-agent-images
Open

Add agent base image composition enhancement#296
hhpatel14 wants to merge 2 commits into
konveyor:masterfrom
hhpatel14:agentic-platform-agent-images

Conversation

@hhpatel14

@hhpatel14 hhpatel14 commented Jun 18, 2026

Copy link
Copy Markdown

Define the container image layers for Konveyor Agentic Platform agent workloads. This enhancement fills the gap identified in the agentic-platform-controller enhancement where agent container image composition was explicitly deferred.

Key decisions:

  • Three-layer image hierarchy: agent-base → runtime → language
  • UBI 9 minimal as the foundation for OpenShift certification
  • Skills mounted at runtime via ImageVolumes, not baked into images
  • Non-root execution compatible with OpenShift restricted SCC
  • Multi-architecture support (amd64, arm64)
  • User extensibility via single FROM line

Image matrix covers two runtimes (goose, opencode) and five language toolchains (Java, Node.js, .NET, Go, full) for 12+ image variants published to quay.io/konveyor/.

Replaces the current monolithic migration-harness image (~2.7GB) with a layered approach that reduces pull sizes and enables per-migration image selection.

Summary by CodeRabbit

Release Notes

  • Documentation
    • Added enhancement documentation for the Agentic Platform’s “agent-base-image-composition” proposal, detailing the layered image structure, runtime skill mounting behavior (including fallback conventions), filesystem requirements, non-root execution expectations, multi-architecture build guidance, registry/tagging strategy, and CI/testing/security checklists.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@hhpatel14, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 4 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5bfb6814-d816-4058-8630-e9e092ab1ad9

📥 Commits

Reviewing files that changed from the base of the PR and between ed010b3 and f1895d3.

📒 Files selected for processing (1)
  • enhancements/agentic-platform-agent-images/README.md
📝 Walkthrough

Walkthrough

Adds a new enhancement proposal document for the Konveyor Agentic Platform defining a three-layer container image hierarchy, filesystem conventions, non-root execution requirements, multi-arch build expectations, CI pipeline strategy, test plan, security checklist, drawbacks, and alternatives.

Changes

Agent Base Image Composition Enhancement Proposal

Layer / File(s) Summary
Metadata, scope, motivation, and goals
enhancements/agentic-platform-agent-images/README.md
YAML front-matter with enhancement metadata, purpose and scope, release signoff checklist, open questions, layered model summary, motivation, goals, and explicit non-goals.
Image layer hierarchy and per-layer specifications
enhancements/agentic-platform-agent-images/README.md
Defines the three-layer naming convention (agent-base, agent-base-{runtime}, agent-{lang}-{runtime}), Layer 0 directory layout and entrypoint, Layer 1 runtime PATH requirements, and Layer 2 language toolchain installation via a single-Dockerfile build-arg approach.
Filesystem conventions, non-root execution, multi-arch, and user extensibility
enhancements/agentic-platform-agent-images/README.md
Specifies skill mount paths (/opt/skills/), harness output via /.konveyor/, workspace PVC usage, non-root execution requirements for OpenShift restricted SCC, multi-architecture (amd64/arm64) composition details, and the stable contract fields for downstream user extension images.
Build pipeline, test plan, security, drawbacks, alternatives, and infrastructure
enhancements/agentic-platform-agent-images/README.md
Covers registry and image naming, tagging strategy, rebuild triggers, CI multi-arch build approach, image size targets, test plan bullets, security checklist, maintenance drawbacks, evaluated alternatives (fat image, devcontainers, buildpacks), and required CI and test-cluster infrastructure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • shawn-hurley
  • fabianvf
  • pranavgaikwad

Poem

A rabbit hops through layers three,
Base and runtime, toolchain spree,
Skills are mounted, paths are set,
Non-root builds, no worries yet!
🐇 The docs are in, the plan is bright,
Container images built just right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the new agent base image composition enhancement documented in this PR.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@enhancements/agentic-platform-agent-images/README.md`:
- Around line 71-75: The Summary section states that skills are NOT baked into
the image, but the filesystem table description for the /opt/skills/ directory
suggests that core skills can be baked in. Clarify the contract by deciding
whether base images ship with baked-in skills or only reserve the /opt/skills/
directory as a runtime fallback location. Update both the Summary section and
the filesystem table entries (at lines 71-75 and 173-181) to be consistent and
explicit about this contract so implementers understand whether skills are
expected to be present in base images or only mounted at runtime.
- Around line 264-275: The documentation describes the harness writing results
to `/.konveyor/` and the controller reading from this path after Pod completion,
but only `/workspace/` is mentioned as a PVC mount. Since `/.konveyor/` would
reside on the container's ephemeral rootfs without a dedicated volume mount,
those results will be lost when the Pod exits. Update the README to clarify that
`/.konveyor/` must be mounted on a persistent volume (either as a separate PVC
mount or by relocating the path to `/workspace/` which is already mounted on the
PVC), ensuring results are persisted for the AgentRun controller to read after
Pod completion.
- Around line 378-391: The README documentation contains references to the
"main" branch for CI triggers and the `:latest` tag build source, but this
repository uses "master" as the default branch. Update the documentation by
replacing the references to "main" with "master" in two places: in the `:latest`
tag description where it states the tag is built from "main branch", and in the
CI section where it mentions "push to main". This ensures the documentation
accurately reflects the actual branch configuration and prevents developer
confusion about CI trigger behavior.
- Around line 156-230: The documentation currently uses `:latest` tags in all
image references (registry.access.redhat.com/ubi9/ubi-minimal:latest,
quay.io/konveyor/agent-base:latest, and the Dockerfile examples), which creates
nondeterministic builds and SBOMs. Replace all instances of `:latest` tags
throughout the README with explicit version tags using either release versions
(like :v1.0.0) or commit-based tags (like :sha-abc1234). Keep :latest as an
optional alternative reference only where it serves as documentation of the
general pattern, but make the primary examples use specific, pinned versions.
This applies to all image references across the base layer documentation,
runtime layer Dockerfiles, and language toolchain layer Dockerfiles sections.
- Around line 299-306: The README incorrectly states that OpenShift sets `$HOME`
to a writable tmpdir, but OpenShift's Restricted SCC only guarantees a random
non-root UID and does not modify the `$HOME` environment variable. Replace the
statement in point 3 about OpenShift setting `$HOME` with a corrected
explanation that `$HOME` is determined by the container image itself (via
Dockerfile WORKDIR or ENV instruction), and clarify that the harness must either
explicitly set `$HOME` in the Dockerfile or entrypoint, or it must be configured
in the pod specification, before the harness creates `$HOME/.config/<runtime>/`
directories at startup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc7f476e-7668-4c59-bcfb-1b90b3e5527b

📥 Commits

Reviewing files that changed from the base of the PR and between 5918e82 and 5e7e81d.

📒 Files selected for processing (1)
  • enhancements/agentic-platform-agent-images/README.md

Comment thread enhancements/agentic-platform-agent-images/README.md
Comment on lines +156 to +230
**Base**: `registry.access.redhat.com/ubi9/ubi-minimal:latest`

**Contents**:

| Path | Component | Purpose |
|---|---|---|
| `/usr/local/bin/konveyor-harness` | Harness entrypoint (Go binary) | Translates KONVEYOR_* env vars to runtime-specific config, discovers skills, invokes runtime |
| `/usr/local/bin/skillctl` | skillimage CLI | Skill discovery, inspection, build, push, pull of OCI skill artifacts |
| `/usr/local/bin/graphify` | graphify CLI (Python package) | Code graph analysis via tree-sitter AST extraction |
| `/usr/local/bin/fetch-analysis` | Konveyor tool | Fetches analysis results from Hub API |
| `/usr/local/bin/run-analysis` | Konveyor tool | Runs Kantra analysis against application source |
| `/usr/bin/git` | git | Version control |
| `/usr/bin/jq` | jq | JSON processing |
| `/usr/bin/curl` | curl | HTTP client |
| `/usr/bin/ssh` | ssh | Git SSH access |
| `/usr/bin/python3` | Python 3.12 | Required by graphify |

**Directories**:

| Path | Purpose | Permissions |
|---|---|---|
| `/opt/skills/` | Core skills (baked in, if any) | Read-only, readable by any UID |
| `/.konveyor/` | Harness output (session ID, results) | Writable by any UID |
| `/workspace/` | Workspace PVC mount point | Writable by any UID |
| `$HOME/.config/` | Runtime config (written by harness at startup) | Writable by any UID |

**Entrypoint**: `/usr/local/bin/konveyor-harness`

**Estimated size**: ~400MB (UBI minimal + Python 3.12 + graphify + Go binaries + CLI tools)

### Layer 1: Runtime Layers (agent-base-{runtime})

Each runtime layer extends agent-base with a specific agent runtime
binary installed to `/usr/local/bin/`. The harness auto-detects which
runtime is present by checking PATH.

```dockerfile
FROM quay.io/konveyor/agent-base:latest
# Install the runtime binary (goose, opencode, etc.)
# Must be at /usr/local/bin/{runtime} for non-root access
```

| Runtime | Binary source | Estimated size |
|---|---|---|
| goose | GitHub releases (`goose-{arch}-unknown-linux-gnu.tar.bz2`) | ~500MB |
| opencode | opencode.ai install script | ~450MB |

New runtimes are added by creating a new `agent-base-{runtime}`
Dockerfile. No changes to agent-base or language layers required.

### Layer 2: Language Toolchain Layers (agent-{lang}-{runtime})

Each language layer extends a runtime layer with build tools needed
by the verify and fix phases to compile and test migrated code.

```dockerfile
FROM quay.io/konveyor/agent-base-{runtime}:latest
# Install language toolchain
```

| Language | What's installed | Estimated total size |
|---|---|---|
| `agent-java-{runtime}` | OpenJDK 21, Maven 3.9+ | ~1.1GB |
| `agent-node-{runtime}` | Node.js 20 LTS, npm | ~700MB |
| `agent-dotnet-{runtime}` | .NET 8 SDK | ~900MB |
| `agent-go-{runtime}` | Go 1.23 | ~900MB |
| `agent-full-{runtime}` | All of the above | ~2.0GB |

Every language layer is identical regardless of runtime — only the
FROM line changes. A single Dockerfile with a build arg handles all
combinations:

```dockerfile
ARG RUNTIME=goose
FROM quay.io/konveyor/agent-base-${RUNTIME}:latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, locate the file
find . -path "*/enhancements/agentic-platform-agent-images/README.md" -type f

Repository: konveyor/enhancements

Length of output: 120


🏁 Script executed:

# Read the file to check content around the specified lines
if [ -f "enhancements/agentic-platform-agent-images/README.md" ]; then
  wc -l "enhancements/agentic-platform-agent-images/README.md"
  echo "=== Lines 156-230 ==="
  sed -n '156,230p' "enhancements/agentic-platform-agent-images/README.md"
  echo "=== Lines 333-374 ==="
  sed -n '333,374p' "enhancements/agentic-platform-agent-images/README.md"
fi

Repository: konveyor/enhancements

Length of output: 4525


🏁 Script executed:

# Search for all :latest references in the file
if [ -f "enhancements/agentic-platform-agent-images/README.md" ]; then
  echo "=== All :latest references ==="
  grep -n ":latest" "enhancements/agentic-platform-agent-images/README.md"
fi

Repository: konveyor/enhancements

Length of output: 819


🏁 Script executed:

# Read lines around 378 to understand tag strategy
sed -n '375,385p' "enhancements/agentic-platform-agent-images/README.md"

Repository: konveyor/enhancements

Length of output: 337


Pin documented image references to specific versions for reproducible builds.

The documentation and published image list reference :latest tags (lines 156, 193, 212, 230, 333, 366–374), which makes builds and SBOMs nondeterministic. The tagging strategy already defines alternatives (:v1.0.0 for releases, :sha-abc1234 for commit-based traceability). Update the documented examples and published image list to use explicit version tags instead of :latest, keeping :latest only as an optional fallback reference.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@enhancements/agentic-platform-agent-images/README.md` around lines 156 - 230,
The documentation currently uses `:latest` tags in all image references
(registry.access.redhat.com/ubi9/ubi-minimal:latest,
quay.io/konveyor/agent-base:latest, and the Dockerfile examples), which creates
nondeterministic builds and SBOMs. Replace all instances of `:latest` tags
throughout the README with explicit version tags using either release versions
(like :v1.0.0) or commit-based tags (like :sha-abc1234). Keep :latest as an
optional alternative reference only where it serves as documentation of the
general pattern, but make the primary examples use specific, pinned versions.
This applies to all image references across the base layer documentation,
runtime layer Dockerfiles, and language toolchain layer Dockerfiles sections.

Comment thread enhancements/agentic-platform-agent-images/README.md
Comment thread enhancements/agentic-platform-agent-images/README.md Outdated
Comment thread enhancements/agentic-platform-agent-images/README.md
Comment thread enhancements/agentic-platform-agent-images/README.md Outdated
Comment thread enhancements/agentic-platform-agent-images/README.md Outdated
@github-project-automation github-project-automation Bot moved this to 🆕 New in Planning Jun 23, 2026
@dymurray dymurray moved this from 🆕 New to 🏗 In progress in Planning Jun 23, 2026
@hhpatel14 hhpatel14 changed the title [WIP] Add agent base image composition enhancement Add agent base image composition enhancement Jun 28, 2026
Define the container image layers for Konveyor Agentic Platform agent
workloads. This enhancement fills the gap identified in the
agentic-platform-controller enhancement where agent container image
composition was explicitly deferred.

Key decisions:
- Three-layer image hierarchy: agent-base → runtime → language
- UBI 9 minimal as the foundation for OpenShift certification
- Skills mounted at runtime via ImageVolumes, not baked into images
- Non-root execution compatible with OpenShift restricted SCC
- Multi-architecture support (amd64, arm64)
- User extensibility via single FROM line

Image matrix covers two runtimes (goose, opencode) and five language
toolchains (Java, Node.js, .NET, Go, full) for 12+ image variants
published to quay.io/konveyor/.

Replaces the current monolithic migration-harness image (~2.7GB) with
a layered approach that reduces pull sizes and enables per-migration
image selection.

Signed-off-by: Hit Patel <hitpatel@redhat.com>
Signed-off-by: hhpatel14 <hitpatel@redhat.com>
…h OpenShift as an example. Konveyor is vendor neutral.

Signed-off-by: hhpatel14 <hitpatel@redhat.com>
@djzager

djzager commented Jun 30, 2026

Copy link
Copy Markdown
Member

@hhpatel14 — We've been grilling the agentic-platform-controller enhancement (PR #295) and made several design decisions that affect the base image composition. Summarizing the changes relevant to your PR so we can align:

1. Credential handling — harness manages git push, agent does not receive credentials directly. The agent does not receive git credentials in its environment variables or git configuration. The harness reads credentials from a mounted Secret, clones with them, and configures the workspace remote without authentication — git push from the agent will fail. The harness performs all push operations on the agent's behalf. Note: in the POC (single-container Sandbox), the credential exists on the container filesystem and a determined agent could locate it. This reduces accidental exposure (logging, prompt injection) but does not provide full isolation — full isolation requires OpenShell filesystem policy enforcement (future). The updated git lifecycle for the harness is:

  1. Harness reads git credentials from mounted Secret
  2. Clone the source repo (harness uses credentials)
  3. Configure workspace remote without credentials (agent cannot push)
  4. Create or checkout the target branch
  5. Agent works, harness commits incrementally
  6. On exit: harness commits .konveyor/handoff.md and .konveyor/session.json
  7. Harness pushes to the target repo (using credentials)
  8. Harness writes /.konveyor/results.json (pod-local)

2. ACP transport — goose serve instead of goose acp. For the POC, the harness launches goose serve --port 4000 instead of goose acp. This exposes the full ACP protocol over HTTP/WebSocket natively. The controller connects to this endpoint via SSE for observability, and the UI connects (via the controller) for human-in-the-loop interaction. The harness auto-detection of the runtime binary still applies, but the launch command changes for Goose. For non-Goose runtimes (OpenCode, etc.), the harness would launch <agent> acp over stdio and bridge it to HTTP — that's a future addition.

3. Session handoff schema ownership. The controller enhancement now explicitly defers .konveyor/session.json and .konveyor/handoff.md schema definition to your enhancement as a non-goal. Your PR owns the schema.

4. Observability — controller reads from ACP, not from files. The controller connects to the agent's ACP HTTP endpoint via SSE and reads streaming events directly. It writes AgentRun CR status at lifecycle transitions only (started, completed, failed). The harness does NOT need to update the AgentRun CR via SA token — the controller handles that. The harness's remaining observability role is committing .konveyor/session.json to the git branch for post-run audit. The results.json pod-local file may be simplified or removed since the controller reads status via ACP.

5. Context budget computation deferred. Context budget validation (counting rule tokens against model context windows) is deferred from the POC. Your enhancement can skip any harness logic related to context budget enforcement.

These changes are reflected in the updated controller enhancement (PR #295) and ADRs 0001/0002. Happy to discuss any of these in more detail.

|---|---|---|
| `/opt/skills/` | Core skills (baked in, if any) | Read-only, readable by any UID |
| `/.konveyor/` | Harness output (session ID, results) | Writable by any UID |
| `/workspace/` | Workspace PVC mount point | Writable by any UID |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need PVC for anything that will be shared across stages and we wont commit to git? If I understood #295 to an extent, workspaces are ephemeral and git is the source of truth. Should this updated to EmptyDir instead of PVC

@djzager is my understanding correct?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. EVERYTHING that we want to pass along stays with the repo.

Comment thread enhancements/agentic-platform-agent-images/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

4 participants