Skip to content

Commit

Permalink
feat:semver
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Oct 25, 2024
1 parent 63be852 commit be15797
Show file tree
Hide file tree
Showing 9 changed files with 289 additions and 53 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
liberapay: jarbasAI
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/requirements" # Location of package manifests
schedule:
interval: "weekly"
25 changes: 25 additions & 0 deletions .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run Build Tests
on:
push:
workflow_dispatch:

jobs:
build_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Build Distribution Packages
run: |
python setup.py bdist_wheel
- name: Install package
run: |
pip install .
10 changes: 10 additions & 0 deletions .github/workflows/conventional-label.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# auto add labels to PRs
on:
pull_request_target:
types: [ opened, edited ]
name: conventional-release-labels
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: bcoe/conventional-release-labels@v1
35 changes: 35 additions & 0 deletions .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run License Tests
on:
push:
workflow_dispatch:

jobs:
license_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt install python3-dev swig libssl-dev
- name: Install core repo
run: |
pip install .
- name: Install licheck
run: |
pip install git+https://github.com/NeonJarbas/lichecker
- name: Install test dependencies
run: |
pip install pytest pytest-timeout pytest-cov
- name: Test Licenses
run: |
pytest test/license_tests.py
58 changes: 58 additions & 0 deletions .github/workflows/publish_stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Stable Release
on:
push:
branches: [master]
workflow_dispatch:

jobs:
publish_stable:
uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master
secrets: inherit
with:
branch: 'master'
version_file: 'hivemind_voice_relay/version.py'
setup_py: 'setup.py'
publish_release: true

publish_pypi:
needs: publish_stable
if: success() # Ensure this job only runs if the previous job succeeds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: dev
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: version
run: echo "::set-output name=version::$(python setup.py --version)"
id: version
- name: Build Distribution Packages
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{secrets.PYPI_TOKEN}}


sync_dev:
needs: publish_stable
if: success() # Ensure this job only runs if the previous job succeeds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
ref: master
- name: Push master -> dev
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: dev
108 changes: 108 additions & 0 deletions .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Release Alpha and Propose Stable

on:
pull_request:
types: [closed]
branches: [dev]

jobs:
publish_alpha:
if: github.event.pull_request.merged == true
uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master
secrets: inherit
with:
branch: 'dev'
version_file: 'hivemind_voice_relay/version.py'
setup_py: 'setup.py'
update_changelog: true
publish_prerelease: true
changelog_max_issues: 100

notify:
if: github.event.pull_request.merged == true
needs: publish_alpha
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Send message to Matrix bots channel
id: matrix-chat-message
uses: fadenb/[email protected]
with:
homeserver: 'matrix.org'
token: ${{ secrets.MATRIX_TOKEN }}
channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org'
message: |
new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }}
publish_pypi:
needs: publish_alpha
if: success() # Ensure this job only runs if the previous job succeeds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: dev
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: version
run: echo "::set-output name=version::$(python setup.py --version)"
id: version
- name: Build Distribution Packages
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{secrets.PYPI_TOKEN}}


propose_release:
needs: publish_alpha
if: success() # Ensure this job only runs if the previous job succeeds
runs-on: ubuntu-latest
steps:
- name: Checkout dev branch
uses: actions/checkout@v3
with:
ref: dev

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Get version from setup.py
id: get_version
run: |
VERSION=$(python setup.py --version)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create and push new branch
run: |
git checkout -b release-${{ env.VERSION }}
git push origin release-${{ env.VERSION }}
- name: Open Pull Request from dev to master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Variables
BRANCH_NAME="release-${{ env.VERSION }}"
BASE_BRANCH="master"
HEAD_BRANCH="release-${{ env.VERSION }}"
PR_TITLE="Release ${{ env.VERSION }}"
PR_BODY="Human review requested!"
# Create a PR using GitHub API
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_TOKEN" \
-d "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$HEAD_BRANCH\",\"base\":\"$BASE_BRANCH\"}" \
https://api.github.com/repos/${{ github.repository }}/pulls
89 changes: 39 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,51 @@
# HiveMind Voice Relay
### HiveMind Server Setups

OpenVoiceOS Relay, connect to [HiveMind](https://github.com/JarbasHiveMind/HiveMind-core)
When building your HiveMind servers there are many ways to go about it, with many optional components

Similar to [voice-satellite](https://github.com/JarbasHiveMind/HiveMind-voice-sat), but STT and TTS are sent to HiveMind instead of handled on device
Common setups:

running TTS/STT via hivemind has the advantage of access control, ie, requires an access key to use the plugins vs the non-authenticated public servers
- **OVOS Device**, a full OVOS install without hivemind
- **Hivemind Device**, a OVOS device also running hivemind, eg. a Mark2 with it's own satellites.
- **Hivemind Skills Server**, a minimal HiveMind server that satellites can connect to, supports **text** utterances
only
- **Hivemind Sound Server**, a HiveMind server that supports **text** utterances and **streaming audio**
- **Hivemind Persona Server**, exposes a `ovos-persona` (eg. an LLM) that satellites can connect to, without
running `ovos-core`.

## Install
The table below illustrates the most common setups for a OVOS based Mind, each column represents a running OVOS/HiveMind
service on your server

> NOTE: if using ovos-installer for the server side, the `listener` profile is required
| | **hivemind-core** | **hivemind-listener** | **ovos-core** | **ovos-audio** | **ovos-listener** | **hivemind-persona** |
|-----------------------------|-------------------|-----------------------|---------------|----------------|-------------------|----------------------|
| **OVOS Device** ||| ✔️ | ✔️ | ✔️ ||
| **Hivemind Device** | ✔️ || ✔️ | ✔️ | ✔️ ||
| **Hivemind Skills Server** | ✔️ || ✔️ ||||
| **Hivemind Sound Server** || ✔️ | ✔️ ||||
| **Hivemind Persona Server** |||||| ✔️ |

Install dependencies (if needed)
The table below indicates compatibility for each of the setups described above with the most common voice satellites,
each column corresponds to a different satellite

```bash
sudo apt-get install -y libpulse-dev libasound2-dev
```
| | **voice satellite** | **voice relay** | **mic satellite** |
|-----------------------------|---------------------|-----------------|-------------------|
| **OVOS Device** ||||
| **Hivemind Device** | ✔️ | ✔️ ||
| **Hivemind Skills Server** | ✔️ |||
| **Hivemind Sound Server** | ✔️ | ✔️ | ✔️ |
| **Hivemind Persona Server** | ✔️ |||

Install with pip
### HiveMind Satellites

```bash
$ pip install git+https://github.com/JarbasHiveMind/HiveMind-voice-relay
```
The table below illustrates how plugins from the OVOS ecosystem relate to the various satellites

## Usage
**Emoji Key**

```bash
Usage: hivemind-voice-relay [OPTIONS]
- ✔️: Local (on device)
- 📡: Remote (hivemind-listener)
- ❌: Unsupported

connect to HiveMind

Options:
--host TEXT hivemind host
--key TEXT Access Key
--password TEXT Password for key derivation
--port INTEGER HiveMind port number
--selfsigned accept self signed certificates
--help Show this message and exit.

```


## Configuration


Voice relay is built on top of [ovos-listener](https://openvoiceos.github.io/ovos-technical-manual/speech_service/) and [ovos-audio](https://openvoiceos.github.io/ovos-technical-manual/audio_service/), it uses the same OpenVoiceOS configuration `~/.config/mycroft/mycroft.conf`

Supported plugins:

| Plugin Type | Description | Required | Link |
|-------------|-------------|----------|------|
| Microphone | Captures voice input | Yes | [Microphone](https://openvoiceos.github.io/ovos-technical-manual/mic_plugins/) |
| VAD | Voice Activity Detection | Yes | [VAD](https://openvoiceos.github.io/ovos-technical-manual/vad_plugins/) |
| WakeWord | Detects wake words for interaction | Yes* | [WakeWord](https://openvoiceos.github.io/ovos-technical-manual/ww_plugins/) |
| Media Playback Plugins | Enables media playback (e.g., "play Metallica") | No | [Media Playback Plugins](https://openvoiceos.github.io/ovos-technical-manual/media_plugins/) |
| OCP Plugins | Provides playback support for URLs (e.g., YouTube) | No | [OCP Plugins](https://openvoiceos.github.io/ovos-technical-manual/ocp_plugins/) |
| Audio Transformers | Processes audio before speech-to-text (STT) | No | [Audio Transformers](https://openvoiceos.github.io/ovos-technical-manual/transformer_plugins/) |
| Dialog Transformers | Processes text before text-to-speech (TTS) | No | [Dialog Transformers](https://openvoiceos.github.io/ovos-technical-manual/transformer_plugins/) |
| TTS Transformers | Processes audio after text-to-speech (TTS) | No | [TTS Transformers](https://openvoiceos.github.io/ovos-technical-manual/transformer_plugins/) |
| PHAL | Provides platform-specific support (e.g., Mark 1) | No | [PHAL](https://openvoiceos.github.io/ovos-technical-manual/PHAL/) |

* can be skipped with [continuous listening mode](https://openvoiceos.github.io/ovos-technical-manual/speech_service/#modes-of-operation)
| Supported Plugins | **Microphone** | **VAD** | **Wake Word** | **STT** | **TTS** | **Media Playback** | **Transformers** | **PHAL** |
|-----------------------------------|------------------|------------------|------------------|------------------|------------------|--------------------|--------------------|--------------------|
| **HiveMind Voice Satellite** | ✔️<br>(Required) | ✔️<br>(Required) | ✔️<br>(Required) | ✔️<br>(Required) | ✔️<br>(Required) | ✔️<br>(Optional) | ✔️<br>(Optional) | ✔️<br>(Optional) |
| **HiveMind Voice Relay** | ✔️<br>(Required) | ✔️<br>(Required) | ✔️<br>(Required) | 📡<br>(Remote) | 📡<br>(Remote) | ✔️<br>(Optional) | ✔️<br>(Optional) | ✔️<br>(Optional) |
| **HiveMind Microphone Satellite** | ✔️<br>(Required) | ✔️<br>(Required) | 📡<br>(Remote) | 📡<br>(Remote) | 📡<br>(Remote) | ❌<br>(Unsupported) | ❌<br>(Unsupported) | ❌<br>(Unsupported) |
5 changes: 2 additions & 3 deletions hivemind_voice_relay/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# The following lines are replaced during the release process.
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 0
VERSION_BUILD = 1
VERSION_MINOR = 1
VERSION_BUILD = 0
VERSION_ALPHA = 1
# END_VERSION_BLOCK

0 comments on commit be15797

Please sign in to comment.