Skip to content

Commit

Permalink
Merge pull request #257 from OpenVoiceOS/feat/rust_messagebus
Browse files Browse the repository at this point in the history
[ansible/venv] Set Rust messagebus as default
  • Loading branch information
goldyfruit authored Feb 8, 2025
2 parents b7c12fe + e942d6a commit 8dcfe91
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 20 deletions.
59 changes: 45 additions & 14 deletions ansible/roles/ovos_installer/tasks/ovos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,33 @@
mode: "0755"
state: directory
loop:
- { "directory": "{{ ovos_installer_user_home }}/.config/systemd/user", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/ovos", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/ovos/config", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/ovos/config/phal", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/ovos/share", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/ovos/tmp", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/hivemind", "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}" }
- { "directory": "{{ ovos_installer_user_home }}/hivemind/config", "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}" }
- { "directory": "{{ ovos_installer_user_home }}/hivemind/share", "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}" }
- {
"directory": "{{ ovos_installer_user_home }}/.config/systemd/user",
"status": true,
}
- {"directory": "{{ ovos_installer_user_home }}/ovos", "status": true}
- {
"directory": "{{ ovos_installer_user_home }}/ovos/config",
"status": true,
}
- {
"directory": "{{ ovos_installer_user_home }}/ovos/config/phal",
"status": true,
}
- {"directory": "{{ ovos_installer_user_home }}/ovos/share", "status": true}
- {"directory": "{{ ovos_installer_user_home }}/ovos/tmp", "status": true}
- {
"directory": "{{ ovos_installer_user_home }}/hivemind",
"status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}",
}
- {
"directory": "{{ ovos_installer_user_home }}/hivemind/config",
"status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}",
}
- {
"directory": "{{ ovos_installer_user_home }}/hivemind/share",
"status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}",
}
when:
- item.status | bool
- ovos_installer_method == "containers"
Expand All @@ -68,11 +86,24 @@
mode: "0755"
state: directory
loop:
- { "directory": "{{ ovos_installer_user_home }}/.config/mycroft", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/.local/state/mycroft", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/.config/hivemind", "status": "{{ 'false' if ovos_installer_profile == 'ovos' else 'true' }}" }
- { "directory": "{{ ovos_installer_user_home }}/.config/systemd/user", "status": true }
- { "directory": "{{ ovos_installer_user_home }}/nltk_data", "status": true }
- {
"directory": "{{ ovos_installer_user_home }}/.config/mycroft",
"status": true,
}
- {
"directory": "{{ ovos_installer_user_home }}/.local/state/mycroft",
"status": true,
}
- {"directory": "{{ ovos_installer_user_home }}/.local/bin", "status": true}
- {
"directory": "{{ ovos_installer_user_home }}/.config/hivemind",
"status": "{{ 'false' if ovos_installer_profile == 'ovos' else 'true' }}",
}
- {
"directory": "{{ ovos_installer_user_home }}/.config/systemd/user",
"status": true,
}
- {"directory": "{{ ovos_installer_user_home }}/nltk_data", "status": true}
when:
- item.status | bool
- ovos_installer_method == "virtualenv"
Expand Down
14 changes: 14 additions & 0 deletions ansible/roles/ovos_installer/tasks/virtualenv/bus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Download and extract Rust messagebus
vars:
_ovos_rust_bus_repo: https://github.com/OscillateLabsLLC/ovos-rust-messagebus
_ovos_rust_bus_version: v1.1.0
_ovos_rust_bus_archive_name: "ovos_messagebus-{{ ansible_architecture }}-unknown-linux-gnu.tar.gz"
_ovos_rust_bus_url: "{{ _ovos_rust_bus_repo }}/releases/download/{{ _ovos_rust_bus_version }}/{{ _ovos_rust_bus_archive_name}}"
ansible.builtin.unarchive:
src: "{{ _ovos_rust_bus_url }}"
dest: "{{ ovos_installer_user_home }}/.local/bin"
mode: "0755"
owner: "{{ ovos_installer_user }}"
group: "{{ ovos_installer_group }}"
remote_src: true
3 changes: 3 additions & 0 deletions ansible/roles/ovos_installer/tasks/virtualenv/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
ansible.builtin.import_tasks: virtualenv/gui.yml
when: ovos_installer_feature_gui | bool or ovos_installer_cleaning | bool

- name: Include virtualenv/bus.yml
ansible.builtin.import_tasks: virtualenv/bus.yml

- name: Include virtualenv/systemd.yml
ansible.builtin.import_tasks: virtualenv/systemd.yml
3 changes: 2 additions & 1 deletion ansible/roles/ovos_installer/tasks/virtualenv/venv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@

- name: Remove {{ ovos_installer_user_home }}/.venvs/ovos Python virtualenv and requirements.txt files
ansible.builtin.file:
path: "{{ ovos_installer_user_home }}/.venvs/ovos"
path: "{{ item }}"
state: absent
loop:
- "{{ ovos_installer_user_home }}/.venvs/ovos"
Expand All @@ -198,6 +198,7 @@
- /tmp/server-requirements.txt
- /opt/mark1
- /opt/sj201
- "{{ ovos_installer_user_home }}/.local/bin/ovos-messagebus"
when: ovos_installer_cleaning | bool
tags:
- uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ ovos-audio[extras]
ovos-core[lgpl,plugins]
ovos-dinkum-listener[extras,linux]
ovos-docs-viewer
ovos-messagebus
ovos-PHAL[linux]
ovos-phal-plugin-ipgeo
ovos-tts-plugin-polly
Expand Down Expand Up @@ -31,4 +30,3 @@ ovos-PHAL[mk1]
ovos-PHAL[mk2dev]
git+https://github.com/OVOSHatchery/ovos-PHAL-plugin-sj201-leds.git
{% endif %}

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ PartOf=ovos.service
Requires=ovos.service

[Service]
WorkingDirectory=%h/.venvs/ovos
ExecStart=%h/.venvs/ovos/bin/ovos-messagebus
ExecStart=%h/.local/bin/ovos_messagebus-{{ ansible_architecture }}-unknown-linux-gnu
ExecReload=/usr/bin/kill -s HUP $MAINPID
ExecStop=/usr/bin/kill -s KILL $MAINPID
Restart=on-failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ hivemind-presence

# OVOS
ovos-core[lgpl,plugins]
ovos-messagebus

0 comments on commit 8dcfe91

Please sign in to comment.