mycroft-core icon indicating copy to clipboard operation
mycroft-core copied to clipboard

Read skills from XDG Base directory specification locations

Open PureTryOut opened this issue 3 years ago • 65 comments

Description

~This makes mycroft-core read skills from all locations as specified by the XDG Base Directory specification, so in /usr/share/mycroft/skills, /usr/local/share/mycroft/skills, and $XDG_DATA_HOME/.local/share/mycroft/skills if it exists and otherwise ~/.local/share/mycroft/skills.~

This makes mycroft-core read skills from the XDG Base Directory location in the user's home folder, so $XDG_DATA_HOME/.local/share/mycroft/skills if it exists and otherwise ~/.local/share/mycroft/skills.

This requires https://github.com/MycroftAI/mycroft-skills-manager/pull/90 for the installation of skills part.

How to test

  1. Apply https://github.com/MycroftAI/mycroft-skills-manager/pull/90 to msm
  2. Install some skills
  3. Start Mycroft and check if skills in the required directories are being loaded properly

Contributor license agreement signed?

CLA [x]

PureTryOut avatar Jan 15 '21 15:01 PureTryOut

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 15 '21 15:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 15 '21 16:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 16 '21 12:01 devops-mycroft

Hello @PureTryOut! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2022-06-02 05:58:07 UTC

pep8speaks avatar Jan 16 '21 15:01 pep8speaks

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 16 '21 15:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 16 '21 16:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 16 '21 16:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 16 '21 18:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 16 '21 19:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 16 '21 21:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 17 '21 11:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 17 '21 13:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 17 '21 14:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 17 '21 15:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 18 '21 11:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 18 '21 13:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 19 '21 12:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 19 '21 17:01 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Jan 20 '21 09:01 devops-mycroft

Was just glancing at this as we were looking at the PR for MSM and I wondered if we also need to update scripts/prepare-msm.sh which seems to also have the /opt/mycroft/skills path hardcoded

krisgesling avatar Feb 04 '21 02:02 krisgesling

I wondered if we also need to update scripts/prepare-msm.sh which seems to also have the /opt/mycroft/skills path hardcoded

Good call, yes it needs to be. Fixed.

EDIT: Actually never mind, this script isn't needed at all anymore. The new skill directories don't require root rights and will be made by the pyxdg dep if they don't exist yet, so no need preparing anything. I'll just remove the script.

PureTryOut avatar Feb 11 '21 13:02 PureTryOut

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Feb 11 '21 13:02 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Feb 11 '21 13:02 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Feb 11 '21 13:02 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Feb 11 '21 13:02 devops-mycroft

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Feb 12 '21 20:02 devops-mycroft

I made it depend on msm 0.9.0 now.

PureTryOut avatar Feb 18 '21 09:02 PureTryOut

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar Feb 18 '21 09:02 devops-mycroft

I have tested this as part of #2799 and works perfectly and as expected.

  • Skills are downloaded to /home//.local/share/mycroft/skills/
  • Skills repo is initiated within /home//.local/share/mycroft/skills-repo (no more hidden directory)

The only little quirck I had was that at a very virgin system where the user does not yet have a "site-packages" within his/her ~/.local/share/lib/ folder, starting mycroft; At the start of Python as the users site-packages are not there yet, it will not be loaded. packages will be installed to it with pip, however mycroft will not see them before a restart as that folder was not initialized at its start. (If this makes any sense) Anyhow, I believe this is more a MSM thing then mycroft-core.

Anyhow: In short. Works as expected!

j1nx avatar Apr 06 '21 11:04 j1nx

Voight Kampff Integration Test Failed (Results). Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

devops-mycroft avatar May 26 '21 07:05 devops-mycroft