windmill: Run worker outside of pinp

This commit is contained in:
uumas
2026-03-26 04:11:50 +02:00
parent 351ef2c5d4
commit 500bba84b4
2 changed files with 32 additions and 39 deletions

View File

@@ -17,26 +17,46 @@
DATABASE_URL_FILE: /run/secrets/postgres-url DATABASE_URL_FILE: /run/secrets/postgres-url
MODE: server MODE: server
service_additional_containers: service_additional_containers:
- name: worker - name: worker-pinp
image: quay.io/podman/stable:latest image: quay.io/podman/stable:latest
user: podman user: podman
entrypoint: /entrypoint.sh command:
- podman
- system
- service
- --time
- "0"
mounts:
- type: volume
source: worker-pinp-containers
destination: /home/podman/.local/share/containers
- type: volume
source: worker-pinp-tmp
destination: /tmp/storage-run-1000
- type: volume
source: worker-pinp-run
destination: /tmp/storage-run-1000/podman
- name: worker
mounts: mounts:
- type: volume - type: volume
source: worker-logs source: worker-logs
destination: /worker-logs destination: /tmp/windmill/logs
- type: volume - type: volume
source: worker-dependency-cache source: worker-dependency-cache
destination: /worker-dependency-cache destination: /tmp/windmill/cache
- type: template
source: worker_entrypoint.sh.j2
destination: /entrypoint.sh
mode: "0755"
- type: volume - type: volume
source: worker-containers source: worker-pinp-run
destination: /home/podman/.local/share/containers destination: /run/podman
publish_ports: [] readonly: true
env: {} env:
DATABASE_URL_FILE: /run/secrets/postgres-url
DOCKER_HOST: unix:///run/podman/podman.sock
MODE: worker
WORKER_GROUP: default
ENABLE_UNSHARE_PID: "true"
UNSHARE_ISOLATION_FLAGS: "--user --map-root-user --pid --fork"
wants:
- windmill-worker-pinp.service
- name: worker-native - name: worker-native
env: env:
DATABASE_URL_FILE: /run/secrets/postgres-url DATABASE_URL_FILE: /run/secrets/postgres-url

View File

@@ -1,27 +0,0 @@
#!/bin/bash
# {{ ansible_managed }}
_term() {
echo "Received SIGTERM, stopping all containers"
kill "$child"
}
podman system service -t 0 &
podman run \
--rm \
-v /run/secrets/postgres-url:/run/secrets/postgres-url:ro \
-e DATABASE_URL_FILE=/run/secrets/postgres-url \
-e MODE=worker \
-e WORKER_GROUP=default \
-e ENABLE_UNSHARE_PID="true" \
-e UNSHARE_ISOLATION_FLAGS="--user --map-root-user --pid --fork" \
-v /tmp/storage-run-1000/podman/podman.sock:/var/run/docker.sock \
-v /worker-logs:/tmp/windmill/logs \
-v /worker-dependency-cache:/tmp/windmill/cache \
--name worker \
--network host \
ghcr.io/windmill-labs/windmill:main &
child=$!
trap _term SIGTERM
wait "$!"