Skip to content

Commit

Permalink
[debug] Add command to restart all containers
Browse files Browse the repository at this point in the history
  • Loading branch information
goldyfruit committed Dec 31, 2023
1 parent ef698eb commit 24a3352
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 83 deletions.
4 changes: 2 additions & 2 deletions docs/getting-started/docker/cli.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Open Voice OS command line

The command line allows you to send a message *(but not only)* directly to the message bus by using the `ovos-cli-client` command from the `ovo_cli` container.
The command line allows you to send a message _(but not only)_ directly to the message bus by using the `ovos-cli-client` command from the `ovo_cli` container.

!!! warning "Skill interactions"

Expand Down Expand Up @@ -70,7 +70,7 @@ An easy way to make Open Voice OS speaks is to run the `ovos-speak` command.

## mana

[Neon Mana](https://github.com/NeonGeckoCom/neon-mana-utils) *(Messagebus Application for Neon AI)* provides tools for interacting with the message bus.
[Neon Mana](https://github.com/NeonGeckoCom/neon-mana-utils) _(Messagebus Application for Neon AI)_ provides tools for interacting with the message bus.

=== "Docker"

Expand Down
64 changes: 32 additions & 32 deletions docs/getting-started/docker/composition.md

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions docs/getting-started/docker/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ First thing's first, enable the Open Voice OS's debug mode in `~/ovos/config/myc

All containers will have to be restarted to receive the configuration change.

```shell
docker restart --time 0 $(docker container list --all --filter 'name=ovos' --filter 'name=hivemind' --quiet)
```

```json title="~/ovos/config/mycroft.conf"
{
"debug": true,
Expand All @@ -16,11 +20,11 @@ First thing's first, enable the Open Voice OS's debug mode in `~/ovos/config/myc
```

!!! note
The commands below don't have to be executed in the same order as they are presented, free free to run them in the order you want!
The commands below don't have to be executed in the same order as they are presented, free free to run them in the order you want!

## All containers logs

Access all the container logs at the same time, run the following command *(make sure it matches the `docker compose` or `podman-compose` command you run to deploy the stack)*.
Access all the container logs at the same time, run the following command _(make sure it matches the `docker compose` or `podman-compose` command you run to deploy the stack)_.

=== "Docker"

Expand Down Expand Up @@ -68,7 +72,7 @@ Execute a command inside a container without going into it.

## Connect inside a container

Go inside a container and run multiple commands *(where `sh` is the available shell in there)*.
Go inside a container and run multiple commands _(where `sh` is the available shell in there)_.

=== "Docker"

Expand Down
18 changes: 9 additions & 9 deletions docs/getting-started/docker/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Container images could be used for different CPU architectures using the [multi-
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| :material-check-circle-outline:{ style="color: green"} `amd64` | Such as AMD and Intel processors |
| :material-check-circle-outline:{ style="color: green"} `aarch64` | Such as Raspberry Pi 64-bit SoC |
| :material-close-circle-outline:{ style="color: red" } `armv7l` | Such as Raspberry Pi 32-bit SoC (*not supported because of `onnxruntime`[^1]*) |
| :material-close-circle-outline:{ style="color: red" } `armv7l` | Such as Raspberry Pi 32-bit SoC (_not supported because of `onnxruntime`[^1]_) |

## Containers

Expand Down Expand Up @@ -57,14 +57,14 @@ Container image tags allows you to deploy a specific version of Open Voice OS, i

To allow data persistence, Docker or Podman volumes are required, they will prevent downloading the requirements everytime the containers are re-created.

| Volume | Description |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `ovos_gui_file` | Share QML files from skills between the GUI message bus and the GUI client |
| `ovos_listener_records` | [Wake words](../../about/glossary/terms.md#wake-word) and [utterances](../../about/glossary/terms.md#utterance) recorded samples |
| `ovos_models` | Models downloaded by `precise-lite` wake word plugin |
| `ovos_nltk` | [Punkt](https://www.askpython.com/python-modules/nltk-punkt) Python package required by [NLTK](https://www.nltk.org/index.html) |
| `ovos_tts_cache` | `.wav` and `.pho` files acting as cache from TTS transcription |
| `ovos_vosk` | Models downloaded by [VOSK](https://alphacephei.com/vosk/) during the initial boot |
| Volume | Description |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `ovos_gui_file` | Share QML files from skills between the GUI message bus and the GUI client |
| `ovos_listener_records` | [Wake words](../../about/glossary/terms.md#wake-word) and [utterances](../../about/glossary/terms.md#utterance) recorded samples |
| `ovos_models` | Models downloaded by `precise-lite` wake word plugin |
| `ovos_nltk` | [Punkt](https://www.askpython.com/python-modules/nltk-punkt) Python package required by [NLTK](https://www.nltk.org/index.html) |
| `ovos_tts_cache` | `.wav` and `.pho` files acting as cache from TTS transcription |
| `ovos_vosk` | Models downloaded by [VOSK](https://alphacephei.com/vosk/) during the initial boot |

`ovos_listener_records` allows you to store samples of wake words and utterances which could help you to build or improve models.

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/docker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Before going further, here are quick and simple definitions of what a container

> A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A container image is a lightweight, standalone, executable package of software that includes everything needed to run an application.
*<div align="right">[Initial source](https://www.docker.com/resources/what-container)</div>*
_<div align="right">[Initial source](https://www.docker.com/resources/what-container)</div>_

![type:video](https://www.youtube.com/embed/YFl2mCHdv24?si=z-bWBEPL5SKm2smo)

## Composer definition

> A composer is a tool for defining and running multi-container container applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.
*<div align="right">[Initial source](https://docs.docker.com/compose)</div>*
_<div align="right">[Initial source](https://docs.docker.com/compose)</div>_

![type:video](https://www.youtube.com/embed/Qw9zlE3t8Ko?si=YQOHX_Anq8NmvMZd)
11 changes: 5 additions & 6 deletions docs/getting-started/docker/installation/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This section covers the installation of the [core components](../../../about/glo

Before running the `docker compose` or `podman-compose` commands, please read this [section](../prerequisites/engine.md) first.


!!! note "Podman users :muscle:"

If you are running Podman instead of Docker, replace `docker compose` with `podman-compose`.
Expand Down Expand Up @@ -39,14 +38,14 @@ Before running the `docker compose` or `podman-compose` commands, please read th
docker compose --project-name ovos --file docker-compose.windows.yml up --detach
```

Depending your Internet speed, your Wi-Fi or Ethernet connection speed and your hardware *([I/O](https://en.wikipedia.org/wiki/Input/output))*, the whole process could take several minutes.
Depending your Internet speed, your Wi-Fi or Ethernet connection speed and your hardware _([I/O](https://en.wikipedia.org/wiki/Input/output))_, the whole process could take several minutes.

| Hardware | Time |
| ---------------------------------- | -------------- |
| Raspberry Pi 3B+ with USB drive | *~20 minutes* |
| Raspberry Pi 4B with USB drive | *~3 minutes* |
| MacBook Air i7 Early 2015 with SSD | *~2.5 minutes* |
| AMD Ryzen 7 5800 with NVMe drive | *~45 seconds* |
| Raspberry Pi 3B+ with USB drive | _~20 minutes_ |
| Raspberry Pi 4B with USB drive | _~3 minutes_ |
| MacBook Air i7 Early 2015 with SSD | _~2.5 minutes_ |
| AMD Ryzen 7 5800 with NVMe drive | _~45 seconds_ |

!!! danger "Resources overhead"

Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/docker/installation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This configuration is very basic, it instructs the Open Voice OS instance to run

By default, the Open Voice OS [services](../../../about/glossary/components.md) will write their logs into a file under `~/.local` directory, these files are not rotated or compressed which could lead to a disk space issue.

The solution is to add these lines into the `~/ovos/config/mycroft.conf` file *(create the file if it does not exist)*, this will tell the services to redirect their logs to the container `stdout`.
The solution is to add these lines into the `~/ovos/config/mycroft.conf` file _(create the file if it does not exist)_, this will tell the services to redirect their logs to the container `stdout`.

```json title="~/ovos/config/mycroft.conf"
{
Expand All @@ -49,9 +49,9 @@ The solution is to add these lines into the `~/ovos/config/mycroft.conf` file *(

## Custom `.asoundrc` for ALSA

Sometime a custom `.asoundrc` file migth be required, a common example is when a voice [HAT](https://www.raspberrypi.com/news/introducing-raspberry-pi-hats/) *(Hardware Attached on Top)* such as [Google AIY Voice Hat](https://aiyprojects.withgoogle.com/voice-v1/) is connected to a Raspberry Pi, a custom `.asoundrc` might be required to make it works with ALSA.
Sometime a custom `.asoundrc` file migth be required, a common example is when a voice [HAT](https://www.raspberrypi.com/news/introducing-raspberry-pi-hats/) _(Hardware Attached on Top)_ such as [Google AIY Voice Hat](https://aiyprojects.withgoogle.com/voice-v1/) is connected to a Raspberry Pi, a custom `.asoundrc` might be required to make it works with ALSA.

In order to pass this custom `.asoundrc` file to the containers, the file must be created within the `~/ovos/config/` directory and named `asoundrc` *(with no `.`)*.
In order to pass this custom `.asoundrc` file to the containers, the file must be created within the `~/ovos/config/` directory and named `asoundrc` _(with no `.`)_.

!!! info "Only for the containers using sound"

Expand Down
22 changes: 11 additions & 11 deletions docs/getting-started/docker/installation/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ ovos-skill-volume==0.0.1 # Specific skill version on PyPi
git+https://github.com/OpenVoiceOS/skill-ovos-wikipedia.git@fix/whatever # Specific skill's branch on GitHub
```

If the `ovos_core` container is wiped for any reasons *(like an update)*, the skill(s) will be automatically reprovisioned.
If the `ovos_core` container is wiped for any reasons _(like an update)_, the skill(s) will be automatically reprovisioned.

!!! tip "Not only for skills"

`skills.list` file could be used as well to install extra Python librairies, *e.g.*, `SoCo`, `RPi.GPIO`. Just make sure to avoid empty lines.

The main advantage of this method is the simplicity **but** the downside will be more Python dependencies *(libraries)* within the `ovos_core` container, potential conflicts across them, a lack of isolation and a slower start of the container.
The main advantage of this method is the simplicity **but** the downside will be more Python dependencies _(libraries)_ within the `ovos_core` container, potential conflicts across them, a lack of isolation and a slower start of the container.

## As standalone container *(recommended)*
## As standalone container _(recommended)_

The second method is to leverage the [ovos-workshop](../../../about/glossary/components.md#ovos-workshop) component by running a skill as standalone, it means the skill will not be part of `ovos_core` container but it will be running inside its own container.

The main advantage is that each skill is isolated which provide more flexibility about Python dependencies *(libraries)*, packages. It is easier to update and more secure **but** the downside will be that more system resources will be consumed and a container image has to be built for each skill.
The main advantage is that each skill is isolated which provide more flexibility about Python dependencies _(libraries)_, packages. It is easier to update and more secure **but** the downside will be that more system resources will be consumed and a container image has to be built for each skill.

!!! note "Podman users :muscle:"

Expand Down Expand Up @@ -64,14 +64,14 @@ The main advantage is that each skill is isolated which provide more flexibility
docker compose --project-name ovos --file docker-compose.windows.yml --file docker-compose.skills.yml up --detach
```

Depending your Internet speed, your Wi-Fi or Ethernet connection speed and your hardware *([I/O](https://en.wikipedia.org/wiki/Input/output))*, the whole process could take several minutes.
Depending your Internet speed, your Wi-Fi or Ethernet connection speed and your hardware _([I/O](https://en.wikipedia.org/wiki/Input/output))_, the whole process could take several minutes.

| Hardware | Time |
| ---------------------------------- | -------------- |
| Raspberry Pi 3B+ with USB drive | *~12 minutes* |
| Raspberry Pi 4B with USB drive | *~48 seconds* |
| MacBook Air i7 Early 2015 with SSD | *~50 seconds* |
| AMD Ryzen 7 5800 with NVMe drive | *~15 seconds* |
| Hardware | Time |
| ---------------------------------- | ------------- |
| Raspberry Pi 3B+ with USB drive | _~12 minutes_ |
| Raspberry Pi 4B with USB drive | _~48 seconds_ |
| MacBook Air i7 Early 2015 with SSD | _~50 seconds_ |
| AMD Ryzen 7 5800 with NVMe drive | _~15 seconds_ |

!!! danger "Resources overhead"

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/docker/plugins/microphone.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A microhpone plugin allows you to use a specific sound protocol in order to get

The `ovos_listener` container comes with few pre-installed microphone plugins such as:

- `ovos-microphone-plugin-alsa` is using [pyalsaaudio](https://larsimmisch.github.io/pyalsaaudio/) Python library *(default)*
- `ovos-microphone-plugin-alsa` is using [pyalsaaudio](https://larsimmisch.github.io/pyalsaaudio/) Python library _(default)_
- `ovos-microphone-plugin-sounddevice` is using [sounddevice](https://python-sounddevice.readthedocs.io/) Python library

If the existing microphone plugins are not enough then you can install yours by following the same principle as for the [STT plugins](./stt.md) by adding a `listener.list` file within the `~/ovos/config/` directory, this file acts as a Python `requirements.txt` file.
Expand Down Expand Up @@ -44,7 +44,7 @@ The `ovos_listener` container must be restarted if a change occurs in the `liste
Here are the two main plugins to use per platform.

| Plugin | Platforms |
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ovos-microphone-plugin-alsa` | :fontawesome-brands-linux:{ .lg title="Linux" } :fontawesome-brands-raspberry-pi:{ .lg title="Raspberry Pi" } :fontawesome-brands-apple:{ .lg title="Mac OS" } :fontawesome-brands-windows:{ .lg title="Windows WSL2" } |
| `ovos-microphone-plugin-sounddevice` | :fontawesome-brands-linux:{ .lg title="Linux" } :fontawesome-brands-raspberry-pi:{ .lg title="Raspberry Pi" } :fontawesome-brands-apple:{ .lg title="Mac OS" } :fontawesome-brands-windows:{ .lg title="Windows WSL2" } |

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/docker/prerequisites/cpu.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CPU instructions

In order to run [TensorFlow](https://en.wikipedia.org/wiki/TensorFlow) used by few Open Voice OS components, the [CPU](https://en.wikipedia.org/wiki/Central_processing_unit) must support `AVX` *(Advanced Vector Extensions)* instruction set for x86 processors or `SIMD` *(Single Instruction, Multiple Data)* instruction set for ARM processors.
In order to run [TensorFlow](https://en.wikipedia.org/wiki/TensorFlow) used by few Open Voice OS components, the [CPU](https://en.wikipedia.org/wiki/Central_processing_unit) must support `AVX` _(Advanced Vector Extensions)_ instruction set for x86 processors or `SIMD` _(Single Instruction, Multiple Data)_ instruction set for ARM processors.

=== "Linux"

Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/docker/prerequisites/engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Installation

As we are leveraging containers, a container engine such as Docker or Podman is required *(only one of them should be installed)*, as well as their `composer`.
As we are leveraging containers, a container engine such as Docker or Podman is required _(only one of them should be installed)_, as well as their `composer`.

*If you are not familiar with what a container engine or a `composer` are then please refer to [this section](../index.md) first as these fundamentals must be understood.*
_If you are not familiar with what a container engine or a `composer` are then please refer to [this section](../index.md) first as these fundamentals must be understood._

### Versions

Expand Down Expand Up @@ -32,7 +32,7 @@ To allow a simple user to execute the `docker` command, make sure to add the use
sudo usermod -a -G docker $USER
```

Once added to the `docker` group you will have to logout from the current session *(graphical or [SSH](https://en.wikipedia.org/wiki/Secure_Shell))* in order to get the group added to your user once you reconnect.
Once added to the `docker` group you will have to logout from the current session _(graphical or [SSH](https://en.wikipedia.org/wiki/Secure_Shell))_ in order to get the group added to your user once you reconnect.

Once reconnected, run the following command to ensure the `docker` has been appened to your `$USER`.

Expand All @@ -43,7 +43,7 @@ Once reconnected, run the following command to ensure the `docker` has been appe
uid=1000(foobar) gid=1000(foobar) groups=1000(foobar),973(docker)
```

*The `GID` could differ compare to your setup.*
_The `GID` could differ compare to your setup._

## Validation

Expand Down
Loading

0 comments on commit 24a3352

Please sign in to comment.