fossasia / susi_linux

Hardware for SUSI AI https://susi.ai
Apache License 2.0
1.6k stars 148 forks source link

New code layout for SUSI application #481

Open hongquan opened 5 years ago

hongquan commented 5 years ago

Sorry I don't have enough time to think carefully to give a proper proposal, so I just give brief of my thinking here and we will discuss about new project layout for SUSI.

Why we need it?

My suggestion:

norbusan commented 5 years ago

Thanks for the ideas, I agree with the general proposal, but want to point out a few things

To fall in line with what you proposed, we should

norbusan commented 5 years ago

Actually git grepping through susi_linux git it is not so bad ... most sudos can be categorized into the following categories:

So I think that getting rid of the sudo calls will not be that bad once we have installation done.

That is BTW the biggest problem with packaging susi_linux, the horde of pip3 install dependencies. There it would be better to have again one Debian package for each of it ...

hongquan commented 5 years ago

@norbusan Could you explain why

we cannot run it as other user, because this might block access to sound devices on desktop.

About using _ prefix to avoid collision, I feel it looks weird and ugly. Many softwares like PostgreSQL, MySQL, Redis come with dedicated username without that underscore. But yes, because we want to support normal desktop user, we should think about this. How about susiai?

norbusan commented 5 years ago

@norbusan Could you explain why

we cannot run it as other user, because this might block access to sound devices on desktop.

On current desktop, the pulseaudio deamon is often started in the user session, that is, when a user logs in, Other users, in our case the susi user will most probably not have access to the microphone or loudspeaker (access denied).

About using _ prefix to avoid collision, I feel it looks weird and ugly. Many softwares like PostgreSQL, MySQL, Redis come with dedicated username without that underscore. But yes, because we want to support normal desktop user, we should think about this. How about susiai?

That is true. The underscore is not a required option. It is one option to make sure that we don't create a username that might be taken at the moment or in the future. susiai might be also fine. I just wanted to be sure.

Concerning ugly: This is the least I care for, because the actual desktop user never sees that, and we only use it in the postinstall/postrm scripts etc. So there is no need whatsoever to remember or make it beautiful.

Hope that explains my intentions