-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathMakefile
141 lines (122 loc) · 3.68 KB
/
Makefile
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
help:
@make -qpRr | egrep -e '^[a-z].*:$$' | sed -e 's~:~~g' | sort
.PHONY: dev
dev:
MIX_ENV=dev \
VAULT_ENC_KEY="aHD8DZRdk2emnkdktFZRh3E9RNg4aOY7" \
API_JWT_SECRET=dev \
METRICS_JWT_SECRET=dev \
REGION=eu \
FLY_ALLOC_ID=111e4567-e89b-12d3-a456-426614174000 \
SECRET_KEY_BASE="dev" \
CLUSTER_POSTGRES="true" \
DB_POOL_SIZE="5" \
METRICS_DISABLED="false" \
AVAILABILITY_ZONE="ap-southeast-1b" \
ERL_AFLAGS="-kernel shell_history enabled +zdbbl 2097151" \
iex --name [email protected] --cookie cookie -S mix run --no-halt
dev.node2:
PORT=4001 \
MIX_ENV=dev \
VAULT_ENC_KEY="aHD8DZRdk2emnkdktFZRh3E9RNg4aOY7" \
API_JWT_SECRET=dev \
METRICS_JWT_SECRET=dev \
REGION=eu \
SECRET_KEY_BASE="dev" \
CLUSTER_POSTGRES="true" \
PROXY_PORT_SESSION="5442" \
PROXY_PORT_TRANSACTION="6553" \
PROXY_PORT="5402" \
NODE_IP=localhost \
AVAILABILITY_ZONE="ap-southeast-1c" \
ERL_AFLAGS="-kernel shell_history enabled" \
iex --name [email protected] --cookie cookie -S mix phx.server
dev.node3:
PORT=4002 \
MIX_ENV=dev \
VAULT_ENC_KEY="aHD8DZRdk2emnkdktFZRh3E9RNg4aOY7" \
API_JWT_SECRET=dev \
METRICS_JWT_SECRET=dev \
REGION=eu \
SECRET_KEY_BASE="dev" \
CLUSTER_POSTGRES="true" \
PROXY_PORT_SESSION="5443" \
PROXY_PORT_TRANSACTION="6554" \
ERL_AFLAGS="-kernel shell_history enabled" \
iex --name [email protected] --cookie cookie -S mix phx.server
db_migrate:
mix ecto.migrate --prefix _supavisor --log-migrator-sql
db_start:
docker-compose -f ./docker-compose.db.yml up
db_stop:
docker-compose -f ./docker-compose.db.yml down --remove-orphans
db_rebuild:
make db_stop
docker-compose -f ./docker-compose.db.yml build
make db_start
PGBENCH_USER ?= postgres.sys
PGBENCH_PORT ?= 6543
PGBENCH_RATE ?= 5000
PGBENCH_DURATION ?= 60
PGBENCH_CLIENTS ?= 1000
pgbench_init:
PGPASSWORD=postgres pgbench -i -h 127.0.0.1 -p 6432 -U postgres -d postgres
pgbench_short:
PGPASSWORD=postgres pgbench -M extended --transactions 5 --jobs 4 --client 1 -h localhost -p 6543 -U postgres.sys postgres
pgbench_long:
PGPASSWORD=postgres pgbench -M extended --transactions 100 --jobs 10 --client 60 -h localhost -p 7654 -U transaction.localhost postgres
pgbench:
PGPASSWORD="postgres" pgbench \
postgres://${PGBENCH_USER}@localhost:${PGBENCH_PORT}/postgres?sslmode=disable \
-Srn -T ${PGBENCH_DURATION} \
-j 8 -c ${PGBENCH_CLIENTS} \
-P 10 -M extended \
--rate ${PGBENCH_RATE}
clean:
rm -rf _build && rm -rf deps
dev_release:
mix deps.get && mix compile && mix release supavisor
dev_up:
rm -rf _build/dev/lib/supavisor && \
MIX_ENV=dev mix compile && \
mix release supavisor
dev_start_rel:
MIX_ENV=dev \
VAULT_ENC_KEY="aHD8DZRdk2emnkdktFZRh3E9RNg4aOY7" \
API_JWT_SECRET=dev \
METRICS_JWT_SECRET=dev \
REGION=eu \
FLY_ALLOC_ID=111e4567-e89b-12d3-a456-426614174000 \
SECRET_KEY_BASE="dev" \
CLUSTER_POSTGRES="true" \
DB_POOL_SIZE="5" \
_build/prod/rel/supavisor/bin/supavisor start_iex
prod_rel:
MIX_ENV=prod METRICS_DISABLED=true mix compile && \
MIX_ENV=prod METRICS_DISABLED=true mix release supavisor
prod_start_rel:
MIX_ENV=prod \
NODE_NAME="localhost" \
VAULT_ENC_KEY="aHD8DZRdk2emnkdktFZRh3E9RNg4aOY7" \
API_JWT_SECRET=dev \
METRICS_JWT_SECRET=dev \
REGION=eu \
FLY_ALLOC_ID=111e4567-e89b-12d3-a456-426614174000 \
SECRET_KEY_BASE="dev" \
CLUSTER_POSTGRES="true" \
DB_POOL_SIZE="5" \
_build/prod/rel/supavisor/bin/supavisor start_iex
prod_start_rel2:
MIX_ENV=prod \
NODE_NAME=node2 \
PORT=4001 \
VAULT_ENC_KEY="aHD8DZRdk2emnkdktFZRh3E9RNg4aOY7" \
API_JWT_SECRET=dev \
METRICS_JWT_SECRET=dev \
REGION=eu \
SECRET_KEY_BASE="dev" \
CLUSTER_POSTGRES="true" \
PROXY_PORT_SESSION="5442" \
PROXY_PORT_TRANSACTION="6553" \
NODE_IP=localhost \
_build/prod/rel/supavisor/bin/supavisor start_iex