Remove usage of bash subshell in MSM for invocation of the
mycroft.message.send module. The virtualenv wouldn't be created in that
subshell, breaking Github-style installs of Mycroft.
A recent PR (#1192) eliminated the requirements that only applied to default
skills, not to the core itself. However this caused problems for skills that
were previously installed and had their PIP requirements satisfied by the
packages that came along with the mycroft-core Debian package previously.
As a hackinfix, we now re-run PIP on each skill during the MSM update, but
to limit the performance impact this only happens once per session. We
shouldn't to removing packages again in the future, so this should be a
one-time act that gets removed from MSM in the future (like at 18.02).
Remove the hardcoded DEFAULT_SKILLS list from MSM, instead read it
from the https://github.com/MycroftAI/mycroft-skills/DEFAULT-SKILLS
list.
Additionally, a platform-specific list will also be loaded, allowing
platforms like KDE, etc. to have different defaults. These are also
loaded from the mycroft-skills repo from a file named like:
DEFAULT-SKILLS.platform
Also began the work to support a custom local skill folder location,
specified in the /etc/mycroft/mycroft.conf.
==== Fixed Issues ====
A failed requirements.sh run would not send an install failure
notification on the messagebus.
==== Documentation Notes ====
NONE - description of a new feature or notes on behavior changes
==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.
==== Environment Notes ====
MSM now uses the 'jq' utility. This should already be installed on
a Picroft/Mark 1, but I added it to the dev_setup.sh also.
Indentation added in a recent PR (#1152) introduced a shell script
syntax error on a long line with continuations. Spaces are not
allowed before the subsequent line's double-quotes.
==== Fixed Issues ====
Indentation added in a recent PR (#1152) introduced a shell script
syntax error on a long line with continuations. Spaces are not
allowed before the subsequent line's double-quotes.
Significantly reworked the loading/updating of Skills. Unified
all management under a single SkillManager class. This class
runs as a thread that initially loads, upgrades (via MSM)
and reloads skills.
Removed the independent threads that were being run. The skill
updating still happens once an hour, but works in conjunction
with the scan to reload modified skills. Also added messagebus
notifications from MSM so mycroft-core can pause reloading
skills until the installation is complete.
Added a new mycroft.messagebus.send module to allow command
line interaction with the messagebus, e.g.:
python -m mycroft.messagebus.send mycroft.wifi.start
python -m mycroft.messagebus.send speak '{"utterance":"hello"}'
==== Fixed Issues ====
MSM installs that have PIP dependencies were failing, as the
load would occur after code was retrieved but before PIP install
completed. Restart was required to load new skills.
==== Tech Notes ====
TODO: Change the way we manage modules. The auto-load of the
remote configuration for the module is silly, slow and wasteful.
I made the WebsocketClient.build_url() method static in
anticipation of being able to do this more efficiently when the
submodule load doesn't hit the remove API automatically.
==== Localization Notes ====
Modified 'sorry I couldn't install default skills' message.
==== Protocol Notes ====
MSM now generates:
msm.updating
msm.installing
msm.install.succeeded { "skill" : name }
msm.install.failed { "skill" : name, "error" : code }
msm.installed
msm.updated
msm.removing
msm.remove.succeeded { "skill" : name }
msm.remove.failed { "skill" : name, "error" : code }
msm.removed
An update can now be forced by posting 'skillmanager.update' to the
messagebus.
MSM was invoking 'sudo chown' every time it installs new skills.
However the skill folder is already under the correct user when it
has been installed this way, so the chown is unnecessary. Now we
check for the user and group before performing the action.
On a Raspbian platform, MSM was attempting to perform a 'sudo chown'
on the skill folder after the install using a sudo command. When
running inside mycroft-core as the 'mycroft' user, there is no
'sudo' permission. However, this step isn't even needed since the
user installed as mycroft and the folder has the correct permissions.
Now it checks the user and group before attempting to perform the
action.
Semi-major rework of the Mycroft Skill Manager (MSM), including:
* Add parse skill name strings support for quoted strings, e.g.:
msm install "daily meditation"
Previously it would search for "daily" and also search for
"meditation", but both independently.
* All commands return distinct error codes. Commands with
that perform multiple things, such as 'msm default' will
continue on a failure of one skill and return the highest
error code ultimately.
* Add 'msm remove', essentially the inverse of 'msm install'
* Changed the example install URL to a penrods repo since the
ethanward repo no longer exists.
* Reworked skill list caching to behave properly with $( )
subprocess operations.
* Output for "install" and "remove" is now between hyphen
lines, making them easier to parse.
* Revamped many informational and error messages
* Published under Apache 2.0 license
A corresponding update to the skill-installer will take
advantage of these changes.
==== Tech Notes ====
fallback-aiml was added to list of default skills in msm and the
requirement aiml==0.8.6 was added to requirements
==== Documentation Notes ====
NONE - description of a new feature or notes on behavior changes
==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.
==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.
==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
Clean-up of many things about MSM:
* Improve help message, documenting all options
* Make the DEFAULT_SKILLS list readable (wrapped lines)
* Prefix messages with ERROR or WARNING
* Fix return codes, they can't be > 255. 301 and 303 are now 201 and 203
* Cache list of skills (instead of hitting web repeatedly)
* Improve code spacing, comments
* Improve format of output messages
* Sort skills from 'list' and 'search' commands
* Return result codes (was always 0)
==== Tech Notes ====
The "install" skill will be updated to use result codes instead
of searching for specific message strings. It was already
broken due to mismatch of the success message string.
==== Localization Notes ====
With error codes, output strings are less important
==== Fixed Issues ====
#966
==== Tech Notes ====
Adds a basic manual page for msm, required for packaging for some OS'es
==== Documentation Notes ====
NONE
==== Localization Notes ====
Might need translation at some point
==== Environment Notes ====
msm/man1/msm should be copied into the manual man1 directory
(/usr/local/share/man/man1) and mandb needs to be run after a package
install.
==== Protocol Notes ====
NONE