Skip to content

Commit

Permalink
Merge pull request #8 from maribu/lxc-integration
Browse files Browse the repository at this point in the history
Add doc and a helper for running inside LXC containers
  • Loading branch information
kaspar030 committed Mar 1, 2023
2 parents 94e01ef + 87b6955 commit b22df0d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -40,6 +40,25 @@ jobs. Each worker will need 2GB RAM (in addition to the 8GB for the shared tmpfs
for ccache).
Start with half the number of *physical* cores.

### Inside an LXC container

Running docker inside LXC comtainers works very much out of the box. E.g. on Proxmox additionally
the fuse and the nesting capabilities need to be enabled and `fuse-overlayfs` needs to be installed.
The reason is that native `overlayfs` cannot be used for rootless operation (or when the user
launching the docker containers is only root within an LXC container namespace). Without
`fuse-overlayfs` the VFS storage driver is used instead, which performs a deep copy of all lower
layers into the upper layers. With a large number of layers, this increases storage consumption
too much to be practical.

**Note**: Expect that `fuse-overlayfs` will throttle the performance of your worker quite a bit.

**Also note**: The metrics reported by the vector service will include RAM and CPUs available to the
bare host (e.g. the Proxmox running the LXC container which runs the docker containers). To fix
that, filtered versions of various `/proc/` files can be provided by lxcfs that can be bind-mounted
into the docker container. To do so automatically, run
`docker-compose -f docker-compose.yml -f docker-compose.lxc.yml up -d --scale worker=N` instead of
just `docker-compose up -d --scale worker=N`.

## Configuration

If the worker is dedicated to being a Murdock worker, one worker per physical
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.lxc.yml
@@ -0,0 +1,14 @@
version: "3.7"
services:
vector:
volumes:
- ./vector.toml:/etc/vector/vector.toml:ro
- /proc/cpuinfo:/proc/cpuinfo:ro
- /sys/devices/system/cpu:/sys/devices/system/cpu:ro
- /proc/diskstats:/proc/diskstats:ro
- /proc/loadavg:/proc/loadavg:ro
- /proc/meminfo:/proc/meminfo:ro
- /proc/slabinfo:/proc/slabinfo:ro
- /proc/stat:/proc/stat:ro
- /proc/swaps:/proc/swaps:ro
- /proc/uptime:/proc/uptime:ro

0 comments on commit b22df0d

Please sign in to comment.