-
Notifications
You must be signed in to change notification settings - Fork 313
Expand file tree
/
Copy pathecosystem.config.js
More file actions
214 lines (209 loc) · 3.86 KB
/
ecosystem.config.js
File metadata and controls
214 lines (209 loc) · 3.86 KB
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
/**
* PM2 configuration file
*/
import { loadEnvFile } from "node:process";
import os from "node:os";
try {
loadEnvFile();
} catch (e) {
console.log(e);
}
const dev = process.env.NODE_ENV === "development";
const prod = process.env.NODE_ENV === "production";
let arr = [
// Services in non-backend groups are deployed separately
{
// Proxy requests to Steam API
name: "proxy",
group: "proxy",
},
{
name: "autoprofiler",
group: "backend",
},
{
name: "autofullhistory",
group: "backend",
},
{
name: "autommr",
group: "backend",
},
// {
// name: 'autoreconcile',
// group: 'backend',
// },
// {
// // Alternative way of getting matches if GetMatchHistoryBySequenceNum is broken
// name: 'backupscanner',
// group: 'disabled',
// },
// {
// name: "backfill",
// group: "backend",
// env: {
// BACKFILL_START: 233273,
// BACKFILL_END: 7000000000,
// },
// },
{
name: "web",
group: "backend",
exec_mode: prod ? "cluster" : undefined,
instances: prod ? Math.max(os.cpus().length / 2, 1) : undefined,
},
// One local instance of retriever for getting player profiles since this isn't rate limited
{
name: "retriever",
group: "backend",
health_exempt: true,
env: {
// Clear registry host since we don't need to register local service
SERVICE_REGISTRY_HOST: "",
},
},
{
name: "gcdata",
group: "backend",
},
{
// Requests and inserts replay parse data. Note this is different from parseServer which is in Java and runs externally
name: "parser",
group: "backend",
},
{
name: "fullhistory",
group: "backend",
},
{
name: "apiadmin",
group: "backend",
},
{
name: "mmr",
group: "backend",
env: {
// Use the local retriever instance
USE_SERVICE_REGISTRY: "",
},
},
{
name: "profiler",
group: "backend",
},
{
name: "scanner",
group: "backend",
},
{
// Secondary scanner that runs behind and picks up matches previously missing
name: "scanner2",
// Sets ROLE since this defaults to using name
role_override: "scanner",
group: "backend",
env: {
SCANNER_OFFSET: "50000",
},
},
{
name: "inserter",
group: "backend",
},
// {
// name: 'cacher',
// group: 'backend',
// },
{
name: "monitor",
group: "backend",
},
{
name: "buildsets",
group: "backend",
},
{
name: "cosmetics",
group: "backend",
},
{
name: "distributions",
group: "backend",
},
{
name: "heroes",
group: "backend",
},
{
name: "items",
group: "backend",
},
{
name: "leagues",
group: "backend",
},
{
name: "livegames",
group: "backend",
},
{
name: "proplayers",
group: "backend",
},
{
name: "teams",
group: "backend",
},
{
name: "scenarios",
group: "backend",
},
{
name: "cleanup",
group: "backend",
},
{
name: "syncSubs",
group: "backend",
},
// {
// name: 'archiver',
// group: 'backend',
// },
{
name: "reconcile",
group: "backend",
},
{
name: "rater",
group: "backend",
},
// {
// name: 'repair',
// group: 'backend',
// },
{
name: "cycler",
group: "backend",
},
];
// If GROUP is set filter to only the matching group
arr = arr.filter(
(app) => !process.env.GROUP || app.group === process.env.GROUP,
);
export const apps = arr.map((app) => {
return {
...app,
watch: dev ? true : false,
ignore_watch: [".git", "node_modules", "build", "json"],
log_date_format: "YYYY-MM-DDTHH:mm:ss",
exec_mode: app.exec_mode ?? "fork",
instances: app.instances ?? 1,
script: "index.ts",
interpreter: "node",
env: {
...app.env,
ROLE: app.role_override ?? app.name,
APP_NAME: app.name,
},
};
});