-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
Voight Kampff Integration Test Failed (Results) |
6cc33ed
to
ebc01fc
Compare
ebc01fc
to
3e6863a
Compare
Voight Kampff Integration Test Failed (Results) |
Perfect! I have created systemd files that make use of this wrapper. You can use and test it wih those files; |
Will watchdog support be added? |
The skills service and the voice client has watchdogs since those have cyclic sections easily checked for activity, the other services could also get watchdog support in the future but some mechanism would need to be created to make those reliable. I haven't been able to figure out why the integration tests are failing on Jenkins. Trying to reproduce the issue but haven't succeeded yet. After that the PR might be considered for inclusion. |
3e6863a
to
944a236
Compare
Voight Kampff Integration Test Failed (Results) |
944a236
to
10e7168
Compare
Voight Kampff Integration Test Failed (Results) |
Voight Kampff Integration Test Failed (Results) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, just one critical typo and a possible addition. Otherwise looks great -should be really useful!
That typo explains the vk issues facepalm. I had some reason for leaving out the stopping, but I can't remember it so I'll add one for completeness. Will do this as soon as I get the opportunity. |
- skills - audio - speech client - messagebus service - enclosure The main functions now accepts the arguments ready_hook and error_hook allowing a service or runner script to catch these states and perform actions accordingly. This is useful for things like systemd or a desktop launcher. Fix audio service startup
If no watchdog is provided a dummy function will be called
10e7168
to
236a2ed
Compare
PR updated and rebased according to comments, hope VK is happy now! (Sent from a camping chair at N59° 31,487' E015° 02,690') |
Voight Kampff Integration Test Succeeded (Results) |
Nice progress! Still hope Watchdog finds it way into the other services as well. Especially the messagebus as everything relies on that service to be available. |
I will work on adding that in a followup PR, gonna dig into tornado and the ws library and see if it can be achieved in some way...if not perhaps a cyclic message from the messahebus service triggering the wd in the respective clients is a way to add some additional reliability |
I remember you where not very keen on adding a cyclic function into mycroft-core, so if the messagebus doesn't have something similar as the voice and skill service, perhaps the other way around? Send a message to the messagebus from the wrapper and if a proper reply is received, petting the dog... |
I think we'll need to look further into the Audio Service. It's reporting ready before loading any of the services:
My interpretation of ready would be that at least the default service is loaded and can output sound. The others seem fine. |
I meant to say, don't think my previous comment needs to be addressed in this PR. |
I can fix that quickly, the audio service loading is done in the background I'll add a status allowing the main function to check if loading has completed. |
Gez also meant that the messgaebus watchdog don't need to be addressed in this PR😜😂 |
The new wait_for_loaded() method will wait until services has been loaded. It has a 3 minute timeout (default) This improves the audio service readiness indication to not trigger until the services are loaded.
Updated PR with a commit adding functionality to the audioservice for checking load status and only calling the ready_hook after waiting for services to be loaded. |
Voight Kampff Integration Test Succeeded (Results) |
Yeah, this is great! Thanks again - merging! |
Description
This adds a simple system of callback hooks to run mycroft as a service or through a single executable. It allows the definition of a wrapper script with handlers for ready states, error states and a watchdog to ensure the system is still running.
Example wrapper script for use with systemd:
The current watchdog implementations are currently only for the speech client (voice data is received from the mic) and the skills process (skills are updated) due to their natural cyclic structure.
The reason for doing this is to be able to keep startup system requirements outside of core and allowing flexibility. For example these startup hooks can be done for a desktop launcher just as well as for a system service like systemd or finit.
How to test
Create a similar wrapper but instead of sdnotify a simple custom print statement is used in the hooks.
Contributor license agreement signed?
CLA [ Yes ]