[PR #348] feat(compose): build service images with the remote builder #369

Open
opened 2026-10-29 14:22:42 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/348
Author: @Primary33
Created: 10/9/2026
Status: 🔄 Open

Base: main ← Head: feat/compose-build


📝 Commits (5)

  • afe5e13 feat(compose): add the Compose planner
  • e89868a feat(compose): add the guest Compose runtime image
  • 0fe2d69 feat(compose): run Compose projects in isolated sandboxes
  • 7957f81 feat(cli): add aenv compose up
  • 61476c7 feat: build Compose service images with the remote builder

📊 Changes

36 files changed (+4554 additions, -72 deletions)

View changed files

📝 .github/workflows/release.yml (+10 -0)
➕ compose-image/Dockerfile (+117 -0)
➕ compose-image/test_e2e.py (+477 -0)
📝 crates/aenv/src/commands/build.rs (+456 -46)
➕ crates/aenv/src/commands/compose.rs (+649 -0)
📝 crates/aenv/src/commands/mod.rs (+1 -0)
📝 crates/aenv/src/commands/start.rs (+1 -1)
📝 crates/aenv/src/main.rs (+3 -0)
📝 deploy/docker/Dockerfile.agentenv (+7 -0)
📝 docs/src/concepts/sandboxes/starting.md (+254 -2)
📝 docs/src/configuration/reference.md (+9 -0)
📝 docs/src/getting-started/quickstart.md (+30 -0)
📝 scripts/install.sh (+3 -0)
📝 services/Makefile (+5 -0)
➕ services/compose/cmd/main.go (+39 -0)
➕ services/compose/plan.go (+469 -0)
➕ services/compose/plan_test.go (+322 -0)
➕ services/gateway/internal/compose_test.go (+46 -0)
📝 services/gateway/internal/metrics.go (+1 -1)
📝 services/gateway/internal/schedule_hint.go (+1 -1)

...and 16 more files

📄 Description

What

Add aenv build --compose and /sandboxes-compose/plan to build selected Compose services and write a runnable file pinned to published image digests.

Why

Build local Compose projects into reusable images that can immediately run through aenv compose up.

Depends on CLI #417, which is stacked on runtime #349, planner #415 and guest image #416. Review the last commit only. Rebase onto main after those dependencies merge.

Scope and non-goals

Planner build mode, build planning API, Compose CLI builds, build-failure reporting, build E2E coverage and the Terminal-Bench environment harness.

Design and behavior changes

  • Extend the planner Request with Mode/Harbor and dispatch directly decoded stdin to runtime or build preparation. Add the /sandboxes-compose/plan Prometheus label with this endpoint.
  • Validate local contexts and Dockerfiles before allocation, then use the existing image-only builder. Preserve explicit variables, profiles, build arguments, target and no-cache settings.
  • Publish reusable digests by default; optional registry pushes select pushed tags. Write the output atomically after all services succeed.
  • Preserve the image-only failure wait so buildctl can receive BuildKit's final Solve error. --harbor supplies explicit task defaults.

Compatibility and operations

Requires the stack above and matching CLI/server/planner versions. Planning is limited to 30 seconds on the node and has a 60-second gateway timeout. Registry pushes use client credentials; runtime pulls use node credentials.

Validation

On the designated Ubuntu test host as a non-root user with isolated state, after rebasing onto #417:

  • make clippy
  • cargo fmt -p aenv -- --check
  • cargo test -p aenv --bin aenv — 126 passed.
  • cargo test -p agentenv --lib compose / api::impls::sandbox / api::impls::image_build — 3 / 26 / 24 passed.
  • make -C services test fmt-check vet
  • make agentenv-server — generated files unchanged.

The dependency stack separately passed its full unit suite, image build, API lifecycle E2E and CLI E2E. Full build E2E and Terminal-Bench runs were not repeated for this rebase. Workspace formatting retains the known Node line-wrap discrepancy described in #349.

Risks and reviewer notes

Review planning validation, output publication after successful builds, and the image-only failure wait. Images produced before a later service fails follow repository/registry retention policies.

Checklist

  • One build-workflow change with focused tests.
  • Schema and generated code updated together.
  • Logs and examples contain no credentials or private settings.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/348 **Author:** [@Primary33](https://github.com/Primary33) **Created:** 10/9/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/compose-build` --- ### 📝 Commits (5) - [`afe5e13`](https://github.com/kvcache-ai/AgentENV/commit/afe5e138f2f9073e9388e4048bcdaaad0cbc988f) feat(compose): add the Compose planner - [`e89868a`](https://github.com/kvcache-ai/AgentENV/commit/e89868ad362984afecf89f73ec1d3ae8c4789df6) feat(compose): add the guest Compose runtime image - [`0fe2d69`](https://github.com/kvcache-ai/AgentENV/commit/0fe2d692dac87f142a5fd1a4a7de7ae6dd8ef4e1) feat(compose): run Compose projects in isolated sandboxes - [`7957f81`](https://github.com/kvcache-ai/AgentENV/commit/7957f81967a90e0f0bb708672eeb6e82405ddaa4) feat(cli): add aenv compose up - [`61476c7`](https://github.com/kvcache-ai/AgentENV/commit/61476c7df75f1c7bdcb8de3672501b8b736fc2d2) feat: build Compose service images with the remote builder ### 📊 Changes **36 files changed** (+4554 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yml` (+10 -0) ➕ `compose-image/Dockerfile` (+117 -0) ➕ `compose-image/test_e2e.py` (+477 -0) 📝 `crates/aenv/src/commands/build.rs` (+456 -46) ➕ `crates/aenv/src/commands/compose.rs` (+649 -0) 📝 `crates/aenv/src/commands/mod.rs` (+1 -0) 📝 `crates/aenv/src/commands/start.rs` (+1 -1) 📝 `crates/aenv/src/main.rs` (+3 -0) 📝 `deploy/docker/Dockerfile.agentenv` (+7 -0) 📝 `docs/src/concepts/sandboxes/starting.md` (+254 -2) 📝 `docs/src/configuration/reference.md` (+9 -0) 📝 `docs/src/getting-started/quickstart.md` (+30 -0) 📝 `scripts/install.sh` (+3 -0) 📝 `services/Makefile` (+5 -0) ➕ `services/compose/cmd/main.go` (+39 -0) ➕ `services/compose/plan.go` (+469 -0) ➕ `services/compose/plan_test.go` (+322 -0) ➕ `services/gateway/internal/compose_test.go` (+46 -0) 📝 `services/gateway/internal/metrics.go` (+1 -1) 📝 `services/gateway/internal/schedule_hint.go` (+1 -1) _...and 16 more files_ </details> ### 📄 Description ## What Add `aenv build --compose` and `/sandboxes-compose/plan` to build selected Compose services and write a runnable file pinned to published image digests. ## Why Build local Compose projects into reusable images that can immediately run through `aenv compose up`. ## Related issue Depends on CLI #417, which is stacked on runtime #349, planner #415 and guest image #416. [Review the last commit only](https://github.com/Primary33/AgentENV/compare/7957f81...61476c7). Rebase onto main after those dependencies merge. ## Scope and non-goals Planner build mode, build planning API, Compose CLI builds, build-failure reporting, build E2E coverage and the Terminal-Bench environment harness. ## Design and behavior changes - Extend the planner Request with Mode/Harbor and dispatch directly decoded stdin to runtime or build preparation. Add the `/sandboxes-compose/plan` Prometheus label with this endpoint. - Validate local contexts and Dockerfiles before allocation, then use the existing image-only builder. Preserve explicit variables, profiles, build arguments, target and no-cache settings. - Publish reusable digests by default; optional registry pushes select pushed tags. Write the output atomically after all services succeed. - Preserve the image-only failure wait so buildctl can receive BuildKit's final Solve error. `--harbor` supplies explicit task defaults. ## Compatibility and operations Requires the stack above and matching CLI/server/planner versions. Planning is limited to 30 seconds on the node and has a 60-second gateway timeout. Registry pushes use client credentials; runtime pulls use node credentials. ## Validation On the designated Ubuntu test host as a non-root user with isolated state, after rebasing onto #417: - [x] `make clippy` - [x] `cargo fmt -p aenv -- --check` - [x] `cargo test -p aenv --bin aenv` — 126 passed. - [x] `cargo test -p agentenv --lib compose` / `api::impls::sandbox` / `api::impls::image_build` — 3 / 26 / 24 passed. - [x] `make -C services test fmt-check vet` - [x] `make agentenv-server` — generated files unchanged. The dependency stack separately passed its full unit suite, image build, API lifecycle E2E and CLI E2E. Full build E2E and Terminal-Bench runs were not repeated for this rebase. Workspace formatting retains the known Node line-wrap discrepancy described in #349. ## Risks and reviewer notes Review planning validation, output publication after successful builds, and the image-only failure wait. Images produced before a later service fails follow repository/registry retention policies. ## Checklist - [x] One build-workflow change with focused tests. - [x] Schema and generated code updated together. - [x] Logs and examples contain no credentials or private settings. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#369
No description provided.