-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yaml
More file actions
134 lines (124 loc) · 2.71 KB
/
config.yaml
File metadata and controls
134 lines (124 loc) · 2.71 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
133
134
server:
transport: "http" # or "stdio"
http_port: 8080
sandbox:
backend: "docker"
timeout_sec: 60
memory_mb: 512
max_artifact_size_mb: 20
network_enabled: false
enable_local_backend: false
languages:
python:
image: "python:3.11-slim"
prefix_code: |
print("Set timeout for Python execution")
import signal, sys
def timeout_handler(signum, frame):
print('Execution timeout!')
sys.exit(1)
signal.signal(signal.SIGALRM, timeout_handler)
signal.alarm(10) # Set timeout to 10 seconds
postfix_code: |
import sys
signal.alarm(0) # Cancel the alarm
sys.stdout.flush()
sys.stderr.flush()
environment:
PYTHONPATH: "/workdir"
PYTHONIOENCODING: "utf-8"
exclude_patterns:
- "__pycache__/"
- "*.pyc"
- "htmlcov/"
- "main.py"
nodejs:
image: "node:20-alpine"
prefix_code: |
// Set timeout for Node.js execution
//setTimeout(() => {
// console.log('Execution timeout!');
// process.exit(1);
//}, 5000); // 10 seconds
postfix_code: |
process.exit(0)
environment:
NODE_PATH: "/workdir"
NODE_ENV: "production"
exclude_patterns:
- "node_modules/"
- "npm-debug.log*"
- "yarn-debug.log*"
- "yarn-error.log*"
- ".npm/"
- ".yarn/"
- ".hg/"
- "dist/"
- "build/"
- "index.js"
- "*.js.map"
- "*.out"
go:
image: "golang:1.23-alpine"
# prefix_code: |
# package main
# import (
# "fmt"
# "log"
# "os"
# )
#
# var (
# _ = fmt.Println
# _ = log.Println
# _ = os.Exit
# )
#
# func main() {
# postfix_code: |
# }
build_cmd: "go build -o /workdir/app /workdir/main.go"
run_cmd: "/workdir/app"
environment:
GOCACHE: "/tmp/go-build"
GOMODCACHE: "/tmp/go-mod"
exclude_patterns:
- "*.o"
- "*.a"
- "*.so"
- "*.out"
- "go.sum"
- "go.mod"
- "vendor/"
- "bin/"
- "pkg/"
- "target/"
- "main.go"
- "app"
- "go-build/"
cpp:
image: "gcc:13"
build_cmd: "g++ -std=c++17 -O2 -o /workdir/app /workdir/main.cpp"
run_cmd: "/workdir/app"
environment:
LANG: "C.UTF-8"
LC_ALL: "C.UTF-8"
exclude_patterns:
- "*.o"
- "*.a"
- "*.so"
- "*.out"
- "*.obj"
- "a.out"
- "app"
- "main.cpp"
- "build/"
- "cmake-build*/"
- "bin/"
- "obj/"
- "lib/"
- "*.dylib"
- "*.so.*"
logging:
mode: "development" # "production", "development"
level: "debug" # debug, info, warn, error, dpanic, panic, fatal