forked from F1bonacc1/process-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
process-compose.override.yaml
217 lines (197 loc) · 4.94 KB
/
process-compose.override.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
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"
disabled:
description: "disabled process"
command: "echo I\\'m disabled"
disabled: true
depends_on:
disabled_dependency:
condition: process_completed
disabled_dependency:
description: "disabled dependency process"
command: "echo I\\'m disabled dependency"
disabled: true