Coder Social home page Coder Social logo

smartgic / docker-mycroft Goto Github PK

View Code? Open in Web Editor NEW
41.0 7.0 8.0 106 KB

Mycroft AI Voice Assistant Docker images and docker-compose.yml files for x86_64, arm7vl and aarch64 CPU architectures.

Home Page: https://hub.docker.com/u/smartgic

License: Apache License 2.0

Shell 49.91% Dockerfile 50.09%
docker mycroftai voice-assistant docker-compose container mycroft docker-mycroft compose arm64 rpi

docker-mycroft's Introduction

docker-mycroft's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-mycroft's Issues

run.sh syntax errors

Lines 45 and 46 contain syntax errors where the : should be ;
They are currently

45: m) modelsfolder=${OPTARG};:

46: s) cachefolder=${OPTARG};:

but should be

45: m) modelsfolder=${OPTARG};;

46: s) cachefolder=${OPTARG};;

FileNotFoundError(2, "No such file or directory: 'paplay'"

2021-11-25 20:24:19,484 ERROR mycroft.util.audio_utils:play_wav:111 Failed to launch WAV: paplay %1 --stream-name=mycroft-voice (FileNotFoundError(2, "No such file or directory: 'paplay'"))
2021-11-25 20:24:19,487 ERROR mycroft.skills.event_scheduler:on_error:331 An error occured executing the scheduled event AttributeError("'NoneType' object has no attribute 'wait'")
Traceback (most recent call last):
  File "/home/mycroft/core/mycroft/skills/mycroft_skill/event_container.py", line 107, in wrapper
    handler()
  File "/opt/mycroft/skills/mycroft-timer.mycroftai/__init__.py", line 737, in check_for_expired_timers
    play_proc.wait()
AttributeError: 'NoneType' object has no attribute 'wait'

paplay is part of pulseaudio-utils on Debian.

Mimic3 Error

Thank you for putting the effort into splitting this out.

Debian 11 64-bit
Raspberry Pi 4 (8gb)

I've gotten the stack up and running but when I switch from mimic to mimic3 and any audio response gets generated, I get an error.

2022-09-22 15:51:39.312 | INFO     |     1 | mycroft.util.process_utils:start_message_bus_client:155 | Connected to messagebus
2022-09-22 15:51:41.970 | INFO     |     1 | mycroft.tts.tts:create:706 | Loaded plugin mimic3_tts_plug
2022-09-22 15:51:41.987 | ERROR    |     1 | mycroft.tts.tts:create:715 | The selected TTS backend couldn't be loaded. Falling back to Mimic
Traceback (most recent call last):
  File "/home/mycroft/core/mycroft/tts/tts.py", line 710, in create
    tts = clazz(tts_lang, tts_config)
  File "/opt/mycroft-venv/lib/python3.9/site-packages/mycroft_plugin_tts_mimic3/__init__.py", line 110, in __init__
    self.tts.preload_voice(voice)
  File "/opt/mycroft-venv/lib/python3.9/site-packages/mimic3_tts/tts.py", line 310, in preload_voice
    self._get_or_load_voice(key_to_load)
  File "/opt/mycroft-venv/lib/python3.9/site-packages/mimic3_tts/tts.py", line 553, in _get_or_load_voice
    maybe_model_dir = self._download_voice(voice_key)
  File "/opt/mycroft-venv/lib/python3.9/site-packages/mimic3_tts/tts.py", line 605, in _download_voice
    download_voice(
  File "/opt/mycroft-venv/lib/python3.9/site-packages/mimic3_tts/download.py", line 85, in download_voice
    voice_dir = Path(voices_dir) / voice_key
  File "/usr/lib/python3.9/pathlib.py", line 1071, in __new__
    self = cls._from_parts(args, init=False)
  File "/usr/lib/python3.9/pathlib.py", line 696, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "/usr/lib/python3.9/pathlib.py", line 680, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
  Carnegie Mellon University, Copyright (c) 1999-2011, all rights reserved
  mimic developers, Copyright (c) 2016, all rights reserved
  version: mimic-1.1.0.9000 ()

I've tried
$ mycroft-config set tts.module mimic3_tts_plug

As well as the example config from the mimic3 GitHub page

I've only started tinkering with this and I'll post any progress I make, I'm curious if anyone has gotten this working.

Thanks

error: can't find Rust compiler

During first start of mycroft_skills Docker container (before the pairing), this error appears in the log even if CRYPTOGRAPHY_DONT_BUILD_RUST is set to 1.

	    running build_ext
	    generating cffi module 'build/temp.linux-aarch64-3.7/_openssl.c'
	    creating build/temp.linux-aarch64-3.7
	    running build_rust
	    
	        =============================DEBUG ASSISTANCE=============================
	        If you are seeing a compilation error please try the following steps to
	        successfully install cryptography:
	        1) Upgrade to the latest pip and try again. This will fix errors for most
	           users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
	        2) Read https://cryptography.io/en/latest/installation/ for specific
	           instructions for your platform.
	        3) Check our frequently asked questions for more information:
	           https://cryptography.io/en/latest/faq/
	        4) Ensure you have a recent Rust toolchain installed:
	           https://cryptography.io/en/latest/installation/#rust
	    
	        Python: 3.7.3
	        platform: Linux-5.10.0-v8+-aarch64-with-debian-10.11
	        pip: 18.1
	        setuptools: 58.3.0
	        setuptools_rust: 0.12.1
	        =============================DEBUG ASSISTANCE=============================
	    
	    error: can't find Rust compiler
	    
	    If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
	    
	    To update pip, run:
	    
	        pip install --upgrade pip
	    
	    and then retry package installation.
	    
	    If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
	    
	    This package requires Rust >=1.41.0.
	    
	    ----------------------------------------
	
	  Failed building wheel for cryptography
	  Failed cleaning build dir for cryptography
	Command "/opt/mycroft-venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-36ll0cuj/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-bbin2vw0/install-record.txt --single-version-externally-managed --compile --install-headers /opt/mycroft-venv/include/site/python3.7/cryptography" failed with error code 1 in /tmp/pip-install-36ll0cuj/cryptography/
)

Make /tmp/mycroft/ipc a bind mount

The mycroft_voice container which runs the mycroft.client.speech Python process writes a "lot" on the disk because of the microphone level meter feature (thanks @JarbasAl for pointing this).

This is a sample of 11 minutes monitoring the IOPS:

Total DISK READ:         0.00 B/s | Total DISK WRITE:        40.46 K/s
Current DISK READ:       0.00 B/s | Current DISK WRITE:      44.13 K/s
    PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND                                                                                                                                                                    
 177310 ?sys pi            0.00 B     44.41 M  0.00 %  0.88 % python -m mycroft.client.speech

iostat -dmzx 1 sample:

iostat

On a normal drive this is not an issue but on an SD Card it could be pretty disruptive.

Failed to create: /opt/mycroft/voices

When using Mimic 3, mycroft_audio container raises a warning related to directory creation.

2022-05-24 10:07:12.889 | WARNING  |     1 | mycroft.util.file_utils:ensure_directory_exists:273 | Failed to create: /opt/mycroft/voices

This prevent Mimic 3 to download the configured voice.

Getting Mimic3 working with these containers

I didn't build my own containers, I used the dockerhub images. This is my untested method to get mimic3 working with these images and the logic is sound. I should probably fork, but I'm on a time crunch and need to get it out of my head sooner than later and the time to build on my system is pathetic.

  1. /audio/Dockerfile - Create the voices target directory otherwise permissions get all messed up if the path doesn't exist within the image before a volume mount.
 RUN mkdir -p /home/mycroft/.config/pulse && \
+  mkdir -p /home/mycroft/.local/share/mycroft/mimic3/voices && \
   pip3 install --no-cache-dir -r /home/mycroft/core/requirements/extra-audiobackend.txt boto3==1.24.74 \
   mycroft-plugin-tts-mimic3[all] && \
   rm -rf ~/.cache
  1. .env && .env-raspberrypi
    MIMIC3_MODELS_FOLDER=~/mycroft-mimic3-models/voices

  2. On host
    mkdir -p ~/mycroft-mimic3-models/voices/

  3. docker-compose.yml

  mycroft_audio:
    container_name: mycroft_audio
    ...
    volumes:
      - ...
      - ${MIMIC3_MODELS_FOLDER}:/home/mycroft/.local/share/mycroft/mimic3/voices
  1. For the first time startup, the user will need to download the voice they want. You can clone the Mimic3 repo but it's going to consume quite a bit of space. I just download the 1 voice I liked.

docker exec -it mycroft_audio mimic3-download en_US/vctk_low

  1. Now with the voice data downloaded, just restart the stack or just the mycroft_audio container.

With the above setup and the following mycroft.conf, Mimic3 should be working perfectly.

{
  "max_allowed_core_version": 21.2,
  "hotwords": {
    "hey mycroft": {
      "module": "ovos-precise-lite",
      "model": "~/models/precise-lite-models/wakewords/en/hey_mycroft.tflite",
      "sensitivity": 0.5,
      "trigger_level": 3
    }
  },
  "tts": {
    "module": "mimic3_tts_plug",
    "mimic3_tts_plug": {
        "voice": "en_US/vctk_low",
        "speaker": "p283",
        "length_scale": 1.2,
        "noise_scale": 0.667,
        "noise_w": 1.0
    }
  }
}

Allow pi user to use OpenGL

mycroft_gui container runs a QT interface which leverage OpenGL. The mycroft user should be able to leverage OpenGL which is not currently the case due to groups "conflict" between the container and the host.

When running as root user, OpenGL is working fine.

mycroft_skills and mycroft_audio container needs to share /tmp/mycroft/cache

When using the the NewsSkill, mycroft_audio container is not able to play the stream file retrieved from mycroft_skills.

The reason is because the file is downloaded into /tmp/mycroft/cache/NewsSkill/ directory within the mycroft_skills container.

The solution will be to share a volume between the two containers.

Impossible to update configuration because device isn't paired

Once docker-compose process finished, Mycroft doesn't provide the pairing code.

From the mycroft_skills container logs, the Impossible to update configuration because device isn't paired is recurrent with a 401.

2021-03-16 00:27:28.305 | DEBUG    |     1 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
2021-03-16 00:27:28.565 | DEBUG    |     1 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device//setting HTTP/1.1" 401 34
2021-03-16 00:27:28.569 | WARNING  |     1 | ConfigurationSkill | Impossible to update configuration because device isn't paired

Precise could not be downloaded(

Thanks for making this cool project. In the logs of the stable version mycroft-voice:stable I see the logs say:

Precise could not be downloaded(ValueError('Invalid MD5 url: https://github.com/MycroftAI/mycroft-precise/releases/download/v0.2.0/precise-engine_0.2.0_armv7l.tar.gz.md5'))

No such file or directory when playing sound

When a skill uses the CommonPlaySkill implementation to leverage CPS_play (with a file) and let the sound play through the mycroft_audio container it generates an error:

Directory: /tmp/mycroft/cache/tts/PollyTTS/
Playing MPEG stream 1 of 1: 0eea217916f0a0f5b37cd8a2c54e876e.mp3 ...
[src/libmpg123/readers.c:1184] error: Cannot open file /opt/mycroft/skills/mycroft-ring-skill.smartgic/assets/doorbell_1.mp3: No such file or directory
main: [src/mpg123.c:708] error: Cannot open /opt/mycroft/skills/mycroft-ring-skill.smartgic/assets/doorbell_1.mp3: File access error. (code 22)

The mycroft_skills and mycroft_audio containers need to share the skill data.

Package libffi was not found in the pkg-config search path

base image cannot be build due to libffi-dev missing package.

#15 354.7   Building wheels for collected packages: cffi
#15 354.7     Running setup.py bdist_wheel for cffi: started
#15 354.7     Running setup.py bdist_wheel for cffi: finished with status 'error'
#15 354.7     Complete output from command /opt/mycroft-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-za1wrhmd/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-prmglp4b --python-tag cp37:
#15 354.7     Package libffi was not found in the pkg-config search path.
#15 354.7     Perhaps you should add the directory containing `libffi.pc'
#15 354.7     to the PKG_CONFIG_PATH environment variable
#15 354.7     No package 'libffi' found
#15 354.7     Package libffi was not found in the pkg-config search path.
#15 354.7     Perhaps you should add the directory containing `libffi.pc'
#15 354.7     to the PKG_CONFIG_PATH environment variable
#15 354.7     No package 'libffi' found
#15 354.7     Package libffi was not found in the pkg-config search path.
#15 354.7     Perhaps you should add the directory containing `libffi.pc'
#15 354.7     to the PKG_CONFIG_PATH environment variable
#15 354.7     No package 'libffi' found
#15 354.7     Package libffi was not found in the pkg-config search path.
#15 354.7     Perhaps you should add the directory containing `libffi.pc'
#15 354.7     to the PKG_CONFIG_PATH environment variable
#15 354.7     No package 'libffi' found
#15 354.7     Package libffi was not found in the pkg-config search path.
#15 354.7     Perhaps you should add the directory containing `libffi.pc'
#15 354.7     to the PKG_CONFIG_PATH environment variable
#15 354.7     No package 'libffi' found
#15 354.7     running bdist_wheel
#15 354.7     running build
#15 354.7     running build_py
#15 354.7     creating build
#15 354.7     creating build/lib.linux-armv7l-3.7
#15 354.7     creating build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/error.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/api.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/recompiler.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/commontypes.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/lock.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/__init__.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/cparser.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/verifier.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/model.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/_embedding.h -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.7/cffi
#15 354.7     running build_ext
#15 354.7     building '_cffi_backend' extension
#15 354.7     creating build/temp.linux-armv7l-3.7
#15 354.7     creating build/temp.linux-armv7l-3.7/c
#15 354.7     arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/opt/mycroft-venv/include -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.7/c/_cffi_backend.o
#15 354.7     c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
#15 354.7      #include <ffi.h>
#15 354.7               ^~~~~~~
#15 354.7     compilation terminated.
#15 354.7     error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
#15 354.7   
#15 354.7     ----------------------------------------
#15 354.7     Failed building wheel for cffi
#15 354.7     Running setup.py clean for cffi
#15 354.7   Failed to build cffi
#15 354.7   Installing collected packages: setuptools, wheel, pycparser, cffi
#15 354.7     Running setup.py install for cffi: started
#15 354.7       Running setup.py install for cffi: finished with status 'error'
#15 354.7       Complete output from command /opt/mycroft-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-za1wrhmd/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-2s1x1mhd/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-sptwjy9n --compile --install-headers /opt/mycroft-venv/include/site/python3.7/cffi:
#15 354.7       Package libffi was not found in the pkg-config search path.
#15 354.7       Perhaps you should add the directory containing `libffi.pc'
#15 354.7       to the PKG_CONFIG_PATH environment variable
#15 354.7       No package 'libffi' found
#15 354.7       Package libffi was not found in the pkg-config search path.
#15 354.7       Perhaps you should add the directory containing `libffi.pc'
#15 354.7       to the PKG_CONFIG_PATH environment variable
#15 354.7       No package 'libffi' found
#15 354.7       Package libffi was not found in the pkg-config search path.
#15 354.7       Perhaps you should add the directory containing `libffi.pc'
#15 354.7       to the PKG_CONFIG_PATH environment variable
#15 354.7       No package 'libffi' found
#15 354.7       Package libffi was not found in the pkg-config search path.
#15 354.7       Perhaps you should add the directory containing `libffi.pc'
#15 354.7       to the PKG_CONFIG_PATH environment variable
#15 354.7       No package 'libffi' found
#15 354.7       Package libffi was not found in the pkg-config search path.
#15 354.7       Perhaps you should add the directory containing `libffi.pc'
#15 354.7       to the PKG_CONFIG_PATH environment variable
#15 354.7       No package 'libffi' found
#15 354.7       running install
#15 354.7       running build
#15 354.7       running build_py
#15 354.7       creating build
#15 354.7       creating build/lib.linux-armv7l-3.7
#15 354.7       creating build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/error.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/api.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/recompiler.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/commontypes.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/lock.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/__init__.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/cparser.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/verifier.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/model.py -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/_embedding.h -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.7/cffi
#15 354.7       running build_ext
#15 354.7       building '_cffi_backend' extension
#15 354.7       creating build/temp.linux-armv7l-3.7
#15 354.7       creating build/temp.linux-armv7l-3.7/c
#15 354.7       arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/opt/mycroft-venv/include -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.7/c/_cffi_backend.o
#15 354.7       c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
#15 354.7        #include <ffi.h>
#15 354.7                 ^~~~~~~
#15 354.7       compilation terminated.
#15 354.7       error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
#15 354.7   
#15 354.7       ----------------------------------------
#15 354.7   Command "/opt/mycroft-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-za1wrhmd/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-2s1x1mhd/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-sptwjy9n --compile --install-headers /opt/mycroft-venv/include/site/python3.7/cffi" failed with error code 1 in /tmp/pip-install-za1wrhmd/cffi/
#15 354.7   
#15 354.7   ----------------------------------------
#15 356.0 Command "/opt/mycroft-venv/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-sptwjy9n --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.8.0 wheel "cffi>=1.4.1; python_implementation != 'PyPy'"" failed with error code 1 in None
#15 ERROR: executor failed running [/bin/sh -c git clone https://github.com/MycroftAI/mycroft-core.git   $MYCROFT_DIR -b $BRANCH &&   pip3 install wheel &&   pip3 install -r ${MYCROFT_DIR}/requirements/requirements.txt &&   echo "${MYCROFT_DIR}" > ${VIRTUAL_ENV}/lib/python$(eval ${PYTHON_VERSION})/site-packages/mycroft.pth &&   rm -rf ${HOME}/.cache &&   mkdir -p /tmp/mycroft/ipc /home/mycroft/.mycroft /tmp/mycroft/cache]: exit code: 1

#9 [linux/arm64 3/3] RUN git clone https://github.com/MycroftAI/mycroft-core.git   /home/mycroft/core -b dev &&   pip3 install wheel &&   pip3 install -r /home/mycroft/core/requirements/requirements.txt &&   echo "/home/mycroft/core" > /opt/mycroft-venv/lib/python$(eval python3 -c 'from sys import version_info as i; print(f"{i[0]}.{i[1]}")')/site-packages/mycroft.pth &&   rm -rf ${HOME}/.cache &&   mkdir -p /tmp/mycroft/ipc /home/mycroft/.mycroft /tmp/mycroft/cache
#9 sha256:222eef62311fc0e9f7f3df7477bb6eab4ecf1d5b6d4bdfd8570e03d208b80a08
#9 CANCELED

Persistency required for Mimic3 voices

Error reported in #29

I did find an issue when I restarted everything (docker-compose down/up). If the voices aren't cached the mimic3 will fail on startup.

If I log into the container and execute:

mimic3 --voice en_US/vctk_low#p283 "test" > /tmp/output.wav

it will download the voice data to /home/mycroft/.local/share/mycroft/mimic3/voices/, which gets clobbered on restart. It looks like it needs a volume like Precise-lite with a local clone of https://github.com/MycroftAI/mimic3-voices

/opt/mycroft/preloaded_cache/Mimic2 is missing

When using mimic2 as TTS module, mycroft_audio container complains about a missing directory.

FileNotFoundError: [Errno 2] No such file or directory: '/opt/mycroft/preloaded_cache/Mimic2/f495a9c0aa47ba47ff5bdfe28c5fea4e.wav'

Permissions denied /tmp

I'm trying to deploy mycroft via Portainer
Here's mycroft_skills log:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/mycroft/core/mycroft/skills/__main__.py", line 295, in <module>
  File "/home/mycroft/core/mycroft/skills/__main__.py", line 200, in main
  File "/home/mycroft/core/mycroft/lock/__init__.py", line 119, in __init__
    mycroft.lock.Lock('skills')
  File "/home/mycroft/core/mycroft/lock/__init__.py", line 173, in create
    self.create()
    self.touch()
  File "/home/mycroft/core/mycroft/lock/__init__.py", line 160, in touch
    with open(self.path, 'w') as L:
PermissionError: [Errno 13] Permission denied: '/tmp/mycroft/skills.pid'

My .env file:

CONFIG_FOLDER=/media/Dane/.docker/mycroft/mycroft-config
WEBCACHE_FOLDER=/media/Dane/.docker/mycroft/mycroft-web-cache
MODELS_FOLDER=/media/Dane/.docker/mycroft/mycroft-precise-models
CACHE_FOLDER=/media/Dane/.docker/mycroft/mycroft-cache
MIMIC3_VOICES_FOLDER=/media/Dane/.docker/mycroft/mycroft-mimic3-voices
COMPOSE_HTTP_TIMEOUT=120
VERSION=latest
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=~/.docker.xauth
X11_SOCKET=/tmp/.X11-unix

Files in /media/Dane/.docker/mycroft are created fine

Use --ipc=host for Docker

Using the shared IPC with Docker could add a small latency, using the host IPC should avoid this overhead but reduce the security.

FileNotFoundError: [Errno 2] No such file or directory: 'arecord': 'arecord'

arecord is required by the recording skill which is executed from mycroft_skills

2021-11-24 23:47:29,790 ERROR mycroft.skills.mycroft_skill.mycroft_skill:on_error:923 An error occurred while processing a request in Audio Record Skill
Traceback (most recent call last):
  File "/home/mycroft/core/mycroft/skills/mycroft_skill/event_container.py", line 73, in wrapper
    handler(message)
  File "/opt/mycroft/skills/mycroft-audio-record.mycroftai/__init__.py", line 145, in handle_record
    self.settings["channels"])
  File "/home/mycroft/core/mycroft/util/audio_utils.py", line 185, in record
    return subprocess.Popen(command)
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'arecord': 'arecord'

arecord is part of alsa-utils on Debian.

Duplicate mounts for skills

Running the docker compose file doesn't work right now because there is a duplicate mount error.

- ~/mycroft-config:/home/mycroft/.config/mycroft
- mycroft_skills_config:/home/mycroft/.config/mycroft

Both the local config file and the Mycroft_skills_config volume try and mount to the same location in the container.

Add timezone support

In order to fix an issue about the timezone between the host and the containers, we need to add a fix into the docker-compose.yml to pass the correct timezone.

custom device "/dev/gpiomem": no such file or directory

It seems like docker-compose.yml is built more towards Raspberry Pis, but the /dev/gpiomem kernel device does not exist in amd64 Linux computers.

Since there is the ability to specify the Docker-Compose filename, can we create a file like rpi-compose.yml and remove the /dev/gpiomem device in the original docker-compose.yml? Removing (or commenting) docker-compose.yml#L108 seems to make it work just fine on Docker under Ubuntu 20.04 LTS.

Thanks in advance!

[Errno 13] Permission denied: '/home/mycroft/.config/mycroft/skills

From mycroft_skills Docker container logs:

2021-10-22 23:00:39.950 | ERROR    |     1 | mycroft.skills.skill_loader:_create_skill_instance:295 | Skill __init__ failed with PermissionError(13, 'Permission denied')
Traceback (most recent call last):
  File "/home/mycroft/core/mycroft/skills/skill_loader.py", line 292, in _create_skill_instance
    self.instance = skill_module.create_skill()
  File "/opt/mycroft/skills/mycroft-ip.mycroftai/__init__.py", line 186, in create_skill
    return IPSkill()
  File "/opt/mycroft/skills/mycroft-ip.mycroftai/__init__.py", line 68, in __init__
    super(IPSkill, self).__init__(name="IPSkill")
  File "/home/mycroft/core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 142, in __init__
    self._init_settings()
  File "/home/mycroft/core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 178, in _init_settings
    'mycroft', 'skills', basename(self.root_dir)))
  File "/opt/mycroft-venv/lib/python3.7/site-packages/xdg/BaseDirectory.py", line 58, in save_config_path
    os.makedirs(path, 0o700)
  File "/usr/lib/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/mycroft/.config/mycroft/skills'

web_cache.json path changed

Previously, web_cache.json file was under /var/tmp directory. Now the file is under /home/mycroft/.cache/mycroft directory.

This requires to change the base image and change the mount point of WEB_CACHE_FOLDER in docker-compose.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.