Skip to content

Commit 68d5bcc

Browse files
Copilotnotfolder
andauthored
Implement multi-language execution environment selection during planning phase (#112)
* Initial plan * Implement multi-language execution environment support - Add 5 language-specific Dockerfiles (python, miniforge, node, java, go) - Update docker-compose.yml with executor-build profile services - Add environments config to config.yaml with image mappings - Extend ExecutionEnvironmentManager with environment selection - Add environment_name attribute to ContainerInfo - Extend PlanningCoordinator with environment selection prompt - Update system_prompt_command_executor.txt with library guide - Add comprehensive unit tests for new functionality Co-authored-by: notfolder <20558197+notfolder@users.noreply.github.com> * Address code review feedback - Improve git installation logic in prepare() method - Return (container_id, is_custom_image) tuple from _create_container() - Import DEFAULT_ENVIRONMENTS constant in planning_coordinator.py - Update unit tests for new return type Co-authored-by: notfolder <20558197+notfolder@users.noreply.github.com> * 実行環境の準備を計画フェーズに基づいて遅延させる機能を追加 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: notfolder <20558197+notfolder@users.noreply.github.com> Co-authored-by: notfolder <notfolder@gmail.com>
1 parent 6739078 commit 68d5bcc

13 files changed

Lines changed: 1216 additions & 251 deletions

File tree

config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,18 @@ command_executor:
364364
# 環境変数 COMMAND_EXECUTOR_ENABLED で上書き可能
365365
enabled: true
366366

367+
# 利用可能な実行環境(環境名: イメージ名)
368+
# 計画フェーズでLLMがプロジェクトに適した環境を選択します
369+
environments:
370+
python: "coding-agent-executor-python:latest"
371+
miniforge: "coding-agent-executor-miniforge:latest"
372+
node: "coding-agent-executor-node:latest"
373+
java: "coding-agent-executor-java:latest"
374+
go: "coding-agent-executor-go:latest"
375+
376+
# デフォルト環境(環境選択に失敗した場合)
377+
default_environment: "python"
378+
367379
# MCP Server設定
368380
mcp_server:
369381
# サーバー名
@@ -376,6 +388,7 @@ command_executor:
376388
# Docker実行環境設定
377389
docker:
378390
# ベースイメージ(環境変数 EXECUTOR_BASE_IMAGE で上書き可能)
391+
# ※environments設定が優先されます。環境選択に失敗した場合のフォールバック用
379392
base_image: "ubuntu:25.04"
380393

381394
# リソース制限

docker-compose.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,60 @@ services:
232232
retries: 3
233233
start_period: 30s
234234

235+
# === 実行環境イメージ(ビルド専用、executor-buildプロファイル) ===
236+
# 計画フェーズでLLMが選択する実行環境イメージ
237+
# ビルドコマンド: docker compose --profile executor-build build
238+
239+
# Python実行環境イメージ
240+
executor-python:
241+
build:
242+
context: ./docker/executor-python
243+
dockerfile: Dockerfile
244+
image: coding-agent-executor-python:latest
245+
profiles:
246+
- executor-build
247+
command: ["echo", "Build only"]
248+
249+
# Miniforge(conda)実行環境イメージ
250+
executor-miniforge:
251+
build:
252+
context: ./docker/executor-miniforge
253+
dockerfile: Dockerfile
254+
image: coding-agent-executor-miniforge:latest
255+
profiles:
256+
- executor-build
257+
command: ["echo", "Build only"]
258+
259+
# Node.js実行環境イメージ
260+
executor-node:
261+
build:
262+
context: ./docker/executor-node
263+
dockerfile: Dockerfile
264+
image: coding-agent-executor-node:latest
265+
profiles:
266+
- executor-build
267+
command: ["echo", "Build only"]
268+
269+
# Java実行環境イメージ
270+
executor-java:
271+
build:
272+
context: ./docker/executor-java
273+
dockerfile: Dockerfile
274+
image: coding-agent-executor-java:latest
275+
profiles:
276+
- executor-build
277+
command: ["echo", "Build only"]
278+
279+
# Go実行環境イメージ
280+
executor-go:
281+
build:
282+
context: ./docker/executor-go
283+
dockerfile: Dockerfile
284+
image: coding-agent-executor-go:latest
285+
profiles:
286+
- executor-build
287+
command: ["echo", "Build only"]
288+
235289
volumes:
236290
rabbitmq_data:
237291
user-config-data:

docker/executor-go/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Go実行環境イメージ
2+
# Goプロジェクト用のDockerイメージ
3+
FROM golang:1.22-bookworm
4+
5+
# 共通パッケージのインストール
6+
# git: バージョン管理
7+
# curl/wget: ファイルダウンロード
8+
# jq: JSON処理
9+
# tree: ディレクトリ構造表示
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
git \
12+
curl \
13+
wget \
14+
jq \
15+
tree \
16+
ca-certificates \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# 作業ディレクトリの設定
20+
WORKDIR /workspace
21+
22+
# プロジェクト配置用ディレクトリを作成
23+
RUN mkdir -p /workspace/project
24+
25+
# コンテナを永続実行するためのENTRYPOINT
26+
ENTRYPOINT ["sleep", "infinity"]

docker/executor-java/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Java実行環境イメージ
2+
# Java/Kotlinプロジェクト用のDockerイメージ
3+
FROM eclipse-temurin:21-jdk-jammy
4+
5+
# 共通パッケージのインストール
6+
# git: バージョン管理
7+
# curl/wget: ファイルダウンロード
8+
# jq: JSON処理
9+
# tree: ディレクトリ構造表示
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
git \
12+
curl \
13+
wget \
14+
jq \
15+
tree \
16+
ca-certificates \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# 作業ディレクトリの設定
20+
WORKDIR /workspace
21+
22+
# プロジェクト配置用ディレクトリを作成
23+
RUN mkdir -p /workspace/project
24+
25+
# コンテナを永続実行するためのENTRYPOINT
26+
ENTRYPOINT ["sleep", "infinity"]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Miniforge(conda)実行環境イメージ
2+
# 科学計算・データサイエンスプロジェクト用のDockerイメージ
3+
FROM condaforge/miniforge3:latest
4+
5+
# 共通パッケージのインストール
6+
# git: バージョン管理
7+
# curl/wget: ファイルダウンロード
8+
# jq: JSON処理
9+
# tree: ディレクトリ構造表示
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
git \
12+
curl \
13+
wget \
14+
jq \
15+
tree \
16+
ca-certificates \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# 作業ディレクトリの設定
20+
WORKDIR /workspace
21+
22+
# プロジェクト配置用ディレクトリを作成
23+
RUN mkdir -p /workspace/project
24+
25+
# condaの初期設定
26+
RUN conda init bash
27+
28+
# コンテナを永続実行するためのENTRYPOINT
29+
ENTRYPOINT ["sleep", "infinity"]

docker/executor-node/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Node.js実行環境イメージ
2+
# JavaScript/TypeScriptプロジェクト用のDockerイメージ
3+
FROM node:20-slim
4+
5+
# 共通パッケージのインストール
6+
# git: バージョン管理
7+
# curl/wget: ファイルダウンロード
8+
# jq: JSON処理
9+
# tree: ディレクトリ構造表示
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
git \
12+
curl \
13+
wget \
14+
jq \
15+
tree \
16+
ca-certificates \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# 作業ディレクトリの設定
20+
WORKDIR /workspace
21+
22+
# プロジェクト配置用ディレクトリを作成
23+
RUN mkdir -p /workspace/project
24+
25+
# コンテナを永続実行するためのENTRYPOINT
26+
ENTRYPOINT ["sleep", "infinity"]

docker/executor-python/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Python実行環境イメージ
2+
# コーディングエージェントの実行環境として使用するPython用Dockerイメージ
3+
FROM python:3.11-slim-bookworm
4+
5+
# 共通パッケージのインストール
6+
# git: バージョン管理
7+
# curl/wget: ファイルダウンロード
8+
# jq: JSON処理
9+
# tree: ディレクトリ構造表示
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
git \
12+
curl \
13+
wget \
14+
jq \
15+
tree \
16+
ca-certificates \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# 作業ディレクトリの設定
20+
WORKDIR /workspace
21+
22+
# プロジェクト配置用ディレクトリを作成
23+
RUN mkdir -p /workspace/project
24+
25+
# コンテナを永続実行するためのENTRYPOINT
26+
ENTRYPOINT ["sleep", "infinity"]

0 commit comments

Comments
 (0)