mirror of
https://github.com/F1bonacc1/process-compose.git
synced 2024-10-03 22:27:13 +03:00
205 lines
4.6 KiB
YAML
205 lines
4.6 KiB
YAML
version: "0.5"
|
|
log_level: debug
|
|
log_length: 3000
|
|
is_strict: true
|
|
#is_tui_disabled: true
|
|
environment:
|
|
- 'ABC=222'
|
|
log_location: ./pc.log
|
|
disable_env_expansion: false
|
|
shell:
|
|
shell_command: "bash"
|
|
shell_argument: "-c"
|
|
vars:
|
|
HI: Cool Dude
|
|
LOCATION: Europe
|
|
VERSION: v0.75.0
|
|
PWD: /tmp
|
|
DISABLED: true
|
|
PORT: 80
|
|
|
|
processes:
|
|
process0:
|
|
command: "ls -lFa --color=tty"
|
|
working_dir: "/"
|
|
namespace: "ns1"
|
|
is_tty: true
|
|
|
|
process1:
|
|
command: "./test_loop.bash ${PROC4} ${LOCAL_ENV_VAR1}"
|
|
availability:
|
|
restart: "on_failure"
|
|
backoff_seconds: 2
|
|
depends_on:
|
|
_process2:
|
|
condition: process_completed_successfully
|
|
process3:
|
|
condition: process_completed
|
|
# process4:
|
|
# condition: process_completed_successfully
|
|
environment:
|
|
- 'EXIT_CODE=0'
|
|
shutdown:
|
|
command: "sleep 2 && pkill -f process1"
|
|
signal: 15
|
|
timeout_seconds: 4
|
|
|
|
log-line-ready:
|
|
command: "./test_loop.bash ready-log"
|
|
ready_log_line: "test loop 1"
|
|
|
|
dep-on-log-line-ready:
|
|
command: "echo log is $ENV_TEST"
|
|
environment:
|
|
- 'ENV_TEST=ready'
|
|
availability:
|
|
restart: "on_failure"
|
|
backoff_seconds: 2
|
|
depends_on:
|
|
log-line-ready:
|
|
condition: process_log_ready
|
|
|
|
_process2:
|
|
command: "./test_loop.bash process2"
|
|
log_location: ./pc.proc2.{PC_REPLICA_NUM}.log
|
|
log_configuration:
|
|
rotation:
|
|
max_size_mb: 1
|
|
max_age_days: 3
|
|
max_backups: 3
|
|
compress: true
|
|
no_metadata: true
|
|
add_timestamp: true
|
|
timestamp_format: "06-01-02 15:04:05.000"
|
|
|
|
availability:
|
|
restart: "on_failure"
|
|
# depends_on:
|
|
# process3:
|
|
# condition: process_completed_successfully
|
|
environment:
|
|
- 'ABC=2221'
|
|
- 'PRINT_ERR=111'
|
|
- 'EXIT_CODE=2'
|
|
shutdown:
|
|
command: "sleep 2 && pkill -f 'test_loop.bash process2'"
|
|
signal: 15
|
|
timeout_seconds: 4
|
|
readiness_probe:
|
|
http_get:
|
|
host: "google.com"
|
|
scheme: "https"
|
|
initial_delay_seconds: 5
|
|
period_seconds: 5
|
|
timeout_seconds: 2
|
|
success_threshold: 1
|
|
failure_threshold: 3
|
|
|
|
process3:
|
|
command: "./test_loop.bash $PROC4"
|
|
availability:
|
|
restart: "always"
|
|
backoff_seconds: 2
|
|
depends_on:
|
|
nginx:
|
|
condition: process_healthy
|
|
|
|
process4:
|
|
command: "./test_loop.bash process4-override"
|
|
namespace: test
|
|
replicas: 2
|
|
|
|
disable_ansi_colors: true
|
|
# availability:
|
|
# restart: on_failure
|
|
environment:
|
|
- 'ABC=2221'
|
|
- 'EXIT_CODE=4'
|
|
readiness_probe:
|
|
exec:
|
|
command: "ps -ef | grep -v grep | grep process4"
|
|
initial_delay_seconds: 5
|
|
period_seconds: 2
|
|
timeout_seconds: 1
|
|
success_threshold: 1
|
|
failure_threshold: 3
|
|
|
|
nginx:
|
|
command: "docker run -d --rm -p80:80 --name nginx_test nginx"
|
|
# availability:
|
|
# restart: on_failure
|
|
is_daemon: true
|
|
shutdown:
|
|
command: "docker stop nginx_test"
|
|
signal: 15
|
|
timeout_seconds: 5
|
|
liveness_probe:
|
|
exec:
|
|
command: '[ $(docker inspect -f {{ "{{.State.Running}}" }} nginx_test) = true ]'
|
|
initial_delay_seconds: 5
|
|
period_seconds: 2
|
|
timeout_seconds: 5
|
|
success_threshold: 1
|
|
failure_threshold: 3
|
|
readiness_probe:
|
|
http_get:
|
|
host: 127.0.0.1
|
|
path: "/"
|
|
port: "{{.PORT}}"
|
|
initial_delay_seconds: 5
|
|
period_seconds: 10
|
|
timeout_seconds: 5
|
|
success_threshold: 1
|
|
failure_threshold: 3
|
|
availability:
|
|
restart: "always"
|
|
backoff_seconds: 2
|
|
|
|
pc_log:
|
|
command: "tail -f -n100 process-compose-${USER}.log"
|
|
working_dir: "/tmp"
|
|
environment:
|
|
- 'REDACTED=1'
|
|
- 'ADDED=2'
|
|
depends_on:
|
|
process0:
|
|
condition: process_completed
|
|
|
|
bat_config:
|
|
command: "batcat -P -f process-compose.yaml"
|
|
|
|
template:
|
|
description: A process for testing templates
|
|
vars:
|
|
LOCATION: USA
|
|
FTR_A_ENABLED: true
|
|
FTR_B_ENABLED: true
|
|
command: "echo 'Hi {{or .HI 123 }} from {{.LOCATION}} version {{or \"${VERSION}\" .VERSION}} {{if and .FTR_A_ENABLED .FTR_B_ENABLED}}Not Supported{{end}}'"
|
|
working_dir: "{{ .PWD }}"
|
|
|
|
entrypoint:
|
|
description: "run process with entrypoint and no command"
|
|
entrypoint:
|
|
- ls
|
|
- -lFa
|
|
- --color=always
|
|
- /tmp
|
|
- /
|
|
|
|
nvim:
|
|
description: "run a foreground process"
|
|
command: "nvim process-compose.override.yaml"
|
|
is_foreground: true
|
|
|
|
elevated_ls:
|
|
description: "run an elevated process"
|
|
command: "ls -l /root"
|
|
is_elevated: true
|
|
shutdown:
|
|
signal: 9
|
|
|
|
unelevate:
|
|
description: "disable elevation cache"
|
|
command: "sudo -k"
|
|
|