-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (91 loc) · 3.98 KB
/
docker-compose.yml
File metadata and controls
95 lines (91 loc) · 3.98 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
# ==============================================================================
# @file docker-compose.yml
# @brief Orchestration matrix for debugging, unit testing, and stress testing.
# @details Defines isolated service profiles to validate lzmalloc behavior
# under severe memory pressure, massive concurrency, and POSIX compliance checks.
# ==============================================================================
services:
# ----------------------------------------------------------------------------
# @service dev-sandbox
# @brief Interactive debugging environment with low-level kernel capabilities.
# @note Grants SYS_PTRACE for GDB hooking and disables seccomp for deep profiling.
# ----------------------------------------------------------------------------
dev-sandbox:
build:
context: .
dockerfile: Dockerfile
target: builder
container_name: lzmalloc-sandbox
stdin_open: true
tty: true
cap_add:
- SYS_PTRACE # Required for GDB and strace
- IPC_LOCK # Required for mmap mlock and huge pages testing
security_opt:
- seccomp:unconfined
volumes:
- .:/lzmalloc_src:rw # Mount local code for live editing and recompilation
entrypoint: ["/bin/bash"]
# ----------------------------------------------------------------------------
# @service ci-test-suite
# @brief Automated execution of the CTest suite (Unit, Integration, Stress).
# ----------------------------------------------------------------------------
ci-test-suite:
build:
context: .
dockerfile: Dockerfile
target: builder
container_name: lzmalloc-test-runner
# Executes the CMake integrated test suite
entrypoint: ["make", "test", "CC=clang"]
# ----------------------------------------------------------------------------
# @service chaos-stress
# @brief Aggressive concurrency and resource exhaustion simulation.
# @details Artificially restricts file descriptors and memory to validate
# lzmalloc's graceful fallback to the 4MB Base Allocator and VMM safety.
# ----------------------------------------------------------------------------
chaos-stress:
build:
context: .
dockerfile: Dockerfile
target: builder
container_name: lzmalloc-chaos
environment:
- LZMALLOC_TELEMETRY=1
ulimits:
nofile:
soft: 128 # Force FD exhaustion to trigger /dev/urandom fallbacks
hard: 256
memlock:
soft: -1 # Allow unlimited locked memory for extreme VMM testing
hard: -1
# Directly invokes the stress binary with preloaded library
entrypoint: ["sh", "-c", "LD_PRELOAD=./build/debug/liblzmalloc.so ./build/debug/stress_test"]
# ----------------------------------------------------------------------------
# @service benchmark-suite
# @brief Automated execution of the industrial benchmarking suite.
# @details Runs the benchmark natively (glibc), then sequentially injects
# jemalloc, mimalloc, and lzmalloc via LD_PRELOAD to ensure a fair O.S. state.
# ----------------------------------------------------------------------------
benchmark-suite:
build:
context: .
dockerfile: Dockerfile
target: builder
container_name: lzmalloc-benchmark
cap_add:
- IPC_LOCK # To allow hardware-level page locking if needed
entrypoint: >
/bin/bash -c "
echo '=====================================' &&
echo ' ALLOCATOR BATTLE ROYALE (DOCKER) ' &&
echo '=====================================' &&
echo -e '\n>>> 1. Baseline (glibc ptmalloc) <<<' &&
./build/release/bench_suite &&
echo -e '\n>>> 2. jemalloc <<<' &&
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 ./build/release/bench_suite &&
echo -e '\n>>> 3. mimalloc <<<' &&
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libmimalloc.so.2 ./build/release/bench_suite &&
echo -e '\n>>> 4. lzmalloc V2 <<<' &&
LD_PRELOAD=./build/release/liblzmalloc.so ./build/release/bench_suite
"