Skip to content

Commit 13b1783

Browse files
committed
rename primary/secondary to 1/2
1 parent 5ef90c7 commit 13b1783

16 files changed

Lines changed: 100 additions & 92 deletions

infra/aggregation_mode/ansible/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The Ansible automation deploys a complete aggregation mode stack consisting of:
2020

2121
1. **PostgreSQL Auto-Failover Cluster** (3 servers)
2222
- 1 Monitor node (EC2)
23-
- 2 Data nodes (Primary + Secondary) with automatic failover (Scaleway Elastic Metal)
23+
- 2 Data nodes with automatic failover (Scaleway Elastic Metal)
2424
- Password authentication with scram-sha-256
2525

2626
2. **Gateway Service** (2 servers)
@@ -51,15 +51,15 @@ The Ansible automation deploys a complete aggregation mode stack consisting of:
5151
├─────────────────────────────────────────────────────────────────┤
5252
│ │
5353
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
54-
│ │ PG Monitor │ │ PG Primary │ │ PG Secondary │ │
54+
│ │ PG Monitor │ │ PG Node 1 │ │ PG Node 2 │ │
5555
│ │ (EC2) │ │ (Scaleway) │ │ (Scaleway) │ │
5656
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
5757
│ │ │ │ │
5858
│ └──────────────────┴──────────────────┘ │
5959
│ pg_auto_failover │
6060
│ │
6161
│ ┌────────────────────────┐ ┌────────────────────────┐ │
62-
│ │ Gateway Primary │ │ Gateway Secondary │ │
62+
│ │ Gateway 1 │ │ Gateway 2 │ │
6363
│ │ ├─ Gateway (8080+443)│ │ ├─ Gateway (8080+443) │ │
6464
│ │ └─ Poller │ │ └─ Poller │ │
6565
│ └────────────────────────┘ └────────────────────────┘ │
@@ -152,7 +152,7 @@ make agg_mode_deploy_all ENV=mainnet
152152
```
153153

154154
This will:
155-
1. Deploy PostgreSQL cluster (monitor, primary, secondary)
155+
1. Deploy PostgreSQL cluster (monitor, node 1, node 2)
156156
2. Run database migrations
157157
3. Deploy gateway and poller on both servers
158158
4. Deploy Prometheus and Grafana
@@ -175,7 +175,7 @@ make postgres_deploy ENV=mainnet
175175
This will:
176176
- Deploy monitor with scram-sha-256 auth
177177
- Set password for autoctl_node user
178-
- Deploy primary and secondary nodes
178+
- Deploy node 1 and node 2
179179
- Configure replication with password auth
180180
- Run database migrations
181181

@@ -202,14 +202,14 @@ node_2 | 3 | 100.x.x.x:5432 | 1: 0/... | read-only | seconda
202202
```bash
203203
# For Hoodi
204204
make gateway_deploy ENV=hoodi
205-
make gateway_primary_deploy ENV=hoodi
206-
make gateway_secondary_deploy ENV=hoodi
205+
make gateway_1_deploy ENV=hoodi
206+
make gateway_2_deploy ENV=hoodi
207207
make gateway_deploy ENV=hoodi FORCE_REBUILD=true
208208

209209
# For Mainnet
210210
make gateway_deploy ENV=mainnet
211-
make gateway_primary_deploy ENV=mainnet
212-
make gateway_secondary_deploy ENV=mainnet
211+
make gateway_1_deploy ENV=mainnet
212+
make gateway_2_deploy ENV=mainnet
213213
make gateway_deploy ENV=mainnet FORCE_REBUILD=true
214214
```
215215

@@ -313,13 +313,13 @@ Force rebuild always rebuilds binaries from the latest code, even if they alread
313313
```bash
314314
# For Hoodi
315315
make gateway_deploy ENV=hoodi FORCE_REBUILD=true
316-
make gateway_primary_deploy ENV=hoodi FORCE_REBUILD=true
317-
make gateway_secondary_deploy ENV=hoodi FORCE_REBUILD=true
316+
make gateway_1_deploy ENV=hoodi FORCE_REBUILD=true
317+
make gateway_2_deploy ENV=hoodi FORCE_REBUILD=true
318318

319319
# For Mainnet
320320
make gateway_deploy ENV=mainnet FORCE_REBUILD=true
321-
make gateway_primary_deploy ENV=mainnet FORCE_REBUILD=true
322-
make gateway_secondary_deploy ENV=mainnet FORCE_REBUILD=true
321+
make gateway_1_deploy ENV=mainnet FORCE_REBUILD=true
322+
make gateway_2_deploy ENV=mainnet FORCE_REBUILD=true
323323
```
324324

325325
This will:
@@ -838,26 +838,26 @@ ansible-playbook infra/aggregation_mode/ansible/playbooks/pg_monitor.yaml \
838838
# Deploy only gateway (no poller) - Hoodi
839839
ansible-playbook infra/aggregation_mode/ansible/playbooks/gateway.yaml \
840840
-i infra/aggregation_mode/ansible/hoodi-inventory.yaml \
841-
-e "host=gateway_primary" \
841+
-e "host=gateway_1" \
842842
-e "env=hoodi"
843843

844844
# Deploy only gateway (no poller) - Mainnet
845845
ansible-playbook infra/aggregation_mode/ansible/playbooks/gateway.yaml \
846846
-i infra/aggregation_mode/ansible/mainnet-inventory.yaml \
847-
-e "host=gateway_primary" \
847+
-e "host=gateway_1" \
848848
-e "env=mainnet"
849849

850850
# Deploy gateway with forced rebuild (Hoodi)
851851
ansible-playbook infra/aggregation_mode/ansible/playbooks/gateway.yaml \
852852
-i infra/aggregation_mode/ansible/hoodi-inventory.yaml \
853-
-e "host=gateway_primary" \
853+
-e "host=gateway_1" \
854854
-e "env=hoodi" \
855855
-e "force_rebuild=true"
856856

857857
# Deploy gateway with forced rebuild (Mainnet)
858858
ansible-playbook infra/aggregation_mode/ansible/playbooks/gateway.yaml \
859859
-i infra/aggregation_mode/ansible/mainnet-inventory.yaml \
860-
-e "host=gateway_primary" \
860+
-e "host=gateway_1" \
861861
-e "env=mainnet" \
862862
-e "force_rebuild=true"
863863
```

infra/aggregation_mode/ansible/hoodi-inventory.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ postgres_monitor:
77
ansible_user: admin
88
ansible_python_interpreter: /usr/bin/python3
99

10-
# PostgreSQL Primary
11-
postgres_primary:
10+
# PostgreSQL Node 1
11+
postgres_1:
1212
hosts:
1313
agg-mode-hoodi-postgres-1:
1414
ansible_host: agg-mode-hoodi-postgres-1
1515
admin_user: admin
1616
ansible_user: admin
1717
ansible_python_interpreter: /usr/bin/python3
1818

19-
# PostgreSQL Secondary
20-
postgres_secondary:
19+
# PostgreSQL Node 2
20+
postgres_2:
2121
hosts:
2222
agg-mode-hoodi-postgres-2:
2323
ansible_host: agg-mode-hoodi-postgres-2
@@ -29,20 +29,20 @@ postgres_secondary:
2929
postgres_cluster:
3030
children:
3131
postgres_monitor:
32-
postgres_primary:
33-
postgres_secondary:
32+
postgres_1:
33+
postgres_2:
3434

35-
# Gateway Primary
36-
gateway_primary:
35+
# Gateway Node 1
36+
gateway_1:
3737
hosts:
3838
agg-mode-hoodi-gateway-1:
3939
ansible_host: agg-mode-hoodi-gateway-1
4040
admin_user: admin
4141
ansible_user: app
4242
ansible_python_interpreter: /usr/bin/python3
4343

44-
# Gateway Secondary
45-
gateway_secondary:
44+
# Gateway Node 2
45+
gateway_2:
4646
hosts:
4747
agg-mode-hoodi-gateway-2:
4848
ansible_host: agg-mode-hoodi-gateway-2
@@ -53,8 +53,8 @@ gateway_secondary:
5353
# Gateway Cluster (all gateway nodes)
5454
gateway_cluster:
5555
children:
56-
gateway_primary:
57-
gateway_secondary:
56+
gateway_1:
57+
gateway_2:
5858

5959
# Metrics Server
6060
metrics:

infra/aggregation_mode/ansible/mainnet-inventory.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ postgres_monitor:
77
ansible_user: admin
88
ansible_python_interpreter: /usr/bin/python3
99

10-
# PostgreSQL Primary
11-
postgres_primary:
10+
# PostgreSQL Node 1
11+
postgres_1:
1212
hosts:
1313
agg-mode-mainnet-postgres-1:
1414
ansible_host: agg-mode-mainnet-postgres-1
1515
admin_user: admin
1616
ansible_user: admin
1717
ansible_python_interpreter: /usr/bin/python3
1818

19-
# PostgreSQL Secondary
20-
postgres_secondary:
19+
# PostgreSQL Node 2
20+
postgres_2:
2121
hosts:
2222
agg-mode-mainnet-postgres-2:
2323
ansible_host: agg-mode-mainnet-postgres-2
@@ -29,20 +29,20 @@ postgres_secondary:
2929
postgres_cluster:
3030
children:
3131
postgres_monitor:
32-
postgres_primary:
33-
postgres_secondary:
32+
postgres_1:
33+
postgres_2:
3434

35-
# Gateway Primary
36-
gateway_primary:
35+
# Gateway Node 1
36+
gateway_1:
3737
hosts:
3838
agg-mode-mainnet-gateway-1:
3939
ansible_host: agg-mode-mainnet-gateway-1
4040
admin_user: admin
4141
ansible_user: app
4242
ansible_python_interpreter: /usr/bin/python3
4343

44-
# Gateway Secondary
45-
gateway_secondary:
44+
# Gateway Node 2
45+
gateway_2:
4646
hosts:
4747
agg-mode-mainnet-gateway-2:
4848
ansible_host: agg-mode-mainnet-gateway-2
@@ -53,8 +53,8 @@ gateway_secondary:
5353
# Gateway Cluster (all gateway nodes)
5454
gateway_cluster:
5555
children:
56-
gateway_primary:
57-
gateway_secondary:
56+
gateway_1:
57+
gateway_2:
5858

5959
# Metrics Server
6060
metrics:

infra/aggregation_mode/ansible/playbooks/deploy_all.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
vars:
44
env: "{{ env }}"
55

6-
- name: Deploy Gateway and Poller on Primary
6+
- name: Deploy Gateway and Poller on Node 1
77
ansible.builtin.import_playbook: gateway_stack.yaml
88
vars:
9-
host: gateway_primary
9+
host: gateway_1
1010
env: "{{ env }}"
1111

12-
- name: Deploy Gateway and Poller on Secondary
12+
- name: Deploy Gateway and Poller on Node 2
1313
ansible.builtin.import_playbook: gateway_stack.yaml
1414
vars:
15-
host: gateway_secondary
15+
host: gateway_2
1616
env: "{{ env }}"
1717

1818
- name: Deploy Metrics Stack

infra/aggregation_mode/ansible/playbooks/gateway.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
gateway_db_user: "{{ lookup('ini', 'db_user', file=config_file) }}"
3030
gateway_db_password: "{{ lookup('ini', 'db_password', file=config_file) }}"
3131
gateway_db_name: "{{ lookup('ini', 'db_name', file=config_file) }}"
32-
gateway_postgres_primary: "{{ lookup('ini', 'gateway_postgres_primary', file=config_file) }}"
33-
gateway_postgres_secondary: "{{ lookup('ini', 'gateway_postgres_secondary', file=config_file) }}"
32+
gateway_postgres_1: "{{ lookup('ini', 'gateway_postgres_1', file=config_file) }}"
33+
gateway_postgres_2: "{{ lookup('ini', 'gateway_postgres_2', file=config_file) }}"
3434
gateway_postgres_port: "{{ lookup('ini', 'gateway_postgres_port', file=config_file, default='5432') }}"
3535
gateway_eth_rpc_url: "{{ lookup('ini', 'gateway_eth_rpc_url', file=config_file) }}"
3636
gateway_payment_service_address: "{{ lookup('ini', 'gateway_payment_service_address', file=config_file) }}"

infra/aggregation_mode/ansible/playbooks/grafana_agg_mode.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
grafana_monitor_host: "{{ lookup('ini', 'grafana_monitor_host', file=config_file) }}"
2626
grafana_monitor_port: "{{ lookup('ini', 'grafana_monitor_port', file=config_file, default='5432') }}"
2727
grafana_monitor_db: "{{ lookup('ini', 'grafana_monitor_db', file=config_file, default='pg_auto_failover') }}"
28+
gateway_1_hostname: "{{ lookup('ini', 'gateway_1_hostname', file=config_file) }}"
29+
gateway_2_hostname: "{{ lookup('ini', 'gateway_2_hostname', file=config_file) }}"
30+
grafana_gateway_url: "{{ lookup('ini', 'grafana_gateway_url', file=config_file) }}"
2831
no_log: true
2932

3033
- name: Install required packages

infra/aggregation_mode/ansible/playbooks/ini/config-hoodi.ini

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ git_branch=staging
2929
# PostgreSQL Configuration
3030
# ============================================
3131
postgres_monitor_hostname=agg-mode-hoodi-postgres-monitor
32-
postgres_primary_hostname=agg-mode-hoodi-postgres-1
33-
postgres_secondary_hostname=agg-mode-hoodi-postgres-2
32+
postgres_1_hostname=agg-mode-hoodi-postgres-1
33+
postgres_2_hostname=agg-mode-hoodi-postgres-2
3434
db_name=agg_mode
3535
db_user=autoctl_node
3636

@@ -51,8 +51,8 @@ gateway_max_daily_proofs=100
5151
gateway_payment_service_address=0x7222E0183cE1A96619d0c883e9bfc6b76D4e780e
5252
gateway_eth_rpc_url=https://aligned-hoodi-rpc-geth.tail665ae.ts.net
5353

54-
gateway_postgres_primary=agg-mode-hoodi-postgres-1
55-
gateway_postgres_secondary=agg-mode-hoodi-postgres-2
54+
gateway_postgres_1=agg-mode-hoodi-postgres-1
55+
gateway_postgres_2=agg-mode-hoodi-postgres-2
5656
gateway_postgres_port=5432
5757

5858
# Metrics ports
@@ -74,8 +74,8 @@ last_block_fetched_initial_value=0
7474
# Metrics Configuration
7575
# ============================================
7676
prometheus_version=3.6.0
77-
gateway_primary_hostname=agg-mode-hoodi-gateway-1
78-
gateway_secondary_hostname=agg-mode-hoodi-gateway-2
77+
gateway_1_hostname=agg-mode-hoodi-gateway-1
78+
gateway_2_hostname=agg-mode-hoodi-gateway-2
7979

8080
# Grafana Configuration
8181
grafana_prometheus_url=http://localhost:9090
@@ -88,6 +88,8 @@ grafana_postgres_user=grafana
8888
grafana_monitor_host=agg-mode-hoodi-postgres-monitor
8989
grafana_monitor_port=5432
9090
grafana_monitor_db=pg_auto_failover
91+
# Public gateway URL
92+
grafana_gateway_url=https://hoodi.gateway.alignedlayer.com
9193

9294
# ============================================
9395
# Task Sender Configuration

infra/aggregation_mode/ansible/playbooks/ini/config-mainnet.ini

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ git_branch=staging
2929
# PostgreSQL Configuration
3030
# ============================================
3131
postgres_monitor_hostname=agg-mode-mainnet-postgres-monitor
32-
postgres_primary_hostname=agg-mode-mainnet-postgres-1
33-
postgres_secondary_hostname=agg-mode-mainnet-postgres-2
32+
postgres_1_hostname=agg-mode-mainnet-postgres-1
33+
postgres_2_hostname=agg-mode-mainnet-postgres-2
3434
db_name=agg_mode
3535
db_user=autoctl_node
3636

@@ -51,8 +51,8 @@ gateway_max_daily_proofs=100
5151
gateway_payment_service_address=0xc8631Bc1E60c20db40e474F791126212fA8255F4
5252
gateway_eth_rpc_url=https://aligned-mainnet-rpc-1.tail665ae.ts.net
5353

54-
gateway_postgres_primary=agg-mode-mainnet-postgres-1
55-
gateway_postgres_secondary=agg-mode-mainnet-postgres-2
54+
gateway_postgres_1=agg-mode-mainnet-postgres-1
55+
gateway_postgres_2=agg-mode-mainnet-postgres-2
5656
gateway_postgres_port=5432
5757

5858
# Metrics ports
@@ -74,8 +74,8 @@ last_block_fetched_initial_value=24235289
7474
# Metrics Configuration
7575
# ============================================
7676
prometheus_version=3.6.0
77-
gateway_primary_hostname=agg-mode-mainnet-gateway-1
78-
gateway_secondary_hostname=agg-mode-mainnet-gateway-2
77+
gateway_1_hostname=agg-mode-mainnet-gateway-1
78+
gateway_2_hostname=agg-mode-mainnet-gateway-2
7979

8080
# Grafana Configuration
8181
grafana_prometheus_url=http://localhost:9090
@@ -88,6 +88,8 @@ grafana_postgres_user=grafana
8888
grafana_monitor_host=agg-mode-mainnet-postgres-monitor
8989
grafana_monitor_port=5432
9090
grafana_monitor_db=pg_auto_failover
91+
# Public gateway URL
92+
grafana_gateway_url=https://mainnet.gateway.alignedlayer.com
9193

9294
# ============================================
9395
# Task Sender Configuration

infra/aggregation_mode/ansible/playbooks/poller.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
poller_db_user: "{{ lookup('ini', 'db_user', file=config_file) }}"
2525
poller_db_password: "{{ lookup('ini', 'db_password', file=config_file) }}"
2626
poller_db_name: "{{ lookup('ini', 'db_name', file=config_file) }}"
27-
poller_postgres_primary: "{{ lookup('ini', 'gateway_postgres_primary', file=config_file) }}"
28-
poller_postgres_secondary: "{{ lookup('ini', 'gateway_postgres_secondary', file=config_file) }}"
27+
poller_postgres_1: "{{ lookup('ini', 'gateway_postgres_1', file=config_file) }}"
28+
poller_postgres_2: "{{ lookup('ini', 'gateway_postgres_2', file=config_file) }}"
2929
poller_postgres_port: "{{ lookup('ini', 'gateway_postgres_port', file=config_file, default='5432') }}"
3030
poller_eth_rpc_url: "{{ lookup('ini', 'gateway_eth_rpc_url', file=config_file) }}"
3131
poller_payment_service_address: "{{ lookup('ini', 'gateway_payment_service_address', file=config_file) }}"

infra/aggregation_mode/ansible/playbooks/postgres_cluster.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
host: postgres_monitor
55
env: "{{ env }}"
66

7-
- name: Deploy PostgreSQL Primary Node
7+
- name: Deploy PostgreSQL Node 1
88
ansible.builtin.import_playbook: pg_node.yaml
99
vars:
10-
host: postgres_primary
10+
host: postgres_1
1111
env: "{{ env }}"
1212

13-
- name: Deploy PostgreSQL Secondary Node
13+
- name: Deploy PostgreSQL Node 2
1414
ansible.builtin.import_playbook: pg_node.yaml
1515
vars:
16-
host: postgres_secondary
16+
host: postgres_2
1717
env: "{{ env }}"
1818

1919
- name: Run Database Migrations
2020
ansible.builtin.import_playbook: postgres_migrations.yaml
2121
vars:
22-
host: postgres_primary
22+
host: postgres_1
2323
env: "{{ env }}"

0 commit comments

Comments
 (0)