Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b9fc3fe
feat: add hychain service
alex-klikatech Aug 23, 2024
3e3241c
Updates with hychain service
alex-klikatech Sep 9, 2024
996d7a7
Merge branch 'main' into 08-24-feat_sparkles_adds_hychain_service
alex-klikatech Sep 10, 2024
24e1f24
Autonomi service
alex-klikatech Sep 11, 2024
f732952
Update install.yml
alex-klikatech Sep 11, 2024
f2a87b0
Update install.yml
alex-klikatech Sep 11, 2024
dc8c781
Update hychain service with molecule integration
alex-klikatech Sep 11, 2024
85e3578
Merge branch '08-24-feat_sparkles_adds_hychain_service' of https://gi…
alex-klikatech Sep 11, 2024
9549458
Merge branch '09-10-fear_sparkles_adds_autonomi_service' of https://g…
alex-klikatech Sep 11, 2024
eeec2f0
Update autonomi service with molecule integration
alex-klikatech Sep 11, 2024
fc9a7e9
Merge branch 'main' into 08-24-feat_sparkles_adds_hychain_service
alex-klikatech Sep 16, 2024
49ea448
Update hychain service
alex-klikatech Sep 16, 2024
f727759
chore(hychain): bug fixes
anthonyra Sep 16, 2024
f7bd70e
add xai node
skuznetsov-klika Sep 17, 2024
736614a
Merge branch '09-16-chore_hychain_bug_fixes' into 09-10-feat_sparkles…
skuznetsov-klika Sep 17, 2024
f5f8302
add xai node
skuznetsov-klika Sep 17, 2024
d418523
Update xai service
alex-klikatech Sep 23, 2024
98bb1c1
Updates xai service
alex-klikatech Sep 25, 2024
d7e0c63
Merge branch 'main' into 09-10-feat_sparkles_adds_xai_service
alex-klikatech Oct 14, 2024
edabf38
Merge branch 'main' into 09-10-feat_sparkles_adds_xai_service
alex-klikatech Oct 25, 2024
c8a228e
Update xai/main.yml
alex-klikatech Oct 25, 2024
bd9d2cc
Updates after PR review
alex-klikatech Oct 25, 2024
bb922e2
update depin.core configuration
skuznetsov-klika Nov 20, 2024
57a60c6
Merge remote-tracking branch 'origin/09-10-feat_sparkles_adds_xai_ser…
skuznetsov-klika Nov 24, 2024
ab576e7
fix xai port
skuznetsov-klika Nov 26, 2024
61fb24c
removed start from main.yml
skuznetsov-klika Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions depin/core/roles/metrics/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
xai_metrics_port: 33005
1 change: 1 addition & 0 deletions depin/core/roles/metrics/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ metrics_port:
autonomi: 33002
hychain: 33003
storagechain: 33004
xai: 33005
14 changes: 14 additions & 0 deletions depin/services/roles/xai/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
xai_cmd: "{{ depin_cmd | default('install') }}"
xai_version: 1.1.14
xai_download_url: "https://github.com/xai-foundation/sentry/releases/latest/download/sentry-node-cli-linux.zip"
xai_install_path: "/opt/xai/{{ xai_version }}"
xai_node_count: 1
xai_node_port: 8545

xai_programs:
- name: sentry-node-cli-linux
url: "{{ xai_download_url }}"
checksum: ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checksum field is empty, which bypasses an important security check. Adding a SHA256 checksum for the XAI Sentry Node binary would protect against supply chain attacks and ensure binary integrity during downloads. Consider obtaining the official checksum from the XAI Foundation release page.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

install_path: "{{ xai_install_path }}"
symlink: /usr/local/bin/xai
63 changes: 63 additions & 0 deletions depin/services/roles/xai/tasks/commands/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
- name: Install programs using core.installer
ansible.builtin.include_role:
name: depin.core.installer
vars:
programs: "{{ xai_programs }}"

- name: Create program folder
become: true
ansible.builtin.file:
state: directory
owner: root
group: root
mode: '0755'
dest: "{{ item.install_path }}"
loop: "{{ xai_programs }}"

- name: Download binary to tmp
become: true
ansible.builtin.unarchive:
remote_src: true
src: "{{ item.url }}"
dest: /tmp
loop: "{{ xai_programs }}"
failed_when: false

- name: Find binary
become: true
ansible.builtin.find:
paths:
- /tmp
patterns: "{{ item.name }}"
use_regex: true
get_checksum: true
recurse: true
loop: "{{ xai_programs }}"
register: _downloads

- name: Install node
become: true
block:
- name: Copy required files
ansible.builtin.copy:
remote_src: true
src: "{{ (_downloads.results[loop.index0]['files'] | first).path }}"
dest: "{{ item.install_path }}"
mode: '0755'

- name: Symlink binary to path
become: true
ansible.builtin.file:
src: "{{ item.install_path }}/{{ item.name }}"
path: "{{ item.symlink }}"
mode: '0755'
owner: root
group: root
state: link
force: true
loop: "{{ xai_programs }}"

- name: Start node
ansible.builtin.include_tasks:
file: commands/start.yml
7 changes: 7 additions & 0 deletions depin/services/roles/xai/tasks/commands/reset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Uninstall
ansible.builtin.include_tasks: commands/uninstall.yml

- name: Install
ansible.builtin.include_tasks: commands/install.yml

7 changes: 7 additions & 0 deletions depin/services/roles/xai/tasks/commands/restart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
## stop and start service
- name: Stop
ansible.builtin.include_tasks: commands/stop.yml

- name: Start
ansible.builtin.include_tasks: commands/start.yml
2 changes: 2 additions & 0 deletions depin/services/roles/xai/tasks/commands/start.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing command

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't do this without test license keys and wallet

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# Run the XAI Sentry Node CLI
Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The start.yml task appears to be missing the implementation to start the XAI service. The xai_start_command variable is defined in defaults/main.yml but not utilized here. Consider adding a task to execute this command, likely using the ansible.builtin.command module.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have no license keys

2 changes: 2 additions & 0 deletions depin/services/roles/xai/tasks/commands/stop.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing command

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't do this without test license keys and wallet

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# Stop XAI Sentry Node service
Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stop.yml task appears to be missing the implementation to stop the XAI service. Consider adding a task that uses the xai_stop_command variable defined in defaults/main.yml to properly terminate the service.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same - without license keys impossible to write and check start/stop

16 changes: 16 additions & 0 deletions depin/services/roles/xai/tasks/commands/uninstall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# Stop the service before uninstalling
- name: Disable systemd service
ansible.builtin.include_tasks: commands/stop.yml

# Remove the binary file for XAI Sentry Node
- name: Remove XAI Sentry Node work directory
file:
path: /opt/xai
state: absent

- name: Remove XAI Sentry Node binary
file:
path: /usr/local/bin/xai
state: absent

6 changes: 6 additions & 0 deletions depin/services/roles/xai/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: XAI {{ xai_cmd }}
vars:
cmd_file: "{{ role_path }}/tasks/commands/{{ xai_cmd }}.yml"
when: cmd_file is file
ansible.builtin.include_tasks:
file: "{{ cmd_file }}"