mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-19 00:03:19 +00:00
Under nsjail (untrusted), a docker job now runs against its OWN rootless podman
instance instead of the shared per-worker service, so no container it spawns can
outlive the job — even extra/detached ones the script starts.
- start_per_job_podman(): per docker+nsjail job (when container_runtime=podman),
start a rootless `podman system service` with isolated --root/--runroot under
the job dir; its unix socket is bind-mounted into the jail ({DOCKER_SOCK_MOUNT}
in run.bash.config.proto) and handed to the script as DOCKER_HOST.
- connect_docker()/handle_docker_job() take an optional per-job docker_host so
bollard talks to the per-job socket.
- PerJobPodman Drop tears the instance down on every exit path (success, error,
cancel, timeout, killpill): `podman rm -af --force` (removes ALL containers in
the instance, not just $WM_JOB_ID — conmon reparents so process-tree kill is
insufficient) + kill the service + remove the dir.
- unshare (trusted) keeps using the shared service unchanged.
Verified e2e on native rootless podman + nsjail: a job that detaches an extra
`sleep 600` container completes successfully and the extra container is killed
when the job ends (no leak). Tradeoff: per-job storage re-pulls images (no shared
cache yet); a shared read-only image store is a follow-up optimization.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Windmill Worker
The worker. Used to process and execute flows & jobs.
This crate exposes both a library as well as a binary target.