oceanus: give mapped Podman mounts a private traversable temporary directory

This commit is contained in:
Brad Stein 2026-12-05 13:21:38 -06:00
parent 04185561da
commit 57244cfe7a
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@ UMask=0077
Environment=HOME=/srv/lesavkaci/home Environment=HOME=/srv/lesavkaci/home
Environment=XDG_RUNTIME_DIR=/mnt/veles/lesavka/ci/runtime Environment=XDG_RUNTIME_DIR=/mnt/veles/lesavka/ci/runtime
Environment=CONTAINERS_STORAGE_CONF=/etc/lesavkaci/storage.conf Environment=CONTAINERS_STORAGE_CONF=/etc/lesavkaci/storage.conf
Environment=TMPDIR=/srv/lesavkaci/home/tmp Environment=TMPDIR=/tmp
LoadCredential=agent-secret:/etc/lesavkaci/secrets/%i.secret LoadCredential=agent-secret:/etc/lesavkaci/secrets/%i.secret
ExecStart=/usr/local/libexec/lesavkaci/start-agent %i ExecStart=/usr/local/libexec/lesavkaci/start-agent %i
Restart=on-failure Restart=on-failure
@ -23,7 +23,7 @@ RestartSec=10
TimeoutStopSec=60 TimeoutStopSec=60
KillMode=mixed KillMode=mixed
ProtectHome=true ProtectHome=true
PrivateTmp=true BindPaths=/srv/lesavkaci/agents/%i/tmp:/tmp
InaccessiblePaths=-/etc/rancher -/var/lib/rancher -/run/k3s -/var/lib/kubelet InaccessiblePaths=-/etc/rancher -/var/lib/rancher -/run/k3s -/var/lib/kubelet
[Install] [Install]

View File

@ -43,6 +43,7 @@ install -d -m0700 /etc/lesavkaci/secrets
as_agent() { runuser -u lesavka-ci -- env HOME="$home" XDG_RUNTIME_DIR="$nvme/runtime" CONTAINERS_STORAGE_CONF=/etc/lesavkaci/storage.conf TMPDIR="$home/tmp" "$@"; } as_agent() { runuser -u lesavka-ci -- env HOME="$home" XDG_RUNTIME_DIR="$nvme/runtime" CONTAINERS_STORAGE_CONF=/etc/lesavkaci/storage.conf TMPDIR="$home/tmp" "$@"; }
for lane in compiler tests; do for lane in compiler tests; do
install -d -m0700 -o lesavka-ci -g lesavka-ci "/srv/lesavkaci/agents/$lane" install -d -m0700 -o lesavka-ci -g lesavka-ci "/srv/lesavkaci/agents/$lane"
install -d -m1777 -o lesavka-ci -g lesavka-ci "/srv/lesavkaci/agents/$lane/tmp"
as_agent podman --cgroup-manager=cgroupfs unshare sh -eu -c ' as_agent podman --cgroup-manager=cgroupfs unshare sh -eu -c '
for p do for p do
mkdir -p "$p" mkdir -p "$p"