Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
132 lines (127 loc) · 4.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
132 lines (127 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
x-common: &common
restart: always
# Operators must pre-create and validate the aggregate/delegated cgroups and
# bounded Runtime filesystems. Compose and the validation scripts never
# manufacture them.
services:
bot:
image: csust/csust-got:latest
container_name: bot
<<: *common
restart: always
depends_on:
- redis
- agent-runtime
volumes:
- ./config.yaml:/app/config.yaml
- ./logs:/app/logs
- type: bind
source: ./agent-sessions
target: /app/data/agent-sessions
bind:
create_host_path: false
ports:
- "7777:7777"
environment:
- AGENT_RUNTIME_TOKEN=${AGENT_RUNTIME_TOKEN:?AGENT_RUNTIME_TOKEN must be set and non-empty}
- TZ=${BOT_TZ:-Asia/Shanghai}
networks:
- bot-runtime-control
- bot-data
- bot-egress
agent-runtime:
build:
context: .
dockerfile: agent-runtime/Dockerfile
target: runtime
container_name: agent-runtime
init: true
<<: *common
# Sibling migration requires source and target to be reachable in one cgroup namespace.
cgroup: host
cgroup_parent: ${AGENT_RUNTIME_CGROUP_PARENT:?host aggregate cgroup parent is required}
pids_limit: 512
mem_limit: 1g
memswap_limit: 1g
cpus: 2.0
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
ulimits:
nofile:
soft: 256
hard: 4096
tmpfs:
- /tmp:rw,exec,nosuid,nodev,size=64m,mode=1777
environment:
- AGENT_RUNTIME_TOKEN=${AGENT_RUNTIME_TOKEN:?AGENT_RUNTIME_TOKEN must be set and non-empty}
- AGENT_RUNTIME_WORKSPACE_ROOT=/runtime/workspaces
- AGENT_RUNTIME_WORKSPACE_MAX_BYTES=${AGENT_RUNTIME_WORKSPACE_MAX_BYTES:?logical workspace byte ceiling is required}
- AGENT_RUNTIME_WORKSPACE_FS_MAX_BYTES=${AGENT_RUNTIME_WORKSPACE_FS_MAX_BYTES:?workspace filesystem byte ceiling is required}
- AGENT_RUNTIME_LOG_FS_MAX_BYTES=${AGENT_RUNTIME_LOG_FS_MAX_BYTES:?Runtime log filesystem byte ceiling is required}
- AGENT_RUNTIME_SKILLS_ROOT=/runtime/skills
- AGENT_RUNTIME_TRACE_JSONL=/runtime/logs/runtime-traces.jsonl
- AGENT_RUNTIME_BASH_SANDBOX=proot
- AGENT_RUNTIME_CGROUP_AGGREGATE_ROOT=/sys/fs/cgroup/${AGENT_RUNTIME_CGROUP_PARENT}
- AGENT_RUNTIME_CGROUP_ROOT=/sys/fs/cgroup/${AGENT_RUNTIME_CGROUP_PARENT}/commands
- AGENT_RUNTIME_COMMAND_TIMEOUT_SECS=120
- AGENT_RUNTIME_COMMAND_PIDS_MAX=64
- AGENT_RUNTIME_COMMAND_MEMORY_MAX_BYTES=268435456
- AGENT_RUNTIME_COMMAND_MEMORY_SWAP_MAX_BYTES=0
- AGENT_RUNTIME_COMMAND_CPU_QUOTA_US=100000
- AGENT_RUNTIME_COMMAND_CPU_PERIOD_US=100000
- AGENT_RUNTIME_COMMAND_CPU_BUDGET_SECS=120
- AGENT_RUNTIME_COMMAND_NPROC=480
- AGENT_RUNTIME_COMMAND_NOFILE=256
- AGENT_RUNTIME_COMMAND_FSIZE_BYTES=67108864
- AGENT_RUNTIME_FETCH_ENABLED=false
- AGENT_RUNTIME_REQUIRE_FETCH_FOR_READINESS=false
expose:
- "8080"
volumes:
- type: bind
source: ${AGENT_RUNTIME_WORKSPACE_HOST_ROOT:?bounded workspace mount root is required}
target: /runtime/workspaces
bind:
create_host_path: false
- type: bind
source: ./skills
target: /runtime/skills
read_only: true
bind:
create_host_path: false
- type: bind
source: ${AGENT_RUNTIME_LOG_HOST_ROOT:?bounded Runtime log mount root is required}
target: /runtime/logs
bind:
create_host_path: false
- type: bind
source: ${AGENT_RUNTIME_CGROUP_HOST_ROOT:?delegated commands cgroup root is required}
target: ${AGENT_RUNTIME_CGROUP_HOST_ROOT:?delegated commands cgroup root is required}
bind:
create_host_path: false
networks:
- bot-runtime-control
redis:
image: redis:alpine
container_name: bot-redis
<<: *common
expose:
- "6379"
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf
- ./data:/data
command:
- /usr/local/etc/redis/redis.conf
networks:
- bot-data
networks:
bot-runtime-control:
name: bot-runtime-control
internal: true
bot-data:
name: bot-data
internal: true
bot-egress:
name: bot-egress