Commit Graph

67 Commits (553b95643e3b9c42ce75cefc9f83cd9b8d9814ba)

Author SHA1 Message Date
penrods a4db13a640 Remove one more subshell 2017-11-09 15:55:00 -06:00
penrods 4c9bbee680 Remove usage of bash subshell in MSM
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.
2017-11-09 15:55:00 -06:00
penrods 38d7a99b93 Remove offensive spaces
Bash likes "rc=$?", not "rc = $?"
2017-11-09 15:55:00 -06:00
penrods 8a1500f76a MSM rerun of skill requirements.txt once per session
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).
2017-11-09 13:06:37 -06:00
Tobias Knöppler 255acb4b58 Issues-1202 - Color `msm list` output 2017-11-07 19:12:32 +00:00
Tobias Knöppler (3knoeppl) e1212ceb1e Print message if no readme was found. 2017-11-07 17:37:20 +01:00
Tobias Knöppler (3knoeppl) 986797ac09 Fix readme not resolved correctly for some skills. 2017-11-07 17:33:38 +01:00
Tobias Knöppler b121e3ce37 Add missing msm command to `msm help` output. 2017-11-07 05:17:08 +00:00
Tobias Knöppler ba45efe957 Add `msm info <skill>` command which displays information about a skill. 2017-11-07 05:16:32 +00:00
Tobias Knöppler 9a1de05785 Indicate which skills are installed when executing `msm list`. 2017-11-07 05:15:53 +00:00
Steve Penrod fef914f771 Read default MSM skills from mycroft-skills repo
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.
2017-10-26 15:20:42 -07:00
Matthew D. Scholefield 5a77174ca6 Run requirements.sh when installing skills if exists 2017-10-20 12:57:27 -05:00
penrods 9fe017b341 Fix for install of MSM defaults
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.
2017-10-16 16:57:59 -05:00
penrods 3d64509b25 SkillManager, msm messagebus notifications
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.
2017-10-13 02:21:58 -05:00
Matthew D. Scholefield 6a3297e9b1 Add DuckDuckGo as default skill 2017-10-04 18:56:59 -05:00
Anunayj 4b4a48f796 Added Alternate path for Virtual Wrapper Python
Some user reported problems with the previous ones saying that virtualenvwrapper is a drectory (which it apperantly was)
2017-09-28 11:47:23 -05:00
valdr bc3990a704 Fix a small typo in line 12
"inclding" -> "including"
2017-09-27 10:55:09 -05:00
Steve Penrod 23bebb707c Fix install from within Mycroft on Mark1/Picroft
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.
2017-09-18 13:04:45 -07:00
Steve Penrod dd36f6dfca Fix MSM permissions installing on Mark 1/Picroft
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.
2017-09-18 12:59:13 -07:00
Åke Forslund a3474e6f5a Fix typo. 2017-09-18 11:09:44 +02:00
Steve Penrod ef3a55c946 Review item clean up
Cleaning up several small problems found wiht new MSM during review:
* Message formatting
* Incorrect spelling on a env var used
2017-09-18 00:40:16 -07:00
Steve Penrod f0a34db74e Add 'msm remove', improve error handling and parsing
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.
2017-09-17 13:00:23 -07:00
Matthew D. Scholefield 5b31047ccd Add check to see if on master branch in msm 2017-09-11 20:12:29 -05:00
Åke Forslund 0bd6c40694 Add fallback-aiml to defaults
====  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.
2017-08-18 02:13:01 -05:00
Steve Penrod 5e2567c481 General cleanup of Mycroft Skill Manager (msm) (#973)
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
2017-08-14 17:02:41 -05:00
Augusto Monteiro a5c35c785c Merge pull request #974 from forslund/feature/msm-man-page
Add manual page for msm
2017-08-09 13:40:36 -04:00
Åke Forslund 3dee3b5680 Add manual page for msm
==== 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
2017-08-09 12:39:52 +02:00
el-tocino 08e76e538d added actions to the help section of msm. (#972)
Add actions to the help section of msm.
2017-08-09 08:09:18 +02:00
Matthew D. Scholefield fee8ffab59 Change skill-wolfram-alpha to fallback-wolfram-alpha
This is necessary because of the API breaking change
2017-08-03 13:49:32 -05:00
el-tocino 98ee790d33 altered return codes for dupe/missing 2017-08-02 01:29:18 -05:00
Åke Forslund a2e0f31dd3 Add playback-control skill to defaults 2017-07-31 13:37:17 +02:00
Augusto Monteiro aa52100247 Merge pull request #907 from el-tocino/Issue#887
Issue 887 -- msm mk1 fix
2017-07-13 12:47:10 -04:00
el-tocino 46d5fc7d33 mark_1 conditionals 2017-07-11 01:00:00 -05:00
Augusto Monteiro 'Sparky 0c9e9893a5 On msm default also updating skills 2017-07-06 14:23:23 -05:00
Augusto Monteiro 'Sparky f23028949c #871 - Checking only tracked files 2017-07-06 08:06:02 -07:00
Augusto Monteiro 'Sparky 31637173db #871 - Adding comment 2017-07-06 08:06:02 -07:00
Augusto Monteiro 'Sparky dfa64942ea #871 - Updating only if doesn't have commit 2017-07-06 08:06:02 -07:00
Augusto Monteiro 'Sparky 9d9429a664 #871 - Using grep -q 2017-07-06 08:06:02 -07:00
Augusto Monteiro 'Sparky ba8a496be4 #871 - Instead of deleting the file just add .pyc 2017-07-06 08:06:02 -07:00
Augusto Monteiro 'Sparky e54b74f23c #871 - Fixing skill update on msm 2017-07-06 08:06:02 -07:00
Augusto Monteiro 'Sparky cde749a2fa #871 - Updating all skills 2017-07-06 08:06:02 -07:00
el-tocino 25e1a07a89 dir loop fix? 2017-06-29 02:30:19 -05:00
el-tocino 1815ad3dfd that extra m in there needed to go. 2017-06-11 02:03:06 -05:00
el-tocino 6232eda3b9 default skills list restored, picroft chown command added, exit code output added. 2017-06-11 01:58:33 -05:00
el-tocino 2cdb327ce8 removed missing skills from default list. 2017-06-10 10:54:55 -05:00
el-tocino f587be4689 updated default list 2017-06-10 10:50:47 -05:00
el-tocino bf99770e71 skip to next item in loop if skill dir exists. 2017-06-10 01:21:29 -05:00
el-tocino d33765daf4 skip if skill dir exists. 2017-06-10 01:20:04 -05:00
el-tocino 1e32728fbf extraneous verbiage removed. 2017-06-09 11:55:09 -05:00
el-tocino 2f8093ebce spacing/virtualenv/spelling/parsing errors should be fixed 2017-06-09 11:47:24 -05:00