Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Ensure services are fully ready before reporting readiness #2639

@krisgesling

Description

@krisgesling

This is partially a rubber duck issue to document my own thoughts, but also interested in broader input on the best way to resolve.

Currently on boot the SkillsManager loads all Skills and emits a mycroft.skills.initialized message
On detecting this message PadatiousService starts training and if it's the initial train emits mycroft.ready once it's complete.

mycroft.ready is intended to signify that the device is ready to use, however there are some circumstances in which that is not entirely the case.

1. Initial training was for priority_skills only

In this instance only the Volume and Pairing Skill are loaded when Padatious runs it's training. Once the initial training is completed, it declares Mycroft ready and the "Mycroft is now ready for use" dialog is spoken by the device.
At this point, asking Mycroft anything not handled by those Skills responds with "Please wait a moment as I finish booting up" because the Unknown Fallback doesn't yet exist.

Expectation:
All default Skills for that platform should be loaded and trained prior to the mycroft.ready message being emitted.

2. Significant Skill updates required

If a device is reasonably outdated or there has been significant updates to a number of Mycroft Skills, it can take time for new dependencies to install and updates to be applied.

In this case, the old versions of the Skills are loaded and trained. Mycroft then reports itself ready. Following this, all the Skills start updating. Utterances received during this time may hit the old Skill, or the new Skill prior to intents being trained.

Question:
Do we want to run an update of all Skills immediately after boot, before declaring Mycroft is ready?
This slows the boot time, but improves the stability and predictability of responses.

3. Precise not downloaded

The Precise executable is a fairly big download and can take some time. This is now shipped as part of the Picroft image but is not part of Mycroft-core and we can't assume it is there.

Question:
Should we be waiting for all assets and services to be ready before declaring Mycroft as a whole ready?
Eg each service [bus, skills, audio, voice, enclosure] must itself report being ready, before the global mycroft.ready message is sent.
Should we be checking that all services report being ready, before declaring that Mycroft as a whole is ready? Eg through the service hooks proposed in #2601

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Work in progressPR being actively worked on, not yet ready for review.Type: Enhancement - roadmappedImplementation of a feature that is a priority on the roadmap.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions