feat(sdk): add ComposeJobConfig for multi-container docker-compose jobs (#1079)#1080
Open
xdlkc wants to merge 4 commits into
Open
feat(sdk): add ComposeJobConfig for multi-container docker-compose jobs (#1079)#1080xdlkc wants to merge 4 commits into
xdlkc wants to merge 4 commits into
Conversation
StephenRi
reviewed
Jun 10, 2026
| # ── helpers ─────────────────────────────────────────────────────────────────── | ||
|
|
||
|
|
||
| def _resource_args(res: ResourceSpec | None) -> list[str]: |
8963236 to
d69c3ef
Compare
Implement ComposeJobConfig + ComposeTrial to run multi-container topologies (main + sidecars + init containers) inside a single DinD sandbox, orchestrated by a generated runner.sh via the docker CLI. - config: ComposeSpec/MainContainerSpec/SidecarSpec/InitContainerSpec with resources(request/limit), command/args, privileged, secret_env, oss_deps, health probes, volume_mounts(host_path); from_yaml detects "compose" key - trial: 7-phase runner.sh (dockerd start with kata fixes -> oss deps -> init -> sidecars -> health probe -> main -> collect/cleanup); secrets rendered as shell var refs; /rock/scripts bind-mounted into inner containers - examples/job/compose: end-to-end harbor demo (verified against real backend up to harbor dataset download; only OSS creds missing) End-to-end verified on ROCK kata backend: sandbox -> dockerd -> proxy sidecar -> health ready -> main container -> harbor CLI running. Co-Authored-By: Claude Code <noreply@anthropic.com> AI-Model: claude-opus-4-8 AI-Contributed/Feature: 2477/2477 AI-Contributed/UT: 1233/1233
harbor_compose_demo.py + .env.example: env-var driven demo for running the harbor task (claude-code / aone-bench-java100) via ComposeJobConfig, with all real-backend fixes baked in. User only fills credentials (incl. OSS) to run. Co-Authored-By: Claude Code <noreply@anthropic.com> AI-Model: claude-opus-4-8 AI-Contributed/Feature: 240/240 AI-Contributed/UT: 0/0
…ompose.yaml) Migrate from custom compose block with hand-written runner.sh orchestration to standard docker-compose.yaml with native `docker compose up`. ROCK now only bootstraps DinD dockerd and delegates all container orchestration to compose, drastically reducing config surface and runner.sh complexity. Co-Authored-By: Claude Code <noreply@anthropic.com> AI-Model: claude-opus-4-6 AI-Contributed/Feature: 1791/1791 AI-Contributed/UT: 1342/1342
Co-Authored-By: Claude Code <noreply@anthropic.com> AI-Model: claude-opus-4-6 AI-Contributed/Feature: 0/6 AI-Contributed/UT: 0/0
d69c3ef to
0400514
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
ComposeJobConfig+ComposeTrialto run multi-container topologies (main + sidecars + init containers) inside a single DinD sandbox, orchestrated by a generatedrunner.shvia the docker CLI.closes #1079
Design
composeblock (peer ofenvironment): keeps the two layers distinct —environment(SandboxConfig) describes the outer DinD sandbox,compose.*describes the inner containers.script_pathis the main container entry;environmentunchanged.from_yamldetects thecomposekey (Harbor → Compose → Bash); existing Bash/Harbor YAML unaffected (allextra=forbid).Data model (
rock/sdk/job/compose/config.py)ResourceSpec(cpus/memory + cpu_limit/memory_limit), VolumeMount(name/mount_path/main_mount_path/host_path), SecretEnvEntry, OssDep, HealthSpec, _ContainerBase(script/script_path/command/args/env/secret_env/resources/privileged), Init/Sidecar/MainContainerSpec, ComposeSpec, ComposeJobConfig (proxy-conflict + resource-budget validators).
Trial + runner.sh (
rock/sdk/job/compose/trial.py)7-phase
runner.sh: start dockerd → oss deps → init (serial) → sidecars (detached, --network-alias) → health probe → main (foreground) → collect/cleanup. Secrets rendered as shell var refs (never literal);/rock/scriptsbind-mounted into inner containers; all user values shlex-quoted.End-to-end verified
Run on the real ROCK kata backend. Verified chain:
Fixed 4 issues only reproducible on the real backend:
DOCKER_IGNORE_BR_NETFILTER_ERROR=1/rock/scriptsmount + reuse outer dockerd via mounted docker.sock(Full harbor eval needs OSS dataset credentials, which are environment-specific.)
Tests
tests/unit/sdk/job/test_compose_config.py+test_trial_compose.py— 337 job unit tests pass (incl. Bash/Harbor regression), lint clean.Examples
examples/job/compose/harbor_compose_demo.py(+.env.example) — ready-to-run harbor demo, credentials via env vars.🤖 Generated with Claude Code