Skip to content

Commit 1c1f758

Browse files
authored
Merge pull request #8 from volcengine/fix/fix-some-bug-and-0.1.10
fix/ some bugfix add a2a and enio template and 0.1.10
2 parents 376c725 + e256124 commit 1c1f758

File tree

32 files changed

+1752
-222
lines changed

32 files changed

+1752
-222
lines changed

agentkit/toolkit/builders/ve_pipeline.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from agentkit.toolkit.models import BuildResult, ImageInfo
2727
from agentkit.toolkit.reporter import Reporter
2828
from agentkit.toolkit.errors import ErrorCode
29-
from agentkit.utils.misc import generate_random_id
29+
from agentkit.utils.misc import generate_random_id, calculate_nonlinear_progress
3030
from agentkit.toolkit.volcengine.services import CRServiceConfig
3131
from .base import Builder
3232

@@ -1056,8 +1056,9 @@ def download_and_show_logs(run_id: str):
10561056
self.reporter.info("Waiting for build completion...")
10571057

10581058
# Wait for build completion using reporter's long task interface
1059-
max_wait_time = 600 # 10 minutes
1059+
max_wait_time = 900 # 15 minutes
10601060
check_interval = 3 # Check every 3 seconds
1061+
expected_time = 30 # Controls progress curve speed (smaller = faster initial progress)
10611062
import time
10621063
start_time = time.time()
10631064

@@ -1098,8 +1099,7 @@ def download_and_show_logs(run_id: str):
10981099
download_and_show_logs(run_id)
10991100
raise Exception(error_msg)
11001101

1101-
# Update progress (time-based)
1102-
task.update(completed=min(elapsed_time, max_wait_time))
1102+
task.update(completed=calculate_nonlinear_progress(elapsed_time, max_wait_time, expected_time))
11031103
time.sleep(check_interval)
11041104
else:
11051105
# Unknown status
@@ -1111,8 +1111,7 @@ def download_and_show_logs(run_id: str):
11111111
download_and_show_logs(run_id)
11121112
raise Exception(error_msg)
11131113

1114-
# Update progress
1115-
task.update(completed=min(elapsed_time, max_wait_time))
1114+
task.update(completed=calculate_nonlinear_progress(elapsed_time, max_wait_time, expected_time))
11161115
time.sleep(check_interval)
11171116

11181117
except Exception:

agentkit/toolkit/cli/cli_config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def config_command(
102102
--agent_name myGoAgent \\
103103
--entry_point main.go \\
104104
--language Golang \\
105-
--language_version 1.23
105+
--language_version 1.24
106106
107107
\b
108108
# App-level vs Strategy-level environment variables
@@ -204,16 +204,16 @@ def _interactive_config(config_file: Optional[str] = None):
204204
# Use CLI-layer interactive config generation
205205
from agentkit.toolkit.cli.interactive_config import generate_config_from_dataclass
206206
from agentkit.toolkit.config.strategy_configs import (
207-
LocalDockerConfig,
208-
VeAgentkitConfig,
209-
HybridVeAgentkitConfig
207+
LocalStrategyConfig,
208+
CloudStrategyConfig,
209+
HybridStrategyConfig
210210
)
211211

212212
# Map strategy_name to config class
213213
strategy_config_classes = {
214-
"local": LocalDockerConfig,
215-
"cloud": VeAgentkitConfig,
216-
"hybrid": HybridVeAgentkitConfig,
214+
"local": LocalStrategyConfig,
215+
"cloud": CloudStrategyConfig,
216+
"hybrid": HybridStrategyConfig,
217217
}
218218

219219
# Get current strategy config data

agentkit/toolkit/config/__init__.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
)
2121

2222
from .strategy_configs import (
23-
LocalDockerConfig,
24-
HybridVeAgentkitConfig,
25-
VeAgentkitConfig,
23+
LocalStrategyConfig,
24+
HybridStrategyConfig,
25+
CloudStrategyConfig,
2626
)
2727

2828
from .docker_build_config import (
@@ -45,14 +45,12 @@
4545
from .constants import *
4646

4747
__all__ = [
48-
# 项目配置相关
4948
"AgentkitConfigManager",
5049
"CommonConfig",
5150
"ConfigUpdateResult",
5251
"get_config",
5352
"create_config_update_result",
5453

55-
# 全局配置相关
5654
"GlobalConfig",
5755
"GlobalConfigManager",
5856
"get_global_config",
@@ -63,7 +61,6 @@
6361
"CRGlobalConfig",
6462
"TOSGlobalConfig",
6563

66-
# 常量
6764
"AUTO_CREATE_VE",
6865
"DEFAULT_WORKSPACE_NAME",
6966
"DEFAULT_CR_NAMESPACE",
@@ -72,16 +69,13 @@
7269
"GLOBAL_CONFIG_FILE",
7370
"GLOBAL_CONFIG_FILE_PERMISSIONS",
7471

75-
# 工具函数
7672
"is_valid_config",
7773
"is_invalid_config",
7874
"merge_runtime_envs",
7975

80-
# Strongly 配置类
81-
"LocalDockerConfig",
82-
"HybridVeAgentkitConfig",
83-
"VeAgentkitConfig",
76+
"LocalStrategyConfig",
77+
"HybridStrategyConfig",
78+
"CloudStrategyConfig",
8479

85-
# Docker构建配置
8680
"DockerBuildConfig",
8781
]

agentkit/toolkit/config/config.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ class CommonConfig(AutoSerializableMixin):
4242
entry_point: str = field(
4343
default="",
4444
metadata={
45-
"description": "Agent application entry file (path allowed), e.g. simple_agent.py",
45+
"description": "Agent application entry file (path allowed), e.g. simple_agent.py or main.go or build.sh",
4646
"icon": "📝",
4747
"validation": {
4848
"required": True,
4949
# allow relative paths with directories and either .py or .go endings
50-
"pattern": r"^[\w\-/\.]+?\.(py)$",
51-
"message": "Must be a Python (.py), containing only letters, numbers, underscore(_), hyphen(-), dot(.) and '/' for directories"
50+
"pattern": r"^[\w\-/\.]+?\.(py|go|sh)$",
51+
"message": "Must be a Python (.py) or Go (.go) file path or shell script (.sh), containing only letters, numbers, underscore(_), hyphen(-), dot(.) and '/' for directories"
5252
}
5353
}
5454
)
@@ -58,7 +58,7 @@ class CommonConfig(AutoSerializableMixin):
5858
"icon": "✏️",
5959
"choices": [
6060
{"value": "Python", "description": "Python"},
61-
# {"value": "Golang", "description": "Go (Golang)"}
61+
{"value": "Golang", "description": "Go (Golang)"}
6262
]
6363
})
6464
language_version: str = field(
@@ -74,17 +74,16 @@ class CommonConfig(AutoSerializableMixin):
7474
"choices": ["3.10", "3.11", "3.12", "3.13"],
7575
"message": "Python version must be 3.10, 3.11, 3.12, or 3.13"
7676
},
77-
# "Golang": {
78-
# "pattern": r"^1\.\d+$",
79-
# "message": "Go 版本格式应为 '1.x' (如 1.21, 1.23)",
80-
# "hint": "[格式: 1.x]"
81-
# }
77+
"Golang": {
78+
"choices": ["1.24"],
79+
"message": "Golang version must be '1.24'",
80+
}
8281
}
8382
}
8483
}
8584
)
8685
agent_type: str = field(default="Basic App", metadata={"description" : "Agent application Type", "icon": "📩", "hidden": True})
87-
dependencies_file: str = field(default="requirements.txt", metadata={"description": "Agent application Dependencies file", "icon": "📦"})
86+
dependencies_file: str = field(default="", metadata={"description": "Agent application Dependencies file", "icon": "📦"})
8887
runtime_envs: Dict[str, str] = field(
8988
default_factory=dict,
9089
metadata={
@@ -119,7 +118,7 @@ def _recommended_for_language(language: str) -> Dict[str, str]:
119118
"""Return recommended language_version and dependencies_file for supported languages."""
120119
mapping = {
121120
"python": {"language_version": "3.12", "dependencies_file": "requirements.txt"},
122-
"golang": {"language_version": "1.23", "dependencies_file": "go.mod"},
121+
"golang": {"language_version": "1.24", "dependencies_file": "go.mod"},
123122
}
124123
return mapping.get((language or "python").lower(), mapping["python"])
125124

@@ -153,7 +152,7 @@ def set_language(self, language: str):
153152
lv = (self.language_version or "").strip()
154153
df = (self.dependencies_file or "").strip()
155154

156-
if not lv or lv in ("3.12", "1.23") or lv.startswith("3.") and language.lower() == "go":
155+
if not lv or lv in ("3.12", "1.24") or lv.startswith("3.") and language.lower() == "go":
157156
self.language_version = rec["language_version"]
158157
if not df or df in ("requirements.txt", "go.mod"):
159158
self.dependencies_file = rec["dependencies_file"]
@@ -355,14 +354,14 @@ def _reorder_by_dataclass_fields(self, strategy_name: str, config: Dict[str, Any
355354

356355
config_class = None
357356
if strategy_name == "local":
358-
from agentkit.toolkit.config import LocalDockerConfig
359-
config_class = LocalDockerConfig
357+
from agentkit.toolkit.config import LocalStrategyConfig
358+
config_class = LocalStrategyConfig
360359
elif strategy_name == "cloud":
361-
from agentkit.toolkit.config import VeAgentkitConfig
362-
config_class = VeAgentkitConfig
360+
from agentkit.toolkit.config import CloudStrategyConfig
361+
config_class = CloudStrategyConfig
363362
elif strategy_name == "hybrid":
364-
from agentkit.toolkit.config import HybridVeAgentkitConfig
365-
config_class = HybridVeAgentkitConfig
363+
from agentkit.toolkit.config import HybridStrategyConfig
364+
config_class = HybridStrategyConfig
366365
else:
367366
return config
368367

agentkit/toolkit/config/docker_build_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DockerBuildConfig(AutoSerializableMixin):
3636
Go project with multi-stage build:
3737
>>> docker_build:
3838
>>> base_image:
39-
>>> builder: "golang:1.23-alpine"
39+
>>> builder: "golang:1.24-alpine"
4040
>>> runtime: "alpine:latest"
4141
>>> build_script: "scripts/install_certs.sh"
4242
"""
@@ -48,7 +48,7 @@ class DockerBuildConfig(AutoSerializableMixin):
4848
"detail": (
4949
"For Python projects, use a string like 'python:3.12-alpine'. "
5050
"For Go projects, use a dict with 'builder' and 'runtime' keys, "
51-
"e.g., {'builder': 'golang:1.23-alpine', 'runtime': 'alpine:latest'}"
51+
"e.g., {'builder': 'golang:1.24-alpine', 'runtime': 'alpine:latest'}"
5252
)
5353
}
5454
)

agentkit/toolkit/config/global_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,19 +301,19 @@ def apply_global_config_defaults(
301301
302302
Example:
303303
>>> # project config has empty cr_instance_name
304-
>>> config = HybridVeAgentkitConfig.from_dict({"cr_instance_name": ""})
304+
>>> config = HybridStrategyConfig.from_dict({"cr_instance_name": ""})
305305
>>> # apply_global_config_defaults will fill from global config if set
306306
>>> # config.cr_instance_name = "my-team-cr-instance" (from global config)
307307
"""
308308
# Lazy imports to avoid circular dependencies
309309
try:
310-
from .strategy_configs import HybridVeAgentkitConfig, VeAgentkitConfig
310+
from .strategy_configs import HybridStrategyConfig, CloudStrategyConfig
311311
except ImportError as e:
312312
logger.debug(f"Failed to import strategy config classes, skip applying global config defaults: {e}")
313313
return config_obj
314314

315315
# Only handle strategy config classes
316-
if not isinstance(config_obj, (HybridVeAgentkitConfig, VeAgentkitConfig)):
316+
if not isinstance(config_obj, (HybridStrategyConfig, CloudStrategyConfig)):
317317
return config_obj
318318

319319
try:
@@ -327,7 +327,7 @@ def apply_global_config_defaults(
327327
}
328328

329329
# For VeAgentkitConfig, also apply TOS-related settings
330-
if isinstance(config_obj, VeAgentkitConfig):
330+
if isinstance(config_obj, CloudStrategyConfig):
331331
field_mappings.update({
332332
'tos_bucket': ('tos', 'bucket'),
333333
'tos_prefix': ('tos', 'prefix'),

agentkit/toolkit/config/strategy_configs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
@dataclass
8-
class LocalDockerConfig(AutoSerializableMixin):
8+
class LocalStrategyConfig(AutoSerializableMixin):
99
"""Local Docker strategy configuration for running agents in Docker containers."""
1010
# User-configurable fields
1111
image_tag: str = field(default="latest", metadata={"description": "Docker image tag", "icon": "🏷️"})
@@ -33,7 +33,7 @@ class LocalDockerConfig(AutoSerializableMixin):
3333
}
3434
)
3535
_config_metadata = {
36-
'name': 'Local Docker Configuration',
36+
'name': 'Local Strategy Configuration',
3737
'welcome_message': 'Welcome to AgentKit Local Docker Mode Configuration Wizard',
3838
'next_step_hint': 'This wizard will help you configure your agent for local Docker deployment. Please provide the required information or press Enter to use default values.',
3939
'completion_message': 'Great! Local Docker configuration is complete!',
@@ -42,7 +42,7 @@ class LocalDockerConfig(AutoSerializableMixin):
4242

4343

4444
@dataclass
45-
class HybridVeAgentkitConfig(AutoSerializableMixin):
45+
class HybridStrategyConfig(AutoSerializableMixin):
4646
"""Hybrid deployment strategy configuration combining local Docker and Volcano Engine services."""
4747
# User-configurable fields
4848
image_tag: str = field(default=DEFAULT_IMAGE_TAG, metadata={"system": True, "description": "Docker image tag", "icon": "🏷️", "render_template": True})
@@ -77,7 +77,7 @@ class HybridVeAgentkitConfig(AutoSerializableMixin):
7777
}
7878
)
7979
_config_metadata = {
80-
'name': 'Hybrid Deployment Configuration',
80+
'name': 'Hybrid Strategy Configuration',
8181
'welcome_message': 'Welcome to AgentKit Hybrid Deployment Mode Configuration Wizard',
8282
'next_step_hint': 'This wizard will help you configure your agent for hybrid deployment combining local Docker and Volcano Engine services. Please provide the required information or press Enter to use default values.',
8383
'completion_message': 'Great! Hybrid deployment configuration is complete!',
@@ -87,7 +87,7 @@ class HybridVeAgentkitConfig(AutoSerializableMixin):
8787

8888

8989
@dataclass
90-
class VeAgentkitConfig(AutoSerializableMixin):
90+
class CloudStrategyConfig(AutoSerializableMixin):
9191
"""Cloud build and deployment strategy configuration for Volcano Engine."""
9292
region: str = field(
9393
default="cn-beijing",

agentkit/toolkit/config/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ def merge_runtime_envs(common_config: Any, strategy_config: Dict[str, Any]) -> D
4949
if isinstance(strategy_level_envs, dict):
5050
merged_envs.update(strategy_level_envs)
5151

52-
return merged_envs
52+
return merged_envs

agentkit/toolkit/executors/base_executor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ def _get_strategy_config_object(self, config, launch_type: str, skip_render: boo
243243
strategy_config_dict = config.get_strategy_config(launch_type)
244244

245245
if launch_type == "local":
246-
from agentkit.toolkit.config import LocalDockerConfig
247-
return LocalDockerConfig.from_dict(strategy_config_dict, skip_render=skip_render)
246+
from agentkit.toolkit.config import LocalStrategyConfig
247+
return LocalStrategyConfig.from_dict(strategy_config_dict, skip_render=skip_render)
248248
elif launch_type == "cloud":
249-
from agentkit.toolkit.config import VeAgentkitConfig
250-
return VeAgentkitConfig.from_dict(strategy_config_dict, skip_render=skip_render)
249+
from agentkit.toolkit.config import CloudStrategyConfig
250+
return CloudStrategyConfig.from_dict(strategy_config_dict, skip_render=skip_render)
251251
elif launch_type == "hybrid":
252-
from agentkit.toolkit.config import HybridVeAgentkitConfig
253-
return HybridVeAgentkitConfig.from_dict(strategy_config_dict, skip_render=skip_render)
252+
from agentkit.toolkit.config import HybridStrategyConfig
253+
return HybridStrategyConfig.from_dict(strategy_config_dict, skip_render=skip_render)
254254
else:
255255
raise ValueError(f"Unknown launch_type: {launch_type}")
256256

0 commit comments

Comments
 (0)