Skip to content

Add din_integration/: SWE-bench DinD evaluation pipeline integration - #456

Open
Huafubing wants to merge 1 commit into
AISBench:masterfrom
Huafubing:integration/din-integration
Open

Add din_integration/: SWE-bench DinD evaluation pipeline integration#456
Huafubing wants to merge 1 commit into
AISBench:masterfrom
Huafubing:integration/din-integration

Conversation

@Huafubing

@Huafubing Huafubing commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

PR Type / PR类型

  • Feature(功能新增)
  • Other(其他)

Related Issue | 关联 Issue
N/A (新功能集成,无关联 issue)

🔍 Motivation / 变更动机

mini_matrix 项目中已经验证过的 SWE-bench DinD (Docker-in-Docker) 多 agent × 多 case 评测流水线整包集成进 AISBench 仓库。

SWE-bench Verified 类评测需要一个完整的容器编排栈(harbor CLI + DinD 镜像 + 多层 L1/L2/L3/L4/L5 镜像 + bind-mount 数据持久化),而 AISBench 现有的 ais_bench.benchmark_plugins plugin 机制只支持"pip install 后单文件 import 即用"的轻量集成,无法承载这种重量级管线。

本 PR 的目标:先把内容 PR 到 AISBench 仓内,作为根目录下的独立子目录 din_integration/。后续如需升级为标准 plugin,可在本 PR 基础上加 setup.py + entry_points(已在 din_integration/README.md 中标注)。

关联设计文档 (在本仓 docs/research/):

  • 23-swebench-dind-integration-into-aisbench-2026-08.md — 方案 B 设计文档(完整版)
  • 24-swebench-dind-integration-plan-A-slim-2026-08.md — 方案 A 设计文档(精简版,即本 PR 依据)

📝 Modification / 修改内容

新增 din_integration/ 子目录,未修改 AISBench 任何既有文件:

din_integration/ ← 新增 (30 files / +3,080 LOC)
├── README.md ← 路径假设 + 使用说明
├── pyproject.toml ← 包描述 (name=swebench-dind)
├── bin/swebench-dind ← shell wrapper
├── docs/
│ ├── CLI-USAGE.md ← CLI 完整命令参考
│ └── MIGRATION.md ← 老脚本 → CLI 对照表
├── swebench_dind/ ← 核心 Python 包 (~1,900 LOC)
│ ├── cli.py ← Typer 7 子命令入口
│ ├── config.py ← 单一真相源(常量 + tag 推导)
│ ├── container.py ← DinD 容器生命周期
│ ├── builder.py ← L3/L4 镜像烤制 (Jinja2)
│ ├── launcher.py ← harbor jobs start 拼装 + Rich 进度
│ ├── patcher.py ← idempotent install probe 注入
│ ├── summarizer.py ← result.json → md/csv/json
│ ├── dockerfiles/ ← L1/L2 Dockerfile 模板 (5 个 .j2)
│ └── aisbench_adapter/ ← AISBench BaseTask 适配
│ ├── task.py ← SwebenchDindTask (BaseTask 子类)
│ ├── runner.py ← subprocess 入口
│ └── result_writer.py ← harbor → AISBench schema
├── configs/
│ ├── matrix.yaml ← Harbor JobConfig (15 task × 4 agent)
│ └── swebench_dind_3x3.py ← AISBench config 示例 (3 cases × 3 agents)
└── scripts/
├── start_orchestrator.sh ← 启 DinD 容器 + bind mount
├── summarize.py ← 汇总 jobs/*/result.json
├── filter_matrix.py ← 子集过滤
├── setup.sh ← host runtime 目录创建 helper
└── api_key.env.template ← OPENAI_API_KEY 配置模板

📐 Associated Test Results / 关联测试结果

本 PR 已在本地 mini_matrix/ 完成端到端验证:

  • 历史 trial: 12 trial history,9 PASS / 75% pass@1
  • e2e CLI 验证: swebench-dind launch trial --case 11099 --agent aider --waitPASS(4min 49s)
  • 测试矩阵: 1 case × 1 agent × 1 model(Qwen3-Coder-30B)
  • 覆盖 agent: aider / mini-swe-agent / qwen-coder / openhands(均在 L2 镜像模板中)
  • 覆盖 model: Qwen3-Coder-30B-A3B-Instruct (via siliconflow API)

注:本 PR 是"内容搬运",不在 AISBench CI 中运行din_integration/ 是独立的 Python 包 + 脚本集合,与 AISBench 主代码无运行时耦合。如需在 AISBench CI 中验证,需要额外的 docker-in-docker runner 配置,需与维护者讨论。

⚠️ BC-breaking (Optional) / 向后不兼容变更(可选)

。本 PR 仅新增 din_integration/ 子目录,未修改 AISBench 任何既有代码(ais_bench/tests/setup.pyplugin_examples/ 全部 untouched)。下游项目不受影响。

⚠️ Performance degradation (Optional) / 性能下降(可选)

din_integration/ 子目录不参与 AISBench 主代码的 import 路径,运行时也不会被加载(pyproject.toml 中未声明 AISBench 为依赖,本包是独立可 pip install 的 Python 包)。

🌟 Use cases (Optional) / 使用案例(可选)

用例 1: 多 agent × 多 case SWE-bench Verified 评测矩阵

cd din_integration
pip install -e .
bash scripts/start_orchestrator.sh              # 启 DinD 容器
swebench-dind launch trial --case 11099 --agent aider --wait
swebench-dind launch trial --case 11099 --agent mini-swe-agent --wait
swebench-dind launch trial --case 12308 --agent aider --wait
# ...
swebench-dind summarize                         # 汇总 jobs/*/result.json
用例 2: 通过 AISBench config 接入 (3 cases × 3 agents = 9 trials)


pip install ais_bench
cd din_integration && pip install -e .
ais_bench din_integration/configs/swebench_dind_3x3.py
用例 3: 镜像烤制 (L1 base + L2 agent变体)


swebench-dind bake base # L1 harbor-base
swebench-dind bake agent --agent aider # L2 harbor-runtime + aider
swebench-dind bake agent --agent msa          # L2 + mini-swe-agent
✅ Checklist / 检查列表
Before PR:

 Pre-commit or other linting tools are used to fix the potential lint issues. 本地 ruff check swebench_dind/ 通过;pre-commit 在上游 ais_bench repo 配置,本 PR 未运行(因本包与 ais_bench 主代码无 import 耦合)
 Bug fixes are fully covered by unit tests... N/A (本 PR 无 bugfix)
 The modification is covered by complete unit tests... 本 PR 是新功能集成,未在本仓内新增 unit tests。功能测试在 mini_matrix/tests/ 中已覆盖(详见下方说明)
 All relevant documentation... 本 PR 含 docs/CLI-USAGE.md + docs/MIGRATION.md + 顶层 README.md,完整记录 CLI 用法与迁移说明
After PR:

 If the modification has potential influence on downstream... N/A (新增子目录,与下游无耦合)
 CLA has been signed... Commit author: zengziyu / Huafubing (本地 git identity 已设);CLA 状态请维护者确认
👥 Collaboration Info / 协作信息
Suggested Reviewers / 建议审核人: 不熟悉 AISBench 维护者构成,请维护者自行指派
Relevant Module Owners / 相关模块负责人: 不熟悉,请维护者自行指派
Other Collaboration Notes / 其他协作说明:
本 PR 不通过 setup.py entry_point 注册到 ais_bench.benchmark_plugins —— 详见 din_integration/README.md §"📦 跟 AISBench 的集成方式"。本包是重量级 CLI + DinD 镜像集成,不是单文件 import 即可用的传统 plugin。
路径硬编码:launcher.py:58 中 api_key.env 仍指向 /home/zengziyu/mini_matrix/scripts/api_key.env,env-var 重构推迟到后续 PR(README 中已列)。本 PR 目标是先把内容 PR 上,非完美化路径。
本地验证(mini_matrix/)独立于 AISBench,所有 trial 数据、测试报告、镜像 tag 在本地仓库。如下游需在 AISBench CI 中复现验证,请告知需添加的 CI步骤。

This PR adds a self-contained 'din_integration/' subdirectory containing the
swebench-dind CLI, AISBench adapter, image build templates, configuration
files, and host setup scripts for running SWE-bench Verified evaluations
in a Docker-in-Docker setup.

Includes:
- swebench_dind/ Python package (~1,900 LOC): unified CLI for orchestrator
  lifecycle, image baking (L1/L2), trial launch, result aggregation,
  and harbor agent-patch injection
- aisbench_adapter/: SwebenchDindTask BaseTask subclass for AISBench config
- configs/: matrix.yaml (Harbor JobConfig) + swebench_dind_3x3.py
  (AISBench example config)
- scripts/: start_orchestrator.sh, summarize.py, filter_matrix.py,
  setup.sh, api_key.env.template
- docs/: CLI-USAGE.md, MIGRATION.md
- bin/swebench-dind: shell wrapper

This is a minimum-workload PR submitted per the design documented at
/docs/research/24-swebench-dind-integration-plan-A-slim-2026-08.md and
/23-swebench-dind-integration-into-aisbench-2026-08.md. Path env-var
refactor is intentionally deferred to keep this PR focused on content
delivery; see din_integration/README.md for current path assumptions.

Verified locally: 12 trial history (9 PASS / 75% pass@1) +
1 e2e-cli-11099-aider PASS (4min 49s).
@Huafubing
Huafubing marked this pull request as draft August 12, 2026 06:46
@Huafubing
Huafubing marked this pull request as ready for review August 12, 2026 06:46
@Huafubing
Huafubing marked this pull request as draft August 12, 2026 06:46
@Huafubing
Huafubing marked this pull request as ready for review August 12, 2026 06:47
@Huafubing

Copy link
Copy Markdown
Contributor Author

/pr_check

@github-actions github-actions Bot added large_pr PR 新增代码超过 1000 行,建议拆分为更小的 PR no_issue PR 未关联任何 Issue,合入前必须关联 Issue no_review PR 未包含任何检视意见,合入前必须包含检视意见 labels Aug 12, 2026
@github-actions

Copy link
Copy Markdown

🚫 PR 合入质量检查未通过,PR 已被禁止合入。

未通过项:large_prno_issueno_review

  • 超大 PR:新增代码 3080 行,超过 1000 行上限,建议拆分。
  • 未关联 Issue:请在 PR 描述中关联 Issue,例如 Fixes #123Relates to #123
  • 无检视意见:请至少邀请一位 reviewer 提交检视意见(Approve / Request changes / Comment 均可)。

请按上述提示整改后,重新推送(push)或评论本 PR 即可触发再次检查。

@Huafubing

Copy link
Copy Markdown
Contributor Author

/pr_check

@github-actions

Copy link
Copy Markdown

🚫 PR 合入质量检查未通过,PR 已被禁止合入。

未通过项:large_prno_issueno_review

  • 超大 PR:新增代码 3080 行,超过 1000 行上限,建议拆分。
  • 未关联 Issue:请在 PR 描述中关联 Issue,例如 Fixes #123Relates to #123
  • 无检视意见:请至少邀请一位 reviewer 提交检视意见(Approve / Request changes / Comment 均可)。

请按上述提示整改后,重新推送(push)或评论本 PR 即可触发再次检查。

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

Labels

large_pr PR 新增代码超过 1000 行,建议拆分为更小的 PR no_issue PR 未关联任何 Issue,合入前必须关联 Issue no_review PR 未包含任何检视意见,合入前必须包含检视意见 other

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant