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

Add QML file server for Container implementations #38

Closed
wants to merge 3 commits into from

Conversation

NeonDaniel
Copy link
Member

No description provided.

@NeonDaniel NeonDaniel added the enhancement New feature or request label Jan 21, 2022
@NeonDaniel NeonDaniel requested a review from JarbasAl January 25, 2022 22:39
@JarbasAl
Copy link
Member

Im still not convinced this belongs in skills.... if the gui service is not running then this should not be running, makes more logical sense for the server to go into the gui service imho

we have a gui section in mycroft.conf, having to edit the skill section for gui options is very confusing for end users, i think this further validates that the server belong in the gui module

I assume the only reason you put this in skills service was because of docker containers?

@NeonDaniel
Copy link
Member Author

I assume the only reason you put this in skills service was because of docker containers?

Correct; skills is the only module that is guaranteed to have all the available resource files. I think the server should run out of this module, which makes the server a "skills" component, not a "gui" component the same way SkillGUI isn't a GUI component. Config I don't feel too strongly about, it can go in the gui section as it only serves that module

@JarbasAl
Copy link
Member

JarbasAl commented Jan 25, 2022

i anticipate some issues later in OCP but out of scope of this PR, this class is duplicated in ovos_utils (the aim was to allow standalone apps before ovos-core and ovos_workshop existed) so it will need to be updated or deprecated in there in a follow up PR

standalone ovos apps from ovos workshop are the main use case where we want a gui outside skill class, so maybe lets move discussion there

update the mycroft.conf please and this PR can be merged

@NeonDaniel
Copy link
Member Author

Ah, forgot to say remote-server is already specified: MycroftAI#2106 .
I relocated run_gui_file_server though

@JarbasAl
Copy link
Member

remote-server makes some sense, because it can be shared with other stuff non gui specific

@AIIX can you do the final approval since gui is your department? i think this looks good

@JarbasAl JarbasAl marked this pull request as ready for review January 26, 2022 00:21
if page:
if self.remote_url:
page_urls.append(self.remote_url + "/" + page)
elif page.startswith("file://"):
elif "://" in page:
Copy link

Choose a reason for hiding this comment

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

will this not conflict with remote, if self.remote_url = "https://127.0.0.1/" , elif will also catch "://" ? maybe this should depend on if the inbult http server is enabled in addition to "://"

Copy link
Member Author

Choose a reason for hiding this comment

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

If self.remote_url is defined, this clause will never be parsed. I added this because I think :// will always relate to an absolute path, so some absolute path like smb:// or http:// could be defined without self.remote_url (i.e. I want to reference an exact QML file I host without leaving it up to a file resolver method)

Choose a reason for hiding this comment

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

Could it still run the startswith or would that be some slow regex stuff?

super().end_headers()


def start_qml_http_server(skills_dir: str, port: int = 8000):
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if using port 8000 is a wise thing todo as it is being used as alternative http port and many other programs already use it as well. This might run into conflicts a lot.

Perhaps choose another port as default, just like the 18181 for the websocket?

Copy link
Member

Choose a reason for hiding this comment

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

good call, many demo apps use 8000 ...

Copy link
Member

Choose a reason for hiding this comment

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

Or make it a config variable just like the gui websocket port and if not set, make it gui websocket +1

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah, thanks for catching this. I meant to put this in a config option too

@NeonDaniel NeonDaniel marked this pull request as draft February 4, 2022 22:45
@NeonDaniel
Copy link
Member Author

Per discussion on Matrix, this needs changes to account for multiple skills directories.

Proposed solution: within the now defined qml dir in /tmp, create a subdirectory for each skill directory and update the resolvers

@JarbasAl
Copy link
Member

@NeonDaniel the latest resource refactor might be of help here

@NeonDaniel
Copy link
Member Author

@NeonDaniel
Copy link
Member Author

Re-implemented in NeonCore to handle plugin skills NeonGeckoCom/NeonCore#259

@JarbasAl
Copy link
Member

JarbasAl commented May 1, 2023

replaced by OpenVoiceOS/ovos-gui#9

@JarbasAl JarbasAl closed this May 1, 2023
@JarbasAl JarbasAl deleted the FEAT_QMLFileServer branch August 8, 2023 14:06
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.

5 participants