Repository navigation
Expand file tree
/
Copy pathecosystem.config.js
More file actions
144 lines (139 loc) · 2.9 KB
/
Copy pathecosystem.config.js
File metadata and controls
144 lines (139 loc) · 2.9 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
/**
* 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: "worker",
group: "backend",
},
// {
// // Alternative way of getting matches if GetMatchHistoryBySequenceNum is broken
// name: 'backupscanner',
// group: 'disabled',
// },
// {
// name: "backfill",
// group: "backend",
// env: {
// BACKFILL_START: 6481993884, // match ID 7700000000
// BACKFILL_END: 6581993884,
// },
// },
{
name: "web",
group: "backend",
exec_mode: prod ? "cluster" : undefined,
instances: prod ? 12 : undefined,
},
// One local instance of retriever for getting player profiles since this isn't rate limited
{
name: "retriever",
group: "backend",
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: "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",
env: {
POSTGRES_MAX_CONNECTIONS: "100",
},
},
{
name: "counts",
group: "backend",
},
{
name: "scenarios",
group: "backend",
},
{
name: "reconcile",
group: "backend",
},
{
name: "rater",
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,
},
};
});