Skip to content

Commit

Permalink
Dockerized Mycroft in catalan
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoreilly committed Dec 30, 2020
0 parents commit 3bba89b
Show file tree
Hide file tree
Showing 11 changed files with 268 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logs
skills
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "mycroft-core"]
path = mycroft-core
url = https://github.com/assistent-cat/mycroft-core
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM python:3.8.5-buster as base

ENV TERM linux
ENV DEBIAN_FRONTEND noninteractive

# Install Server Dependencies for Mycroft
RUN set -x \
&& sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list \
&& apt-get update \
&& apt-get -y install --no-install-recommends git locales sudo libtool \
libffi-dev libssl-dev autoconf automake bison swig libglib2.0-dev \
portaudio19-dev mpg123 screen flac curl libicu-dev pkg-config \
libjpeg-dev libfann-dev build-essential jq pulseaudio \
pulseaudio-utils festival festvox-ca-ona-hts lame vlc mplayer \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Set the locale
RUN echo 'ca_ES.UTF-8 UTF-8' > /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=ca_ES.UTF-8
ENV LANG ca_ES.UTF-8
ENV LANGUAGE ca_ES
ENV LC_ALL ca_ES.UTF-8

RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

COPY ./mycroft-core/mycroft /opt/mycroft/mycroft
COPY ./mycroft-core/bin /opt/mycroft/bin
COPY ./mycroft-core/scripts /opt/mycroft/scripts
RUN chmod +x /opt/mycroft/bin/*
RUN mkdir -p /var/log/mycroft
RUN mkdir -p /opt/mycroft/skills

COPY ./init.sh /opt/mycroft/init.sh
RUN chmod +x /opt/mycroft/init.sh

COPY ./mycroft.conf /root/.mycroft/mycroft.conf

COPY ./docker-requirements.txt /opt/mycroft/docker-requirements.txt
RUN pip install -U pip && pip install -r /opt/mycroft/docker-requirements.txt


WORKDIR /opt/mycroft
ENV PYTHONPATH $PYTHONPATH:/mycroft/ai
ENV PATH="/opt/mycroft/bin:$PATH"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Docker Mycroft en Català

Opinionated dockerized Mycroft for the catalan language. Used mainly for debugging skills.
22 changes: 22 additions & 0 deletions docker-compose.with-voice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3.7"
services:
mycroft:
container_name: mycroft
build:
context: .
ports:
- "8181:8181"
environment:
PULSE_SERVER: docker.for.mac.localhost
volumes:
- ./skills:/opt/mycroft/skills
- ./supervisord.conf:/opt/mycroft/supervisord.conf
- ./mycroft.conf:/root/.mycroft/mycroft.conf
- ./logs:/var/log/mycroft
- ~/.config/pulse/cookie:/root/.config/pulse/cookie
devices:
- "/dev/snd:/dev/snd"
command: supervisord -c /opt/mycroft/supervisord.conf

volumes:
skills:
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3.7"
services:
mycroft:
container_name: mycroft
build:
context: .
ports:
- "8181:8181"
environment:
PULSE_SERVER: docker.for.mac.localhost
volumes:
- ./skills:/opt/mycroft/skills
- ./supervisord.conf:/opt/mycroft/supervisord.conf
- ./mycroft.conf:/root/.mycroft/mycroft.conf
- ./logs:/var/log/mycroft
- ~/.config/pulse/cookie:/root/.config/pulse/cookie
command: supervisord -c /opt/mycroft/supervisord.conf

volumes:
skills:
32 changes: 32 additions & 0 deletions docker-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
six==1.13.0
requests==2.20.0
gTTS==2.2.0
PyAudio==0.2.11
pyee==8.1.0
SpeechRecognition==3.8.1
tornado==6.0.3
websocket-client==0.54.0
requests-futures==0.9.5
pyserial==3.0
psutil==5.6.6
pocketsphinx==0.1.0
inflection==0.3.1
pillow==7.1.2
python-dateutil==2.6.0
fasteners==0.14.1
PyYAML==5.1.2
msm==0.8.8
msk==0.3.16
adapt-parser==0.3.7
padatious==0.4.8
fann2==1.0.7
padaos==0.1.9
precise-runner==0.2.1
petact==0.1.2
pyxdg==0.26
pychromecast==3.2.2
python-vlc==1.1.2
pyalsaaudio==0.8.2
google-api-python-client==1.6.4
supervisor==4.2.1
git+https://github.com/MycroftAI/lingua-franca.git@d30424e19d5ac641f1ccd1d4d91f9d7fec2e8a31
9 changes: 9 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SKILLS_DIR=${SKILLS_DIR:-"/opt/mycroft/skills"}

if [[ ! -f "$SKILLS_DIR/.initiated" ]]; then

msm install https://github.com/JarbasSkills/skill-wolfie
msm install https://github.com/assistent-cat/skill-contes

touch "$SKILLS_DIR/.initiated"
fi
1 change: 1 addition & 0 deletions mycroft-core
Submodule mycroft-core added at 6f8bae
93 changes: 93 additions & 0 deletions mycroft.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"lang": "ca-es",
"stt": {
"module": "chromium_stt_plug",
"chromium_stt_plug": {
"lang": "ca-ES"
}
},
"tts": {
"module": "festival",
"festival": {
"lang": "catalan",
"encoding": "ISO-8859-15//TRANSLIT"
}
},
"location": {
"city": {
"code": "Barcelona",
"name": "Barcelona",
"state": {
"code": "BCN",
"name": "Barcelona",
"country": {
"code": "ES",
"name": "Spain"
}
}
},
"coordinate": {
"latitude": 41.3948976,
"longitude": 2.0787282
},
"timezone": {
"code": "Madrid/Spain",
"name": "Madrid/Spain",
"dstOffset": 7200000,
"offset": 3600000
}
},
"skills": {
"msm": {
// Relative to "data_dir"
"directory": "skills",
"versioned": true,
"repo": {
// Relative to "data_dir"
"cache": ".skills-repo",
"url": "https://github.com/assistent-cat/habilitats",
"branch": "master"
}
},
"blacklisted_skills": [
"mycroft-npr-news.mycroftai",
"mycroft-fallback-duck-duck-go.mycroftai",
"mycroft-joke.mycroftai",
"fallback-wolfram-alpha.mycroftai",
"mycroft-volume.mycroftai",
"mycroft-pairing.mycroftai",
"mycroft-stock.mycroftai"
],
"priority_skills": []
},
"listener": {
"stand_up_word": "desperta"
},
"hotwords": {
"desperta": {
"module": "snowboy_ww_plug",
"models": [
{
"sensitivity": 0.5,
"model_path": "desperta_jm.pmdl"
},
{
"sensitivity": 0.5,
"model_path": "desperta_jm2.pmdl"
}
]
}
},
"max_allowed_core_version": 20.8,
"Audio": {
"backends": {
"vlc": {
"type": "vlc",
"active": true,
"duck": true,
"vlc_options": "--no-video"
}
},
"default-backend": "vlc"
}
}
35 changes: 35 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[supervisord]
nodaemon=true

[program:init]
command=bash init.sh
loglevel=debug
stdout_logfile=/var/log/mycroft/skills.log
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/mycroft/skill.log
stderr_logfile_maxbytes=0

[program:bus]
command=python -m mycroft.messagebus.service
loglevel=debug
stdout_logfile=/var/log/mycroft/bus.log
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/mycroft/bus.log
stderr_logfile_maxbytes=0

[program:audio]
command=python -m mycroft.audio
loglevel=debug
stdout_logfile=/var/log/mycroft/audio.log
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/mycroft/audio.log
stderr_logfile_maxbytes=0

[program:skills]
command=python -m mycroft.skills
loglevel=debug
stdout_logfile=/var/log/mycroft/skills.log
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/mycroft/skill.log
stderr_logfile_maxbytes=0

0 comments on commit 3bba89b

Please sign in to comment.