Add windmill
This commit is contained in:
9
roles/windmill/meta/argument_specs.yaml
Normal file
9
roles/windmill/meta/argument_specs.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
argument_specs:
|
||||||
|
main:
|
||||||
|
description: Installs windmill with worker in podman in podman
|
||||||
|
options:
|
||||||
|
windmill_domain:
|
||||||
|
description: The domain to use for windmill
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
66
roles/windmill/tasks/main.yaml
Normal file
66
roles/windmill/tasks/main.yaml
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
- name: Windmill service
|
||||||
|
ansible.builtin.import_role:
|
||||||
|
name: service
|
||||||
|
vars:
|
||||||
|
service_name: windmill
|
||||||
|
service_container_image: ghcr.io/windmill-labs/windmill:main
|
||||||
|
service_container_mounts:
|
||||||
|
- type: volume
|
||||||
|
source: worker-logs
|
||||||
|
destination: /tmp/windmill/logs
|
||||||
|
service_container_http_port: 8000
|
||||||
|
service_domains:
|
||||||
|
- "{{ windmill_domain }}"
|
||||||
|
service_database_type: postgres
|
||||||
|
service_container_env:
|
||||||
|
DATABASE_URL_FILE: /run/secrets/postgres-url
|
||||||
|
MODE: server
|
||||||
|
service_additional_containers:
|
||||||
|
- name: worker
|
||||||
|
image: quay.io/podman/stable:latest
|
||||||
|
user: podman
|
||||||
|
entrypoint: /entrypoint.sh
|
||||||
|
mounts:
|
||||||
|
- type: volume
|
||||||
|
source: worker-logs
|
||||||
|
destination: /worker-logs
|
||||||
|
- type: volume
|
||||||
|
source: worker-dependency-cache
|
||||||
|
destination: /worker-dependency-cache
|
||||||
|
- type: template
|
||||||
|
source: worker_entrypoint.sh.j2
|
||||||
|
destination: /entrypoint.sh
|
||||||
|
mode: "0755"
|
||||||
|
- type: volume
|
||||||
|
source: worker-containers
|
||||||
|
destination: /home/podman/.local/share/containers
|
||||||
|
publish_ports: []
|
||||||
|
env: {}
|
||||||
|
- name: worker-native
|
||||||
|
env:
|
||||||
|
DATABASE_URL_FILE: /run/secrets/postgres-url
|
||||||
|
MODE: worker
|
||||||
|
WORKER_TYPE: native
|
||||||
|
NATIVE_MODE: "true"
|
||||||
|
NUM_WORKERS: "8"
|
||||||
|
SLEEP_QUEUE: "200"
|
||||||
|
- name: lsp
|
||||||
|
image: ghcr.io/windmill-labs/windmill-extra:latest
|
||||||
|
secrets: []
|
||||||
|
mounts:
|
||||||
|
- type: volume
|
||||||
|
source: lsp-cache
|
||||||
|
destination: /puls/.cache
|
||||||
|
publish_ports:
|
||||||
|
- name: lsp
|
||||||
|
type: socket
|
||||||
|
container_port: 3001
|
||||||
|
env:
|
||||||
|
ENABLE_LSP: "true"
|
||||||
|
ENABLE_MULTIPLAYER: "false"
|
||||||
|
ENABLE_DEBUGGER: "false"
|
||||||
|
WINDMILL_BASE_URL: http://windmill:8000
|
||||||
|
service_vhost_locations:
|
||||||
|
- path: /ws/*
|
||||||
|
proxy_target_socket: /run/windmill-lsp-socat.sock
|
||||||
26
roles/windmill/templates/worker_entrypoint.sh.j2
Normal file
26
roles/windmill/templates/worker_entrypoint.sh.j2
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/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" \
|
||||||
|
-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 $!
|
||||||
Reference in New Issue
Block a user