Skip to content

Commit 23e3741

Browse files
committed
chore: add config files to ansible scripts
1 parent ba159ce commit 23e3741

File tree

5 files changed

+89
-18
lines changed

5 files changed

+89
-18
lines changed

infra/ansible/playbooks/batcher.yaml

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@
3838
version: batcher_ansible
3939
recursive: false
4040

41-
# - name: Set permissions for cloned repository
42-
# ansible.builtin.file:
43-
# path: /home/{{ ansible_user }}/repos/{{ service }}/aligned_layer
44-
# mode: '0755'
45-
# owner: '{{ ansible_user }}'
46-
# group: '{{ ansible_user }}'
47-
# recurse: yes
48-
4941
# Build the batcher
5042
- name: Install deps
5143
make:
@@ -61,14 +53,43 @@
6153
environment:
6254
PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin:/home/{{ ansible_user }}/.cargo/bin"
6355

56+
- name: Create systemd services directory
57+
file:
58+
path: "/home/{{ ansible_user }}/.config/systemd/user/"
59+
state: directory
60+
61+
- name: Add service to systemd
62+
template:
63+
src: services/batcher.service.j2
64+
dest: "/home/{{ ansible_user }}/.config/systemd/user/batcher.service"
65+
force: no
6466

65-
# Copy systemd service to user services
66-
# - name: Copy systemd service file to server
67-
# copy:
68-
# src: /home/{{ ansible_user }}/repos/{{ service }}/aligned_layer/infra/services/batcher.service
69-
# remote_src: true
70-
# dest: /home/admin/.config/systemd/user/
71-
# owner: "{{ ansible_user }}"
72-
# group: "{{ ansible_user }}"
67+
- name: Upload config file for batcher
68+
template:
69+
src: config-files/config-batcher.yaml.j2
70+
dest: "/home/{{ ansible_user }}/config/config-batcher-holesky.yaml"
71+
vars:
72+
aligned_layer_deployment_config_file_path: "{{ lookup('ini', 'aligned_layer_deployment_config_file_path', file='ini/config-batcher.ini') }}"
73+
eigen_layer_deployment_config_file_path: "{{ lookup('ini', 'eigen_layer_deployment_config_file_path', file='ini/config-batcher.ini') }}"
74+
eth_rpc_url: "{{ lookup('ini', 'eth_rpc_url', file='ini/config-batcher.ini') }}"
75+
eth_rpc_url_fallback: "{{ lookup('ini', 'eth_rpc_url_fallback', file='ini/config-batcher.ini') }}"
76+
eth_ws_url: "{{ lookup('ini', 'eth_ws_url', file='ini/config-batcher.ini') }}"
77+
eth_ws_url_fallback: "{{ lookup('ini', 'eth_ws_url_fallback', file='ini/config-batcher.ini') }}"
78+
ecdsa_private_key_store_path: "{{ lookup('ini', 'ecdsa_private_key_store_path', file='ini/config-batcher.ini') }}"
79+
ecdsa_private_key_store_password: "{{ lookup('ini', 'ecdsa_private_key_store_password', file='ini/config-batcher.ini') }}"
80+
batcher_replacement_private_key: "{{ lookup('ini', 'batcher_replacement_private_key', file='ini/config-batcher.ini') }}"
81+
82+
83+
- name: Upload env file for batcher
84+
template:
85+
src: config-files/env-batcher.j2
86+
dest: "/home/{{ ansible_user }}/config/.env.batcher"
87+
vars:
88+
secret_access_key: "{{ lookup('ini', 'secret_access_key', file='ini/env-batcher.ini') }}"
89+
region: "{{ lookup('ini', 'region', file='ini/env-batcher.ini') }}"
90+
access_key_id: "{{ lookup('ini', 'access_key_id', file='ini/env-batcher.ini') }}"
91+
bucket_name: "{{ lookup('ini', 'bucket_name', file='ini/env-batcher.ini') }}"
92+
download_endpoint: "{{ lookup('ini', 'download_endpoint', file='ini/env-batcher.ini') }}"
93+
log_level: "{{ lookup('ini', 'log_level', file='ini/env-batcher.ini') }}"
7394

7495

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Common variables for all the services
2+
# 'production' only prints info and above. 'development' also prints debug
3+
environment: "production"
4+
aligned_layer_deployment_config_file_path: "{{ aligned_layer_deployment_config_file_path }}"
5+
eigen_layer_deployment_config_file_path: "{{ eigen_layer_deployment_config_file_path }}"
6+
eth_rpc_url: "{{ eth_rpc_url }}"
7+
eth_rpc_url_fallback: "{{ eth_rpc_url_fallback }}"
8+
eth_ws_url: "{{ eth_ws_url }}"
9+
eth_ws_url_fallback: "{{ eth_ws_url_fallback }}"
10+
eigen_metrics_ip_port_address: "localhost:9090"
11+
12+
## ECDSA Configurations
13+
ecdsa:
14+
private_key_store_path: "{{ ecdsa_private_key_store_path }}"
15+
private_key_store_password: "{{ ecdsa_private_key_store_password }}"
16+
17+
## Batcher configurations
18+
batcher:
19+
block_interval: 3
20+
batch_size_interval: 10
21+
max_proof_size: 67108864 # 64 MiB
22+
max_batch_size: 268435456 # 256 MiB
23+
eth_ws_reconnects: 99999999999999
24+
pre_verification_is_enabled: true
25+
metrics_port: 9093
26+
non_paying:
27+
address: 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 # Anvil address 9
28+
replacement_private_key: {{ batcher_replacement_private_key }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AWS_SECRET_ACCESS_KEY={{ secret_access_key }}
2+
AWS_REGION={{ region }}
3+
AWS_ACCESS_KEY_ID={{ access_key_id }}
4+
AWS_BUCKET_NAME={{ bucket_name }}
5+
DOWNLOAD_ENDPOINT={{ download_endpoint }}
6+
RUST_LOG={{ log_level }} # info, debug, error, warn, etc.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[Unit]
2+
Description=Batcher
3+
After=network.target
4+
5+
[Service]
6+
Type=simple
7+
WorkingDirectory=/home/{{ ansible_user }}/repos/batcher/aligned_layer/batcher
8+
ExecStart=/home/{{ ansible_user }}/.cargo/bin/aligned-batcher --config /home/{{ ansible_user }}/config/config-batcher.yaml --env-file /home/{{ ansible_user }}/config/.env.batcher
9+
Restart=always
10+
RestartSec=1
11+
StartLimitBurst=100
12+
LimitNOFILE=100000
13+
14+
[Install]
15+
WantedBy=multi-user.target

infra/ansible/stage_inventory.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
# aligned-holesky-aggregator-1:
44
# ansible_host: aligned-ansible
55
# ansible_user: admin
6-
# app_user: app
6+
# ansible_user: app
77
# ansible_python_interpreter: /usr/bin/python3
88
batcher:
99
hosts:
1010
aligned-holesky-stage-1:
1111
ansible_host: aligned-holesky-stage-1
12-
ansible_user: admin
12+
admin_user: admin
13+
ansible_user: app
1314
ansible_python_interpreter: /usr/bin/python3
1415
# explorer:
1516
# hosts:

0 commit comments

Comments
 (0)