Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/runtime skill installer #347

Merged
merged 18 commits into from
Sep 19, 2023
Merged

feat/runtime skill installer #347

merged 18 commits into from
Sep 19, 2023

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Sep 16, 2023

allow installing skills via messagebus

does not use OSM, tested with https://github.com/OpenVoiceOS/ovos-audio-transformer-plugin-ggwave

"skills": {
    "installer": {
         "allow_pip": true,
         "break_system_packages": false
    }
}

allow installing skills via messagebus, keeps OSM appstore skill listings in sync
@JarbasAl JarbasAl added the enhancement New feature or request label Sep 16, 2023
@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Patch coverage has no change and project coverage change: -6.20% ⚠️

Comparison is base (6ceb058) 50.35% compared to head (ac09f4b) 44.16%.
Report is 406 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #347      +/-   ##
==========================================
- Coverage   50.35%   44.16%   -6.20%     
==========================================
  Files         119       13     -106     
  Lines       10077     1764    -8313     
==========================================
- Hits         5074      779    -4295     
+ Misses       5003      985    -4018     

see 95 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JarbasAl JarbasAl changed the title feat/osm feat/runtime skill installer Sep 17, 2023
Copy link

@mikejgray mikejgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments to start with. I'll try to test this later tonight.

ovos_core/skill_installer.py Outdated Show resolved Hide resolved
ovos_core/skill_installer.py Outdated Show resolved Hide resolved
ovos_core/skill_installer.py Show resolved Hide resolved
ovos_core/skill_installer.py Show resolved Hide resolved
ovos_core/skill_installer.py Outdated Show resolved Hide resolved
ovos_core/skill_installer.py Show resolved Hide resolved
ovos_core/skill_installer.py Show resolved Hide resolved
ovos_core/skill_installer.py Show resolved Hide resolved
ovos_core/skill_installer.py Outdated Show resolved Hide resolved
Copy link

@mikejgray mikejgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with the below JSON using mana send-message-file. Everything seemed to work just fine except for pip uninstall. Please validate? Also I found an incorrect message type.

{
	"msg_type": "ovos.pip.install",
	"data": {"packages": ["spongebobify"]},
	"context": {}
}
{
	"msg_type": "ovos.skills.install",
	"data": {"url": "https://github.com/OpenVoiceOS/skill-ovos-parrot"},
	"context": {}
}
{
	"msg_type": "ovos.pip.uninstall",
	"data": {"packages": ["spongebobify"]},
	"context": {}
}
{
	"msg_type": "ovos.skills.uninstall",
	"data": {"url": "https://github.com/OpenVoiceOS/skill-ovos-parrot"},
	"context": {}
}

ovos_core/skill_installer.py Outdated Show resolved Hide resolved
Copy link

@mikejgray mikejgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still doesn't seem to uninstall:

ovos@mark1-dev:~ $ cat uninstall_pip.json
{
	"msg_type": "ovos.pip.uninstall",
	"data": {"packages": ["spongebobify"]},
	"context": {}
}
ovos@mark1-dev:~ $ mana send-message-file ~/uninstall_pip.json
Message Sent
ovos@mark1-dev:~ $ tail -f ~/.local/state/mycroft/bus.log  | grep uninstall
2023-09-19 10:58:44.689 - bus - ovos_messagebus.event_handler:on_message:37 - DEBUG - {"type": "ovos.pip.uninstall", "data": {"packages": ["spongebobify"]}, "context": {"client_name": "mana", "client": "mana", "source": ["mana"]}}
^C
ovos@mark1-dev:~ $ pip list | grep spongebobify
spongebobify                         0.1.2
ovos@mark1-dev:~ $ tail -f ~/.local/state/mycroft/bus.log  | grep uninstall
^C
ovos@mark1-dev:~ $ pip list | grep spongebobify
spongebobify                         0.1.2

ovos_core/skill_installer.py Show resolved Hide resolved
@ChanceNCounter
Copy link

Codecov is extremely unhappy! Wow that’s a lot of lines.

I just wanna confirm that it is working correctly on this repo, and this PR really does represent a 6.22% coverage decrease. That ain’t great.

@JarbasAl
Copy link
Member Author

I just wanna confirm that it is working correctly on this repo,

no it's not Report is 406 commits behind head on dev.

@JarbasAl
Copy link
Member Author

all seems to be working for me

2023-09-19 18:59:11.729 - skills - ovos_core.skill_installer:pip_install:76 - INFO - (pip) Installing pyjokes
2023-09-19 18:59:11.729 - skills - ovos_core.skill_installer:pip_install:78 - DEBUG - /usr/bin/python3.11 -m pip install --break-system-packages pyjokes
Defaulting to user installation because normal site-packages is not writeable
Collecting pyjokes
  Using cached pyjokes-0.6.0-py2.py3-none-any.whl (26 kB)
Installing collected packages: pyjokes
Successfully installed pyjokes-0.6.0
2023-09-19 18:59:23.739 - skills - ovos_core.skill_installer:pip_uninstall:135 - INFO - (pip) Uninstalling pyjokes
2023-09-19 18:59:23.740 - skills - ovos_core.skill_installer:pip_uninstall:137 - DEBUG - /usr/bin/python3.11 -m pip uninstall -y --break-system-packages pyjokes
Found existing installation: pyjokes 0.6.0
Uninstalling pyjokes-0.6.0:
  Successfully uninstalled pyjokes-0.6.0
2023-09-19 18:59:31.444 - skills - ovos_core.skill_installer:pip_uninstall:135 - INFO - (pip) Uninstalling pyjokes
2023-09-19 18:59:31.444 - skills - ovos_core.skill_installer:pip_uninstall:137 - DEBUG - /usr/bin/python3.11 -m pip uninstall -y --break-system-packages pyjokes
WARNING: Skipping pyjokes as it is not installed.
2023-09-19 18:59:49.956 - skills - ovos_core.skill_installer:pip_install:76 - INFO - (pip) Installing pyjokes
2023-09-19 18:59:49.956 - skills - ovos_core.skill_installer:pip_install:78 - DEBUG - /usr/bin/python3.11 -m pip install --break-system-packages pyjokes
Defaulting to user installation because normal site-packages is not writeable
Collecting pyjokes
  Using cached pyjokes-0.6.0-py2.py3-none-any.whl (26 kB)
Installing collected packages: pyjokes
Successfully installed pyjokes-0.6.0
2023-09-19 18:59:56.034 - skills - ovos_core.skill_installer:pip_install:76 - INFO - (pip) Installing pyjokes
2023-09-19 18:59:56.034 - skills - ovos_core.skill_installer:pip_install:78 - DEBUG - /usr/bin/python3.11 -m pip install --break-system-packages pyjokes
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyjokes in /home/miro/.local/lib/python3.11/site-packages (0.6.0)
2023-09-19 19:09:03.251 - skills - ovos_core.skill_installer:pip_uninstall:120 - ERROR - tried to uninstall a protected package: ['ovos-core', 'ovos-utils', 'ovos-plugin-manager', 'ovos-config', 'ovos-bus-client', 'ovos-workshop']

@mikejgray
Copy link

mikejgray commented Sep 19, 2023

I've confirmed at least the happy path for each new bus message works. Only thing missing are some tests. Also, is it deliberate that core doesn't test Python > 3.9?

@JarbasAl JarbasAl merged commit ff4dd8f into dev Sep 19, 2023
5 of 6 checks passed
@JarbasAl JarbasAl deleted the feat/osm branch September 19, 2023 18:54
@JarbasAl JarbasAl added this to the 0.0.8 milestone Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants