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
Selective dependency installation #412
Comments
… user to install the requirements (#412)
@zsole2 Will you be willing to test the new minimal install feature on your Pi Zero and provide feedback about improving the system? I have everything except the install/upgrade scripts worked out for this new system. |
Of course, I will do the testing... this is a feature that I am looking forward to use all the tome on my Pi Zeros. |
Here are some initial install times on a Pi 2 using the new dependency system: Minimal Install (required dependencies)
Custom Install (required dependencies + quick2wire + 1wthermsensor)
Full Install (required dependencies + all optional dependencies)
The difference between a Full and Minimum install was 3 min. 5 sec. (32% less time). Edit: Updated times to be more accurate |
Did a Minimum install, it took 37m 52s. Then I checked two older log files, one of them took about 72 mins, the other 78 mins. Great improvement! I'll try to add some sensors and see that part. |
Another fresh minimum install also finished in the 38 mins range. Adding the DS18 sensor went flawlessly, too. A few issues came to my mind:
As an even better news, it looks that the total resource usage is much much better now, still checking it, but on the sous-vide controller with two sensors, one output and one PID controller, the processor usage is 5-6% and the memory usage is 5%. |
I'll get to this soon.
I can also put a check in, when the user attempts to add a 1-wire device, to see if the 1-wire interface has been enabled, and if not, redirect the user to the Pi Config page to enable it. In that same line, I can have all interfaces checked and the user redirected to the Pi Config page if a particular interface hasn't been enabled. I should also add an option to disable that checking (for power users) in case they enabled an interface on a non-default location (not raspi-config), so I don't lock them out from adding Inputs if they choose not to use the default interface provided by raspi-config.
It operates the same as before.
Good point. It appears
Good to hear, though I have no idea why, lol |
…, add warning when a communication interface is disabled and it needs to be used (#412), fix setting up pigpiod during install
I did a third install, on an older smaller SD card, it took 53 mins. |
What I meant for the export/import is that what happens if someone loads the config to another Pi where the dependencies were not properly set up. The mycodo database will have the device(s) but their dependencies may be missing. |
I should add a function to scan the new database and check for unmet dependencies. As of now, the user will have to ensure the dependencies are met. |
I have a feeling removing libav-tools and libffi-dev from the installation will also speed it up: b36e6d6 |
I did an upgrade from v5.6.0 to Master, it went smooth and fast, about 15 mins on the Zero (it used to be around 40 mins).
appears more than once, in fact, it appears 3 times in the log. This seems redundant, too:
Finally, there upgrade of optional components seems OK:
Although wiringpi behaves differently than the others... |
Part of that short sequence is setting proper file/folder permissions, which needs to be done after a few key events to make sure permissions are set correctly. The execution should be relatively quick, so it's not a big deal to me that there may be some redundancy in it. I'll check it out again and see if it can be improved with just permission setting instead of the other code being executed.
One is the updating of pip itself, the next is checking for python package updates. Both are necessary.
This is because it's the first time you updated to a version with wiringpi being optional. Any future upgrade it should either update it (if it was previously installed) or state there's no install candidate and not install it. |
I hope the latest commit, above, doesn't break the upgrade process 😬 |
I can test it... |
Thinking of testing... first I need upgrade to master to have the new upgrade script installed, then in a second run is needed to test it. Would it work to the same state of the master, or should I wait for at least 1 new commit? |
You can perform two upgrades to master to use the latest code to test an upgrade. |
Apparently both upgrades went without any problem. |
Thanks for testing. I just fixed some issues, improved the dependency install with a display (and auto-update) of the dependency install log, and added this log to the Mycodo Log page. So, I believe this issue is completely solved. |
v5.6.0 proposal
As Mycodo grows in device support, so too does the number of dependencies that need to be met during the install process. To prepare for future expansion and save users from installing components they will never use, the Mycodo install should only include those packages required to run the frontend (web UI) and backend (daemon) without any devices added. Also, by selectively installing Mycodo components for only what features are used, there will be a smaller/faster base install.
Upon adding a device that requires a Python package that's not installed, the user is prompted to install the dependency. If the user says yes, the package is installed and the device is added. If the user says no, the user is taken back to the previous page without adding the device.
Users should also be prompted during the install whether they would like to perform a minimal, custom, or full install. Custom would allow the user to select individual packages to install. This would be useful if the Pi will not have internet access at a future time when a new device is desired to be added.
Steps
The text was updated successfully, but these errors were encountered: