Skip to content

Commit 497cf0f

Browse files
committed
chore: update ansible and batcher service
1 parent f98ccac commit 497cf0f

File tree

7 files changed

+40
-47
lines changed

7 files changed

+40
-47
lines changed

infra/ansible/batcher.yaml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
- import_playbook: go.yaml
55
- import_playbook: eigenlayer-cli.yaml
66

7-
- hosts: aligned-holesky-batcher
7+
- hosts: batcher
88
become: true
99
vars:
10-
user: "{{ user }}"
10+
service: "batcher"
1111

1212
tasks:
1313
# Install required packages
@@ -16,32 +16,30 @@
1616
pkg:
1717
- pkg-config
1818
- libssl-dev
19-
- gcc
2019
state: latest
2120
update_cache: true
2221

2322
# Create directories for each service
2423
- name: Create directories for each service if do not exist
2524
ansible.builtin.file:
26-
path: /home/{{ user }}/repos/{{ item }}
25+
path: /home/{{ ansible_user }}/repos/{{ service }}
2726
state: directory
2827
mode: '0755'
29-
become_user: "{{ user }}"
30-
loop:
31-
- batcher
28+
become_user: "{{ ansible_user }}"
3229

33-
# Clone Aligned repository for each service
30+
# Clone Aligned repository for the service
3431
- name: Clone Aligned repository
3532
ansible.builtin.git:
3633
repo: https://github.com/yetanotherco/aligned_layer.git
37-
dest: /home/{{ user }}/repos/{{ item }}/aligned_layer
38-
version: v0.10.2
39-
become_user: "{{ user }}"
40-
loop:
41-
- batcher
42-
register: repo_clone
43-
failed_when:
44-
- repo_clone.failed
45-
- not 'Local modifications exist in the destination' in repo_clone.msg
34+
dest: /home/{{ ansible_user }}/repos/{{ service }}/aligned_layer
35+
version: batcher_ansible
36+
become_user: "{{ ansible_user }}"
4637

38+
# Build the batcher
39+
- name: Build Batcher
40+
shell: cd /home/{{ ansible_user }}/repos/{{ service }}/aligned_layer && make deps && make install_batcher
41+
become_user: "{{ ansible_user }}"
42+
environment:
43+
PATH: "$PATH:/home/admin/.cargo/bin:/usr/local/go/bin:$GOPATH/bin:/$HOME/go/bin:/usr/bin"
4744

45+
# Copy systemd service to user services

infra/ansible/eigenlayer-cli.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
- name: Eigenlayer CLI Setup
22
hosts: all
33
become: true
4-
vars:
5-
user: "{{ user }}"
64

75
tasks:
86
- name: check if eigenlayer is installed
@@ -14,7 +12,7 @@
1412
when: eigenlayer_exists is failed
1513
shell:
1614
cmd: curl -sSfL https://raw.githubusercontent.com/layr-labs/eigenlayer-cli/master/scripts/install.sh | sh -s
17-
become_user: "{{ user }}"
15+
become_user: "{{ ansible_user }}"
1816

1917
- name: Add eigenlayer path to ~/.profile
2018
when: eigenlayer_exists is failed

infra/ansible/rust.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
- name: Rust Setup
22
hosts: all
33
become: true
4-
vars:
5-
user: "{{ user }}"
64

75
pre_tasks:
86
- name: update repositories
@@ -28,6 +26,6 @@
2826
- name: install rust/cargo
2927
when: cargo_exists is failed
3028
shell: /tmp/sh.rustup.rs -y
31-
become_user: "{{ user }}"
29+
become_user: "{{ ansible_user }}"
3230
tags:
3331
- rust

infra/ansible/setup.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
- hosts: all
22

33
become: true
4-
vars:
5-
user: "{{ user }}"
64

75
tasks:
86
# Install required packages
@@ -14,6 +12,7 @@
1412
- git
1513
- ufw
1614
- make
15+
- gcc
1716
state: latest
1817
update_cache: true
1918

@@ -31,10 +30,10 @@
3130
# Create basic directories
3231
- name: Create basic directories if do not exist
3332
ansible.builtin.file:
34-
path: /home/{{ user }}/{{ item }}
33+
path: /home/{{ ansible_user }}/{{ item }}
3534
state: directory
3635
mode: '0755'
37-
become_user: "{{ user }}"
36+
become_user: "{{ ansible_user }}"
3837
loop:
3938
- repos
4039
- config

infra/ansible/stage_inventory.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
aggregator:
1+
#aggregator:
2+
# hosts:
3+
# aligned-holesky-aggregator-1:
4+
# ansible_host: aligned-ansible
5+
# ansible_user: admin
6+
# app_user: app
7+
# ansible_python_interpreter: /usr/bin/python3
8+
batcher:
29
hosts:
3-
aligned-holesky-aggregator-1:
4-
ansible_host: aligned-ansible
10+
aligned-holesky-stage-1:
11+
ansible_host: aligned-holesky-stage-1
512
ansible_user: admin
6-
app_user: app
713
ansible_python_interpreter: /usr/bin/python3
8-
#batcher:
9-
# hosts:
10-
# aligned-holesky-batcher:
11-
# ansible_host: aligned-holesky-batcher
12-
# ansible_user: admin
13-
# ansible_python_interpreter: /usr/bin/python3
14-
#explorer:
15-
# hosts:
16-
# aligned-holesky-explorer:
17-
# ansible_host: aligned-holesky-explorer
18-
# ansible_user: admin
19-
# ansible_python_interpreter: /usr/bin/python3
14+
# explorer:
15+
# hosts:
16+
# aligned-holesky-explorer:
17+
# ansible_host: aligned-holesky-explorer
18+
# ansible_user: admin
19+
# ansible_python_interpreter: /usr/bin/python3

infra/ansible/webserver.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@
6161
service:
6262
name: caddy
6363
enabled: yes
64-
state: started
64+
state: started

infra/services/batcher.service

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ After=network.target
44

55
[Service]
66
Type=simple
7-
User=ubuntu
8-
WorkingDirectory=/home/ubuntu/repos/batcher/aligned_layer/batcher
9-
ExecStart=/home/ubuntu/.cargo/bin/aligned-batcher --config /home/ubuntu/config/config-batcher-holesky.yaml --env-file /home/ubuntu/config/.env.batcher
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-holesky.yaml --env-file /home/{{ ansible_user }}/config/.env.batcher
109
Restart=always
1110
RestartSec=1
1211
StartLimitBurst=100
12+
LimitNOFILE=100000
1313

1414
[Install]
1515
WantedBy=multi-user.target

0 commit comments

Comments
 (0)