-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Discussion: Simplify the core. #1860
Comments
Very much agree with your reasoning and your overview of parts that dont have to be part of the core MM package (although I never looked into the "non-html/js/css" stuff since I am more of a frontendler and just happy abotu scripts that do all the setup stuff :-) As for the guidelines on what future versions should adhere too, I think it is missing on what browsers beside the electron engine should be supported. |
for serveronly you can use any browser that might work.. most do.. as electron is built on chromium,. the chromium_browser for the platform is used. the difficulty with the objective
is that is not all that is needed.. while the core may have been updated, there are many many modules that now have their own intertwined dependencies on the electron version , grpc version and more.. change the core, and they are dead... the users don't know, they just installed.. the good news is MM has reached a wide non-developer audience.. its also the bad news and additional thought.. the install on pi0 and 1 has become very complicated as the older OS versions (jessie and stretch) are not getting updates.. npm install leaves a mess. the vast majority of the users are on pi devices.. but many more are coming. |
Removing the installer from the core does moet mean there won’t be an installer. It can be a separate repo/application that does exactly the same. By splitting the two, we can have more focus. Advanced users won’t need an installer. Beginners can download the installer if they want. This way the core becomes much more maintainable and we won’t run into issues like #1858. I personally think it’s better to focus on a better reporting system which handles updated packages. This way the users will learn why the magic mirror won’t start so they can choose to update or remove specific modules. Regarding the browser support: we should focus on electron (chromium) this way it will also work in chrome. Old browsers can’t be supported due to new JS features. |
Would be good to write that explicitly down: MM is developed for electron, but if you want to use mm in serveronly mode, here is what your browser should at least support. |
I would focus on docker images as primary installation method. Mainly on The official docker image provided by @bastilimbach - only There were discussions concerning the docker setup in 2017, But you can run also run magicmirror as docker image on a raspi with electron ( You only need to install I'm running such a setup now for more than 2.5 years with no problems. With such an approach you could determine to support only the docker installation |
@khassel I understand what you are saying, en indeed the pull count is impressive. But docker isn’t something beginners start with. For me personally I value the simplicity of a simple js project more than the sheer amount of users that simply install and run the script. If that was the case, I would just distribute a ready to use raspberry pi image. If you take a look at the list of contributors, a lot of them made their fist ever GitHub contribution in the MagicMirror² project. This is what sets the project apart. This is what drives me. If we slink MagicMirror² down to a simple js project that can either be start as a simple electron app or as a server only process, wouldn’t it be easy for someone else to make and distribute a nice docker wrapper? In that case we can focus on the quality of the core, while others focus on the ease of use via a docker image. This would also allow multiple approaches: docker, installer apps, ready to use images, etc. |
@MichMich, I like the idea simplifying the core and focus on one programming language. What I often ran into during my use of the MM over the last 1.5 year or so is that modules are a one shot create and for get by someone who created it, but doesn't maintain it in the future. Modules then fail due to a dependency on the MM version or on some external API that has been updated. So what would be great as part of the core MM would be a system that blocks old and unsupported modules without breaking MM. Also keeping everything on github would be preferred. I mention this because the 2.10.0 updated gave me some extra work with the update script. As the 2.10.0 was released and you wrote "git pull && npm install", but in that same topic @sdetweil wrote to use his update script, and then pointing to his Dropbox. To me, being more admin then developer, that raised a few red flags as I just don't blindly run something from someones Dropbox. No offense @sdetweil, that is just me being cautious. @sdetweil -Server / -client only is not something where an beginner starts with. They buy a Raspberry starter kit and give it a go with a normal monitor connected. If this then works out of the box, the the spark might ignite and they might build an actual mirror. If the core becomes to complex and failing at the first steps of setting up the PI, we would loose the beginner as there are so many other possible PI projects that one can try. @khassel, making the core in docker makes it unnecessary complex. A beginner buy's a starter kit and gives it a go that specific PI. No other apps are running there. So putting MM in docker would be a overkill as the PI itself is the container. Doing MM in docker is again an expert thing. |
I agree. I think this is comparable to other software. For example: iOS13 won't run on a iPhone 4. If we keep trying to make it work on all devices possible, we are holding back the development of the framework. If someone really wants to use an older raspberry, they can just use an older release of the framework.
That was exactly my thought: if you start the mirror, and one of the modules gives an error. you get a (1 minute) alert stating: "Module X seems to have problems and is disabled by mm2. Please check logs/date_module_x.log for more info." - This shouldn't be too complicated to incorporate and solves a lot of issues. Regarding the -serveronly/-client versions: if a user knows he wants to use the server-only version. He is probable able to find out he should run In the end I think al current possibilities (installers, docker, etc) can remain. The only difference is they can be split up in multiple repositories, managed by different users. This enables different release schedules and makes it much more manageable for me to maintain in the long run. The documentation will reflect the possibilities:
|
Hi all!, There main problem here is because the all script and maintenance of installer system to be a tricky, many variety of devices is a lot of cost keep compatibles with all their. Actually at now, the scripts bash installer is a lot spaghetti code (without offenses) and trouble to tests. At the beginning of MM was use a X Raspberry model to build a (DIY) Awesome Mirror but at now there a many version of Raspberry and many environments where should can run the software. Imagine this in a next years. Keep old and next future version will going keep our effort to give maintenance the "installer code" system instead to the core. So, at to all this, I think we need keep the installer like is at this moment for a new release and make an announcement for the next release as 3.0.0 where the all code related a configuration and installer will be remove. |
I agree that it needs maint. But installer is a big word. For example, if u separate, then we need control of package.json and the runtime env, and the Travis stuff too. As an example, we currently need to upgrade electron for new pi, and buster. But cannot. We shouldn't have to lag 6 months This gets harder and harder to separate. I didn't create the installer. But the original no longer worked. As this latest also won't at some time without maintenance. |
The installer as it currently is, could be a in a separate repo. As a matter of fact, you shared new versions of the upgrade script and installer (if I'm not mistaken) on the forum straight from your dropbox. So the installer doesn't need to be in the same repo. Correct me if I'm wrong, but I get the feeling you are against this idea. What are the cons in your opinion? Maybe we can solve those cons in another way.
This is a whole separate issue and has no effect on the installer. I agree we need to fix this Travis issue. As a matter of fact, this is a great example of why I think we need to simplify the core: let us focus on electron and the framework, while others put resources in de development of installers etc.
This proves my point. The longer we wait. The harder it becomes. Thats why I started 2020 with this discussion.
An other reason why I want to remove it from the core. It isn't maintained properly. I don't have the resources to maintain it. If we separate it from the core, someone else can take that responsibility. In my opinion, I think there is nothing wrong with setting a requirements list to run MagicMirror². This should include stuff like: It's not that it won't run outside that requirements list, it's just not guaranteed. @roramirez I agree with your reasoning, but I don't think we should release it as a new major version. It's not a major paradime shift. It's not an API change. In my opinion it could just be 2.11.0, 2.12.0 or 2.13.0. Whenever we switch to a complete new setup (for instance single file components) which will break existing modules, we should switch to 3.0.0. Also note that the core could still include features to allow external repo's to work. For example, the core could still include features like defining an external config.js path, so that it can work in a docker container. Edit: formatting. |
with a separation new versions or bugfixes of the installer are possible at any time, they are not bound at a mm release anymore.
bad example 😜, docker can mount any path outside the container, so there is no need for a special path for the config.js ... |
Exactly!
Whoops! Well, you get the point. 😅 |
And that's why docker isn't for beginners, as experts don't even always get it 😄 |
@MoreLinuxDev I disagree on the take on the modules. What modules are initially is made by a user to create something they want and is shared by that user. My understanding with MM is still the same... The user should be taking an active part in the development of their own mirror. All of this is done for free and given away as such. The problem with 'supporting' modules from what I've seen in the last couple years is that it goes from 'being nice and sharing' to a full time job because user a wants the module to do this and module b wants the module to that. It's not that they aren't being maintained it's more like here is something for free, like MM, and the user should want to take an active part. I started with MM when there really was no installer script and I learned through trial and error how to solve my own problems and that 1st mirror is still running :) Until this I didn't even know javascript..... but I asked and learned and modified modules to fit my own needs.. the repo's are free.... |
in preparation, I have created a separate repo for these files. also, collecting the pr fixes there @MoreLinuxDev thanks for the note about concern for dropbox.. now moved to github.. |
@sdetweil, thanks for all the work put into the scripts. @cowboysdude Yes that is the way you do it (many thanks for that) and the way it should be done, but reality is different. A nice example is the 3th party voice control area there are several modules abandoned. Currently in the module area it's a bit wild west. The only way to figure out if a module would run is to install it and hope. Would be great if there is a way to find out if a module would be working under the new 2.10.0. The way I do it right now is to have a dev "mirror" ( a Pi hooked-up to a monitor) and a real prod mirror. When a new MM version arrives I first do the dev, and see what breaks. If al goes fine I do the prod mirror. Nowadays it mostly goes quite well, but that's because I reduced my mirror to the really essential needed modules that I know are actively maintained. The unmaintained modules I have abandoned as well. I found this out the hard way when I wanted to get my MM voice controlled. So from my point of view it would make MM more user (beginner) friendly if the was a system in place were old and non-working modules are recognized and stopped from breaking things. |
@MoreLinuxDev oh I wish it was just the MM core code that was the problem with updates.. we have a rapidly changing node/npm base, oh, and then there are the modules.. I have three modules (one public) and 2 of the three have broken cause of node, electron and dependency changes. |
Since we are starting to get a consensus on the desired directions, I've edited the opening post and added a provisional TO DO List. Open for feedback and let me know if I forgot something. Not that this TO DO list only covers the simplification procedure. It goes without saying that all other ToDo's (like upgrading Electron) remain. Thanks! |
What are your thoughts on having all repos (core, scripts, installers,) under one organizational account? Or are you fine with the core being on your account, the installer on someone elses? |
I prefer the later. I want to stay focused on the core. Others can focus on the many ways of installing/usage. Especially since there isn’t just one way to install it. One person could maintain the installer. Someone else could maintain a docker image. And who knows there someone willing to maintain an .img file. This way the possibilities of installing the mirror won’t be limited to one “preferred” method. |
Hi @MichMich, I thought I would add my 2c since you are asking for it :) Regarding the stack, I understand were you are coming from. Typescript would be nice to use IMO but the latest versions of JS are nice enough. I would argue that I am a committer for few Apache projects and most of them are structured the way you describe: each part has a git repo, and the main repo just gather all these. Now I like this approach a lot. This is nice indeed as the MagicMirror core will be able to live its own life. I would also go all the way down and separate each "official" module (each one being a git repo) as dependencies of the core. What I'm more concerned about is the follow-up of the "distribution channel". Right now, the installation is packaged with MagicMirror but if tomorrow this is separated, that can died for any reason: no time, no maintainers, etc. True, it won't be "too much" of an issue as you can still install it manually and do all the scripting yourself, but this is a real risk that can impact users.
Hope that make sense. |
@tbouron Thanks for your feedback! As much as I like TypeScript, Less/Sass myself, I really want to stay away from it. It is a big step for newcomers to learn. Especially the tooling necessary. Most contributors started by changing a small line of code and seeing direct results. For example: there are a lot (way more than you would expect), kids classes teaching kids on how to program with the MagicMirror² as an example. Letting kids change lines of code in a text editor and see the results only works if they don't need to run precompilers. Also keep in mind that the "best stack" has changed a lot in the past couple of years (since I initially released the project). If I had used those types of preprocessors back then, we would still be using them is this project today, even though a lot better alternatives are available. I also honestly think that due to the simplicity of the application, adding complexity like webpack would not add a lot of value. Don't get me wrong: I love them in all of my projects in my professional day job. But for this project KISS really is key. For that same reason I will keep the default modules inside this one repo. That way starters can clone one repo and start playing. It keep things simple for them. And better yet: it keeps things simple for me to maintain. Regarding your concern on the unmaintained installer scripts: I absolutely agree. But that problem is even bigger if the they are part of the core AND unmaintained. In my opinion we should work to make the manual installation as easy and smooth as possible (by writing good documentation). That way an installer might become obsolete one day. Thanks again for your feedback! |
@MichMich Unfortunately I just now had the time to contribute to this discussion. I very much agree with your decision to modularise MagicMirror into separate modules like Just to be clear you don't want to separate the core in such a way that it is consumed as an NPM dependency, right? Let's say you publish this project under One concern that I have is regarding the quarterly releases. As I'm the maintainer of the Btw as these are major changes to the whole project we need to increase the version to 3.0.0 as we are breaking the compatibility be getting rid of |
@bastilimbach we are not getting rid of this at all.. we are just using it more where we need it |
@guysoft >can't really test without a mirror, you don't need a 'mirror', this thing will run on anything, including windows. macos, gallium on chromebook, ubuntu, zorin, raspian of course, |
@sdetweil Its my experience that if you don't have the hardware you can't really fully grasp what people are doing with your software. |
I got board arguing with you, here: Its a distro script that has docker, a gui, and unclutter installing. It should start the GUI and then docker with the It should take an hour to build on my Jenkins and then a few to upload it. So it hopefully that should happen if there are build errors, which I will check for tomorrow. |
did already some tests with MtigOS, will take a look at MagicMirrorOS after work ... |
Cool, @khassel thanks, I flashed it but didn't boot it yet. It has the X server installed which MtigOS hasn't. Also Docker should start after the GUI. |
It boots in to a login screen, let me see if I can fix that |
Ok, fixed something with the init scripts, it seems like the mirror is running but its a blank screen, Another build is in progress. here is the log:
|
@guysoft usually means the vendor and fonts npm installs did not get done |
@sdetweil This is the point I am stopping. Again I DONT WANT TO MAINTAIN THIS. I have given you the platform and code and I am willing to bring it to the point it boots. I am using the TV of my girlfriend place to test it indeed boots, I have no spare Pis or screens to lend to this. From there you are on your own. maintaining stuff like the npm packages can be done inside the docker container. I am getting this to the point you get a gui and the repo boots. I am also happy to help with CustomPiOS related issues, but thats all I am willing to lend a hand with. I just have too much on my plate and this is volunteer work. |
@guysoft i hear you, but I don't want to maintain it either.. |
Ok, the current nightly build (only on at the moment).
If I connect to: http://magicmirroros.local:8080/ I can see this: If you update the docker image it will pull the latest one when the device boots. I think I have given you guys a good start, I am not maintaining this, I am willing to accept and manage PRs. |
@guysoft thanks, this looks very good! But I missed one volume mount which is the reason for the black screen. Will make a PR in your repo later or tomorrow. |
Ok, so we simplified it. You flash the image. It works. It updates on boot. |
@MichMich With the effort to separate concerns into multiple repositories, what would you say about hosting an "awesome-magicmirror" repo besides (and preferably (?) under the same namespace as) mm-core? This would provide users with a nice entry-point into the ecosystem and aid both discoverability and exploration. Let me know what you think. In any case I want to express my thanks for the ongoing efforts of anybody who is involved, as I've only recently discovered the whole topic and am excited to dive in :) |
Update, we made a first stable release: |
🎉 Great work! |
Cool, will check it out very soon hopefully. My pi3 crashed hard again (starts only with a kernel panic now) so I will see how settingh it up with your docker image works out. |
Is this still a design goal? If so, please don't. I totally agree with moving installers, docker images, updates and so on from the core. The core is basically a dashboard framework, and a dashboard framework can run anywhere. My prototype is running on a x86 NAS that I connect to with Safari in a fullscreen window on my Mac, and most likely will never actually run on a Pi at all. Make a Pi-specific OS or installer or whatever, but leave the core agnostic. |
@rossburton It should not be hard to make a docker container both for x86 and armf (if someone maintains it AFAIK). |
I don't care about the docker images. My concern is that at the top of this page it says that "future versions should ... focus (only) on Raspberry support". I don't believe the actual MagicMirror code should be specific to any particular hardware. |
(disclaimer: please do not take as offence of any kind!) |
@TheTyrius You can disable it, the code is Free Open Source software. I am also as you can see publishing the information I gather. Its also GDPR complainant because I scramble all personal information including the Raspberry Pi Ids. |
Hi, just a quick question about the versioning for these changes discussed here: Note: This is just a thought, please correct me if I'm wrong. But maybe this would also help people to get aware of the drastic changes that were made here. Edit: Arrghh... nevermind, I just read this comment. Go on. Nothing to see here! |
@deg0nz only thing I know that broke (unintentional) was the socket stuff.. everything works unchanged modules need to adjust to new electron version, but not specifically a version problem |
I'm closing this issue for now. If anyone feels this should remain open, feel free to let me know. Trying to cleanup the issue list. |
Since I open sourced MagicMirror², I have received many awesome pull requests adding a lot of nice features to the Magic Mirror core. I am very grateful for that! Unfortunately, this comes with a downside: the application gets a lot more complicated.
The reason I open sourced MagicMirror² was because it is a perfect starter project for newcomers. Getting their feet wet in javascript and software development in general (see manifesto). With the current complexity, this project is slowly moving away from this.
I also noted that the amount of bash code is increasing, while the main intention of version 2 was to try to do everything in 1 program language: javascript. (Opposed to v1, which was a combination of languages like PHP, Javascript en in some cases Python).
Looking at other OS projects, there are some beautiful examples on how the project can be focused at what it does best. One example I like to mention is OctoPrint/OctoPi. Software to control your 3D printer. While @foosel does a great job to maintain the core application (OctoPrint), the packaged Rasberry Pi image (OctoPi) is maintained in a different repo by a different user (@guysoft).
If we use that same approach there are a lot of things we can take out the core repo, and let other users start their own repo's to accomplish the same features while separating concerns.
In my opinion, the following parts could initially be taken out of the core repo, and taken over by other repo's:
Of course, we won't take out these features as long as no other solutions are in place. As an install and update replacement, we need to write a good manual.
The added benefit of this approach is that the release schedule of the above features is no longer tied to the quarterly release schedule of MagicMirror².
With the new approach I think it's good to set a few guidelines to which the future versions should adhere:
npm install
,git pull
, etc. Which will help people to learn and understand these commands.Since this project would have never been such a success without the help of the community, I want to discuss this approach before taking any action. So I'm looking forward to your input.
Please let me know what you think with an open mind.
Thanks! Michael.
EDIT: Provisional TO DO List
Based on the discussion below, I made a provisional to do list which could be the base for the simplification of this repository. The to do list is not set in stone, and could change based on the feedback in this issue.
npm run start
&npm run server
./installers
&/splashscreen
and remove all root .sh files). Where necessary, replace shell code with javascript code.Feel free to share your ideas and feedback!
The text was updated successfully, but these errors were encountered: