1515 */
1616package com .alibaba .cloud .ai .dataagent .properties ;
1717
18- import com .alibaba .cloud .ai .dataagent .enums .CodePoolExecutorEnum ;
1918import lombok .Getter ;
2019import lombok .Setter ;
2120import org .springframework .boot .context .properties .ConfigurationProperties ;
2221
22+ import java .time .Duration ;
23+
2324import static com .alibaba .cloud .ai .dataagent .constant .Constant .PROJECT_PROPERTIES_PREFIX ;
2425
2526/**
@@ -34,94 +35,59 @@ public class CodeExecutorProperties {
3435 public static final String CONFIG_PREFIX = PROJECT_PROPERTIES_PREFIX + ".code-executor" ;
3536
3637 /**
37- * Specify implementation class of code container pool runtime service
38+ * Maximum container memory, in MB
3839 */
39- CodePoolExecutorEnum codePoolExecutor = CodePoolExecutorEnum . DOCKER ;
40+ Long limitMemory = 500L ;
4041
4142 /**
42- * Service host, use default address if null
43+ * Number of container CPU cores
4344 */
44- String host = null ;
45+ Long cpuCore = 1L ;
4546
4647 /**
47- * Image name, can customize image with common third-party dependencies to replace
48- * this configuration
48+ * Python code execution time limit
4949 */
50- String imageName = "continuumio/anaconda3:latest" ;
50+ Duration codeTimeout = Duration . ofSeconds ( 60 ) ;
5151
5252 /**
53- * Container name prefix
53+ * Python执行的最大重试次数
5454 */
55- String containerNamePrefix = "nl2sql-python-exec-" ;
55+ Integer pythonMaxTriesCount = 5 ;
5656
57- /**
58- * Task blocking queue size
59- */
60- Integer taskQueueSize = 5 ;
57+ private Sandbox sandbox = new Sandbox ();
6158
62- /**
63- * Maximum number of core containers
64- */
65- Integer coreContainerNum = 2 ;
59+ @ Getter
60+ @ Setter
61+ public static class Sandbox {
6662
67- /**
68- * Maximum number of temporary containers
69- */
70- Integer tempContainerNum = 2 ;
63+ String dockerHost = "unix:///var/run/docker.sock" ;
7164
72- /**
73- * Core thread count of thread pool
74- */
75- Integer coreThreadSize = 5 ;
65+ String imageName = "agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/runtime-sandbox-base:latest" ;
7666
77- /**
78- * Maximum thread count of thread pool
79- */
80- Integer maxThreadSize = 5 ;
67+ String containerPrefix = "dataagent-sandbox-" ;
8168
82- /**
83- * Survival time of temporary containers, in minutes
84- */
85- Integer tempContainerAliveTime = 5 ;
69+ Integer maxConcurrency = 4 ;
8670
87- /**
88- * Task survival time of thread pool, in seconds
89- */
90- Long keepThreadAliveTime = 60L ;
71+ Integer queueCapacity = 10 ;
9172
92- /**
93- * Task blocking queue size of thread pool
94- */
95- Integer threadQueueSize = 10 ;
73+ Integer maxCodeBytes = 256 * 1024 ;
9674
97- /**
98- * Maximum container memory, in MB
99- */
100- Long limitMemory = 500L ;
75+ Integer maxInputBytes = 10 * 1024 * 1024 ;
10176
102- /**
103- * Number of container CPU cores
104- */
105- Long cpuCore = 1L ;
77+ Integer maxOutputBytes = 1024 * 1024 ;
10678
107- /**
108- * Python code execution time limit
109- */
110- String codeTimeout = "60s" ;
79+ Integer maxErrorBytes = 256 * 1024 ;
11180
112- /**
113- * Maximum container runtime
114- */
115- Long containerTimeout = 3000L ;
81+ Integer maxMetadataBytes = 8 * 1024 ;
11682
117- /**
118- * Container network mode
119- */
120- String networkMode = "none" ;
83+ Integer maxDependencies = 20 ;
12184
122- /**
123- * Python执行的最大重试次数
124- */
125- Integer pythonMaxTriesCount = 5 ;
85+ String packageIndexUrl = "https://pypi.org/simple" ;
86+
87+ Duration dependencyInstallTimeout = Duration .ofMinutes (3 );
88+
89+ Integer maxConnections = 4096 ;
90+
91+ }
12692
12793}
0 commit comments