Skip to content

Commit

Permalink
Neon Core 24.2.29 (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel authored Mar 1, 2024
2 parents 0d8dd0b + 1ab06d5 commit 4d6ea89
Show file tree
Hide file tree
Showing 25 changed files with 201 additions and 293 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ jobs:
image_name: ${{ github.repository_owner }}/neon_skills
base_tag: base
extra_tag: default_skills
platforms: linux/amd64,linux/arm64
1 change: 1 addition & 0 deletions .github/workflows/publish_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ jobs:
image_name: ${{ github.repository_owner }}/neon_skills
base_tag: base
extra_tag: default_skills
platforms: linux/amd64,linux/arm64
36 changes: 18 additions & 18 deletions .github/workflows/setup_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
core_and_skills:
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
python-version: [ 3.8, 3.9, '3.10', '3.11' ]
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand All @@ -29,23 +29,23 @@ jobs:
- name: Test Skills Installation
run: |
pip install .[skills_required,skills_essential,skills_default,skills_extended]
pi_image_3_7:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v2
- name: Test chroot installation
uses: pguyot/arm-runner-action@v2
with:
optimize_image: false
base_image: https://2222.us/app/files/neon_images/pi/debian-base-image-rpi4_2023-02-13_09_05.img.xz
cpu: cortex-a53
copy_repository_path: /core
commands: |
bash /core/test/pi_setup_3_7.sh || exit 2
. /core/venv/bin/activate || exit 2
neon-audio init-plugin -p coqui || exit 2
neon-speech init-plugin -p neon-stt-plugin-nemo || exit 2
# pi_image_3_7:
# runs-on: ubuntu-latest
# timeout-minutes: 90
# steps:
# - uses: actions/checkout@v2
# - name: Test chroot installation
# uses: pguyot/arm-runner-action@v2
# with:
# optimize_image: false
# base_image: https://2222.us/app/files/neon_images/pi/debian-base-image-rpi4_2023-02-13_09_05.img.xz
# cpu: cortex-a53
# copy_repository_path: /core
# commands: |
# bash /core/test/pi_setup_3_7.sh || exit 2
# . /core/venv/bin/activate || exit 2
# neon-audio init-plugin -p coqui || exit 2
# neon-speech init-plugin -p neon-stt-plugin-nemo || exit 2
pi_image_3_10:
runs-on: ubuntu-latest
timeout-minutes: 90
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
python_version: "3.8"
docker_build_tests:
uses: neongeckocom/.github/.github/workflows/docker_build_tests.yml@master
with:
platforms: linux/amd64,linux/arm64
util_tests:
strategy:
matrix:
Expand Down Expand Up @@ -102,12 +104,3 @@ jobs:
with:
name: skills-module-test-results
path: tests/skills-module-test-results.xml

- name: Test Resource Resolution
run: |
pytest test/test_res.py --doctest-modules --junitxml=tests/resource-resolution-test-results.xml
- name: Upload Resource Resolution test results
uses: actions/upload-artifact@v2
with:
name: resource-resolution-test-results
path: tests/resource-resolution-test-results.xml
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim as base
FROM python:3.10-slim as base

LABEL vendor=neon.ai \
ai.neon.name="neon-skills"
Expand Down Expand Up @@ -48,7 +48,8 @@ RUN pip install wheel && \
pip install .[docker]

COPY docker_overlay/ /
RUN chmod ugo+x /root/run.sh
RUN chmod ugo+x /root/run.sh && \
neon update-default-resources

CMD ["/root/run.sh"]

Expand Down
4 changes: 4 additions & 0 deletions docker_overlay/etc/neon/neon.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
language:
supported_langs:
- en
- uk
skills:
wait_for_internet: false
extra_directories:
Expand Down
20 changes: 6 additions & 14 deletions neon_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,10 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# import sys

from neon_core.config import setup_resolve_resource_file, get_core_version
from os.path import dirname


# TODO: Deprecate below
NEON_ROOT_PATH = dirname(__file__)
# sys.path.append(NEON_ROOT_PATH)

CORE_VERSION_STR = "" # get_core_version()
setup_resolve_resource_file()

__all__ = ['NEON_ROOT_PATH',
'CORE_VERSION_STR']
# TODO: Patching for ovos-core 0.0.7
import ovos_utils.messagebus
from ovos_utils.events import get_handler_name, create_wrapper, EventContainer
ovos_utils.messagebus.get_handler_name = get_handler_name
ovos_utils.messagebus.create_wrapper = create_wrapper
ovos_utils.messagebus.EventContainer = EventContainer
9 changes: 9 additions & 0 deletions neon_core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ def install_default_skills():
click.echo("Default Skills Installed")


@neon_core_cli.command(help="Ensure default resource files are available")
def update_default_resources():
from neon_core.util.skill_utils import update_default_resources
click.echo("Updating Default Resources")
update_default_resources()

# @neon_core_cli.command(help=
# "Install skill requirements for a specified directory")
# @click.argument("skill_dir")
Expand All @@ -102,6 +108,9 @@ def run_skills(install_skills):
from neon_utils.configuration_utils import init_config_dir
init_config_dir()

from neon_core.util.skill_utils import update_default_resources
update_default_resources()

# from neon_core.util.skill_utils import install_local_skills
from neon_core.skills.__main__ import main
if install_skills:
Expand Down
76 changes: 0 additions & 76 deletions neon_core/config.py

This file was deleted.

2 changes: 2 additions & 0 deletions neon_core/configuration/mark_2/neon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ skills:
- skill-audio_record.neongeckocom
default_skills: []
PHAL:
ovos-PHAL-plugin-mk1:
enabled: false
ovos-PHAL-plugin-balena-wifi:
enabled: false
debug: false
Expand Down
2 changes: 2 additions & 0 deletions neon_core/configuration/neon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ ignore_logs:
- enclosure.mouth.viseme
- enclosure.mouth.display

data_dir: ~/.cache/neon/res

# Backwards-compat semi-deprecated
precise:
use_precise: true
Expand Down
1 change: 1 addition & 0 deletions neon_core/res/text/uk-ua/skill.error.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Виникла помилка під час обробки запиту в {{skill}}.
3 changes: 1 addition & 2 deletions neon_core/skills/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@
from neon_utils.signal_utils import init_signal_handlers, init_signal_bus
from neon_utils.messagebus_utils import get_messagebus
from ovos_bus_client.util.scheduler import EventScheduler
from ovos_utils.skills.api import SkillApi
from ovos_workshop.skills.api import SkillApi
from ovos_workshop.skills.fallback import FallbackSkill

from neon_core.skills.intent_service import NeonIntentService
from neon_core.skills.skill_manager import NeonSkillManager
from neon_core.util.diagnostic_utils import report_metric


def on_started():
Expand Down
31 changes: 27 additions & 4 deletions neon_core/util/skill_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@
import re

from copy import copy
from os import listdir, makedirs
from os import listdir, makedirs, symlink
from tempfile import mkdtemp
from shutil import rmtree
from os.path import expanduser, join, isdir, dirname
from os.path import expanduser, join, isdir, dirname, islink
from typing import List

from ovos_utils.xdg_utils import xdg_data_home
from ovos_skill_installer import download_extract_zip
from ovos_utils.log import LOG, log_deprecation

from ovos_config.config import Configuration
Expand All @@ -51,11 +50,12 @@ def get_neon_skills_data(skill_meta_repository: str =
"""
Get skill data from configured neon_skills repository.
:param skill_meta_repository: URL of skills repository containing metadata
:param branch: branch of repository to checkout
:param branch: branch of repository to check out
:param repo_metadata_path: Path to repo directory containing json metadata files
"""
log_deprecation("This skill repository format is deprecated; specify skills as packages")
from ovos_skills_manager.github import normalize_github_url, download_url_from_github_url
from ovos_skill_installer import download_extract_zip
skills_data = dict()
temp_download_dir = mkdtemp()
zip_url = download_url_from_github_url(skill_meta_repository, branch)
Expand Down Expand Up @@ -229,3 +229,26 @@ def _get_skills_from_remote_list(url: str) -> List[str]:
LOG.error(f"Unable to fetch skills list from: {url} ({resp.status_code})")
return []
return [s for s in resp.text.split("\n") if s.strip() and not s.startswith('#')]


def update_default_resources():
"""
Ensure the `res` directory contents are available at the configured data_dir
"""
res_dir = Configuration().get('data_dir')
if not res_dir:
LOG.info("`data_dir` is None; not linking default resources.")
return
res_dir = expanduser(res_dir)
if isdir(res_dir):
LOG.info(f"Directory exists; not linking default resources. {res_dir}")
return
if islink(res_dir):
LOG.debug(f"Link exists; not doing anything.")
return
if not isdir(dirname(res_dir)):
# Ensure directory exists to link default resources in
makedirs(dirname(res_dir))

symlink(join(dirname(dirname(__file__)), "res"), res_dir)
LOG.debug("Updated Neon default resources")
2 changes: 1 addition & 1 deletion neon_core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__version__ = "23.12.28"
__version__ = "24.2.29"
8 changes: 4 additions & 4 deletions requirements/core_modules.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# neon core modules
neon_messagebus~=2.0
neon_enclosure~=1.6,>=1.6.1
neon_speech~=4.3
neon_messagebus~=2.0,>=2.0.1
neon_enclosure==1.6.2 # TODO: This is a yanked release because it depends on an alpha ovos-backend-client
neon_speech~=4.3 #,>=4.3.1a2
neon_gui~=1.2,>=1.2.2
neon_audio~=1.5
neon_audio~=1.5,>=1.5.1
2 changes: 1 addition & 1 deletion requirements/local_speech_processing.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
neon-stt-plugin-deepspeech-stream-local~=2.0
neon-stt-plugin-nemo~=0.0
neon-tts-plugin-coqui~=0.7,>=0.7.3a4
neon-tts-plugin-coqui~=0.8
onnxruntime!=1.16.0 # TODO: Patching https://github.com/microsoft/onnxruntime/issues/17631
# TODO: Local language plugin

Expand Down
Loading

0 comments on commit 4d6ea89

Please sign in to comment.