Skip to content

Commit

Permalink
Update to v21.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
devs-mycroft committed Aug 27, 2021
2 parents 3c5820b + 13539d3 commit 3fbebd3
Show file tree
Hide file tree
Showing 135 changed files with 1,705 additions and 718 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ git push -f
```
10. If possible, create unit tests for your changes
* [Unit Tests for most contributions](https://github.com/MycroftAI/mycroft-core/tree/dev/test)
* [Intent Tests for new skills](https://mycroft-ai.gitbook.io/docs/#testing-your-skill)
* [Intent Tests for new skills](https://mycroft-ai.gitbook.io/docs/skill-development/voight-kampff)
* We utilize TRAVIS-CI, which will test each pull request. To test locally you can run: `./start-mycroft.sh unittest`
11. Once everything is okay, you can finally [create a Pull Request (PR)](https://help.github.com/articles/using-pull-requests/) on [MycroftAi/mycroft-core](https://github.com/MycroftAI/mycroft-core/pulls) to have your code reviewed and merged.
11. Once everything is okay, you can [create a Pull Request (PR)](https://help.github.com/articles/using-pull-requests/) on [MycroftAi/mycroft-core](https://github.com/MycroftAI/mycroft-core/pulls) to have your code reviewed and merged.

**Note**: Even if you have write access to the master branch, do not work directly on master!
**Note**: Do not work directly on the Master branch. All changes must be merged into dev, and will be automatically pushed to Master in the next release.

## Submit Changes

Expand Down
75 changes: 58 additions & 17 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ pipeline {
--label build=${JOB_NAME} \
-t voight-kampff-mark-1:${BRANCH_ALIAS} .'
echo 'Running Mark I Voight-Kampff Test Suite'
timeout(time: 60, unit: 'MINUTES')
timeout(time: 90, unit: 'MINUTES')
{
sh 'mkdir -p $HOME/core/$BRANCH_ALIAS/allure'
sh 'mkdir -p $HOME/core/$BRANCH_ALIAS/mycroft-logs'
sh 'docker run \
-v "$HOME/voight-kampff/identity:/root/.mycroft/identity" \
-v "$HOME/voight-kampff/identity:/root/.config/mycroft/identity" \
-v "$HOME/core/$BRANCH_ALIAS/allure:/root/allure" \
-v "$HOME/core/$BRANCH_ALIAS/mycroft-logs:/var/log/mycroft" \
--label build=${JOB_NAME} \
Expand Down Expand Up @@ -107,29 +107,53 @@ pipeline {
sh 'rmdir $HOME/core/$BRANCH_ALIAS'
sh (
label: 'Publish Report to Web Server',
script: '''scp allure-report.zip [email protected]:~;
ssh [email protected] "unzip -o ~/allure-report.zip";
script: '''
ssh [email protected] "mkdir -p ~/allure-reports/core/${BRANCH_ALIAS}";
scp allure-report.zip [email protected]:~/allure-reports/core/${BRANCH_ALIAS};
ssh [email protected] "unzip -o ~/allure-reports/core/${BRANCH_ALIAS}/allure-report.zip -d ~/allure-reports/core/${BRANCH_ALIAS}/";
ssh [email protected] "rm -rf /var/www/voight-kampff/core/${BRANCH_ALIAS}";
ssh [email protected] "mv allure-report /var/www/voight-kampff/core/${BRANCH_ALIAS}"
scp mycroft-logs.zip [email protected]:~;
ssh [email protected] "mv ~/allure-reports/core/${BRANCH_ALIAS}/allure-report /var/www/voight-kampff/core/${BRANCH_ALIAS}"
ssh [email protected] "rm ~/allure-reports/core/${BRANCH_ALIAS}/allure-report.zip";
ssh [email protected] "rmdir ~/allure-reports/core/${BRANCH_ALIAS}";
ssh [email protected] "mkdir -p ~/mycroft-logs/core/${BRANCH_ALIAS}";
scp mycroft-logs.zip [email protected]:~/mycroft-logs/core/${BRANCH_ALIAS}/;
ssh [email protected] "mkdir -p /var/www/voight-kampff/core/${BRANCH_ALIAS}/logs"
ssh [email protected] "unzip -oj ~/mycroft-logs.zip -d /var/www/voight-kampff/core/${BRANCH_ALIAS}/logs/";
ssh [email protected] "unzip -oj ~/mycroft-logs/core/${BRANCH_ALIAS}/mycroft-logs.zip -d /var/www/voight-kampff/core/${BRANCH_ALIAS}/logs/";
ssh [email protected] "rm ~/mycroft-logs/core/${BRANCH_ALIAS}/mycroft-logs.zip";
ssh [email protected] "rmdir ~/mycroft-logs/core/${BRANCH_ALIAS}";
'''
)
echo 'Report Published'
}
failure {
script {
def comment_text = 'Voight Kampff Integration Test Failed ([Results](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + ')). ' +
'\nMycroft logs are also available: ' +
'[skills.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/skills.log), ' +
'[audio.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/audio.log), ' +
'[voice.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/voice.log), ' +
'[bus.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/bus.log), ' +
'[enclosure.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/enclosure.log)'

// Create comment for Pull Requests
if (env.CHANGE_ID) {
echo 'Sending PR comment'
pullRequest.comment('Voight Kampff Integration Test Failed ([Results](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + ')). ' +
'\nMycroft logs are also available: ' +
'[skills.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/skills.log), ' +
'[audio.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/audio.log), ' +
'[voice.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/voice.log), ' +
'[bus.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/bus.log), ' +
'[enclosure.log](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '/logs/enclosure.log)')
def found_comment = false
for (comment in pullRequest.comments) {
echo "Author: ${comment.user}"
if (comment.user == "devops-mycroft" &&
comment.body.contains("Voight Kampff")) {
echo "Updating comment..."
found_comment = true
pullRequest.editComment(
comment.id,
comment_text
)
}
}
if (!found_comment) {
echo 'Sending PR comment'
pullRequest.comment(comment_text)
}
}
}
// Send failure email containing a link to the Jenkins build
Expand Down Expand Up @@ -184,8 +208,25 @@ pipeline {
success {
script {
if (env.CHANGE_ID) {
echo 'Sending PR comment'
pullRequest.comment('Voight Kampff Integration Test Succeeded ([Results](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '))')
def comment_text = 'Voight Kampff Integration Test Succeeded ([Results](https://reports.mycroft.ai/core/' + env.BRANCH_ALIAS + '))'
def found_comment = false
for (comment in pullRequest.comments) {
echo "Author: ${comment.user}"
if (comment.user == "devops-mycroft" &&
comment.body.contains("Voight Kampff")) {
echo "Updating comment!"
found_comment = true
pullRequest.editComment(
comment.id,
comment_text
)
break
}
}
if (!found_comment) {
echo 'Sending PR comment'
pullRequest.comment(comment_text)
}
}
}
// Send success email containing a link to the Jenkins build
Expand Down
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,20 @@ Mycroft is nothing without skills. There are a handful of default skills that a

### Pairing Information
Pairing information generated by registering with Home is stored in:
`~/.mycroft/identity/identity2.json` <b><-- DO NOT SHARE THIS WITH OTHERS!</b>
`~/.config/mycroft/identity/identity2.json` <b><-- DO NOT SHARE THIS WITH OTHERS!</b>

### Configuration
Mycroft's configuration consists of 4 possible locations:
- `mycroft-core/mycroft/configuration/mycroft.conf`(Defaults)
- [Mycroft Home](https://home.mycroft.ai) (Remote)
- `/etc/mycroft/mycroft.conf`(Machine)
- `$HOME/.mycroft/mycroft.conf`(User)
- `/etc/mycroft/mycroft.conf` (Machine)
- `$XDG_CONFIG_DIR/mycroft/mycroft.conf` (which is by default `$HOME/.config/mycroft/mycroft.conf`) (USER)

When the configuration loader starts, it looks in these locations in this order, and loads ALL configurations. Keys that exist in multiple configuration files will be overridden by the last file to contain the value. This process results in a minimal amount being written for a specific device and user, without modifying default distribution files.

### Using Mycroft Without Home

If you do not wish to use the Mycroft Home service, before starting Mycroft for the first time, create `$HOME/.mycroft/mycroft.conf` with the following contents:
If you do not wish to use the Mycroft Home service, before starting Mycroft for the first time, create `$HOME/.config/mycroft/mycroft.conf` with the following contents:

```
{
Expand All @@ -99,28 +99,18 @@ If you do not wish to use the Mycroft Home service, before starting Mycroft for
}
```

Mycroft will then be unable to perform speech-to-text conversion, so you'll need to set that up as well, using one of the [STT engines Mycroft supports](https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/customizations/stt-engine).

You may insert your own API keys into the configuration files listed above in <b>Configuration</b>. For example, to insert the API key for the Weather skill, create a new JSON key in the configuration file like so:

```
{
// other configuration settings...
//
"WeatherSkill": {
"api_key": "<insert your API key here>"
}
}
```

### API Key Services

These are the keys currently used in Mycroft Core:
The Mycroft backend provides access to a range of API keys for specific services. Without pairing with the Mycroft backend, you will need to add your own API keys, install a different Skill or Plugin to perform that function, or not have access to that functionality.

These are the keys currently used in Mycroft Core through the Mycroft backend:

- [STT API, Google STT, Google Cloud Speech](http://www.chromium.org/developers/how-tos/api-keys)
- [A range of STT services](https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/customizations/stt-engine) are available for use with Mycroft.
- [Weather Skill API, OpenWeatherMap](http://openweathermap.org/api)
- [Wolfram-Alpha Skill](http://products.wolframalpha.com/api/)


### Using Mycroft behind a proxy

Many schools, universities and workplaces run a `proxy` on their network. If you need to type in a username and password to access the external internet, then you are likely behind a `proxy`.
Expand Down
6 changes: 3 additions & 3 deletions bin/mycroft-config
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ function validate_config_file() {
return $result
}

_conf_file="~/.mycroft/mycroft.conf"
_conf_file="${XDG_CONFIG_HOME:-$HOME/.config}/mycroft/mycroft.conf"
function name_to_path() {
case ${1} in
"system") _conf_file="/etc/mycroft/mycroft.conf" ;;
"user") _conf_file=$(readlink -f ~/.mycroft/mycroft.conf) ;;
"user") _conf_file=$(readlink -f ${XDG_CONFIG_HOME:-$HOME/.config}/mycroft/mycroft.conf) ;;
"default") _conf_file="$DIR/../mycroft/configuration/mycroft.conf" ;;
"remote") _conf_file="/var/tmp/mycroft_web_cache.json" ;;
"remote") _conf_file="$HOME/.cache/mycroft/web_cache.json" ;;

*)
echo "ERROR: Unknown name '${1}'."
Expand Down
28 changes: 27 additions & 1 deletion dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,32 @@ This script is designed to make working with Mycroft easy. During this
first run of dev_setup we will ask you a few questions to help setup
your environment.'
sleep 0.5
# The AVX instruction set is an x86 construct
# ARM has a range of equivalents, unsure which are (un)supported by TF.
if ! grep -q avx /proc/cpuinfo && [[ ! $(uname -m) == 'arm'* ]]; then
echo "
The Precise Wake Word Engine requires the AVX instruction set, which is
not supported on your CPU. Do you want to fall back to the PocketSphinx
engine? Advanced users can build the precise engine with an older
version of TensorFlow (v1.13) if desired and change use_precise to true
in mycroft.conf.
Y)es, I want to use the PocketSphinx engine or my own.
N)o, stop the installation."
if get_YN ; then
if [[ ! -f /etc/mycroft/mycroft.conf ]]; then
$SUDO mkdir -p /etc/mycroft
$SUDO touch /etc/mycroft/mycroft.conf
$SUDO bash -c 'echo "{ \"use_precise\": true }" > /etc/mycroft/mycroft.conf'
else
$SUDO bash -c 'jq ". + { \"use_precise\": true }" /etc/mycroft/mycroft.conf > tmp.mycroft.conf'
$SUDO mv -f tmp.mycroft.conf /etc/mycroft/mycroft.conf
fi
else
echo -e "$HIGHLIGHT N - quit the installation $RESET"
exit 1
fi
echo
fi
echo "
Do you want to run on 'master' or against a dev branch? Unless you are
a developer modifying mycroft-core itself, you should run on the
Expand Down Expand Up @@ -340,7 +366,7 @@ function open_suse_install() {


function fedora_install() {
$SUDO dnf install -y git python3 python3-devel python3-pip python3-setuptools python3-virtualenv pygobject3-devel libtool libffi-devel openssl-devel autoconf bison swig glib2-devel portaudio-devel mpg123 mpg123-plugins-pulseaudio screen curl pkgconfig libicu-devel automake libjpeg-turbo-devel fann-devel gcc-c++ redhat-rpm-config jq make
$SUDO dnf install -y git python3 python3-devel python3-pip python3-setuptools python3-virtualenv pygobject3-devel libtool libffi-devel openssl-devel autoconf bison swig glib2-devel portaudio-devel mpg123 mpg123-plugins-pulseaudio screen curl pkgconfig libicu-devel automake libjpeg-turbo-devel fann-devel gcc-c++ redhat-rpm-config jq make pulseaudio-utils
}


Expand Down
25 changes: 23 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import sys
import re
import os
from os.path import dirname, join

import sphinx_rtd_theme
from sphinx.ext.autodoc import (
Expand Down Expand Up @@ -74,13 +75,33 @@ def iad_add_directive_header(self, sig):
source_suffix = '.rst'
master_doc = 'index'


def get_version():
version_file = join(dirname(__file__),
'..', 'mycroft', 'version', '__init__.py')
with open(version_file) as f:
while 'START_VERSION_BLOCK' not in f.readline():
pass

def safe_read_version_line():
try:
return f.readline().split('=')[1].strip()
except Exception:
return '0'

major = safe_read_version_line()
minor = safe_read_version_line()
build = safe_read_version_line()
return 'v' + '.'.join((major, minor, build))


# General Info
project = 'Mycroft'
copyright = '2017, Mycroft AI Inc.'
author = 'Mycroft AI Inc.'

version = '0.1.0'
release = '0.1.0' # Includes alpha/beta/rc tags.
version = get_version()
release = version

language = None
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. Mycroft documentation master file
Mycroft-core technical documentation
====================================

Expand Down
10 changes: 6 additions & 4 deletions doc/source/mycroft.audio.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
mycroft.audio package
mycroft.audio
====================

wait_while_speaking
-------------------
.. autofunction:: mycroft.audio.wait_while_speaking
.. automodule:: mycroft.audio
:members:
is_speaking,
stop_speaking,
wait_while_speaking
21 changes: 13 additions & 8 deletions doc/source/mycroft.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ mycroft.skills
==============

MycroftSkill class - Base class for all Mycroft skills
------------------
------------------------------------------------------

.. autoclass:: mycroft.MycroftSkill
:members:

CommonIoTSkill class
-------------------
--------------------
.. autoclass:: mycroft.skills.common_iot_skill.CommonIoTSkill
:show-inheritance:
:members:

CommonPlaySkill class
-------------------
---------------------
.. autoclass:: mycroft.skills.common_play_skill.CommonPlaySkill
:show-inheritance:
:members:

CommonQuerySkill class
-------------------
----------------------
.. autoclass:: mycroft.skills.common_query_skill.CommonQuerySkill
:show-inheritance:
:members:
Expand Down Expand Up @@ -56,6 +56,12 @@ removes_context decorator
-------------------------
.. autofunction:: mycroft.removes_context

mycroft.audio
==================

.. toctree::
mycroft.audio

mycroft.filesystem
==================

Expand All @@ -73,16 +79,15 @@ mycroft.util

.. toctree::
mycroft.util.parse

Parsing functions for extracting data from natural speech.

.. toctree::
mycroft.util.format

Formatting functions for producing natural speech from common datatypes such as numbers, dates and times.

.. toctree::
mycroft.util.time
A collection of functions for handling local, system and global times.

-----------------
.. automodule::
mycroft.util.time
A collection of functions for handling local, system and global times.
2 changes: 1 addition & 1 deletion doc/source/mycroft.util.format.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mycroft.util.format
==================
===================

.. automodule:: mycroft.util.format
:members:
Expand Down
16 changes: 0 additions & 16 deletions doc/source/mycroft.util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,6 @@ play_ogg
---------
.. autofunction:: mycroft.util.play_ogg

extract_datetime
----------------
.. autofunction:: mycroft.util.extract_datetime

extract_number
-------------
.. autofunction:: mycroft.util.extract_number

normalize
---------
.. autofunction:: mycroft.util.normalize

nice_number
-----------
.. autofunction:: mycroft.util.nice_number

resolve_resource_file
---------------------
.. autofunction:: mycroft.util.resolve_resource_file
Expand Down
Loading

0 comments on commit 3fbebd3

Please sign in to comment.