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
Better setup mechanism #398
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- The last part of the module import path is the module name. This also becomes the Django app name. Apps names have to be unique. Hence, there is no scope for two different modules with same name but different load path to exist in the project. - Most uses of list of loaded modules are dealing with app names instead of full module load path. This is due to the fact that Django deals with app names and not module paths. - It is also somewhat clumsy to access a loaded module as we are re-importing every time to get access module. - Simplify all of the above by using app names are module identifiers and maintaing an ordered dictionary of app names to loadded modules. - Remove unused imports. - Minor styling fixes.
- As deprecated in Django 1.9.
- There shall be a setup helper object in every module. The setup process will simply call methods in helper. - Helper is responsible for loading/storing/checking module setup versions. - Methods help in showing progress of setup process automatically.
- During initialization add a setup helper to every module. For use later.
- Call the setup helper to check if a installation or update of a module is required. - Show installation and progress using the setup view.
- The --setup argument sets up all applications that declare themselves as essential. - This is done synchronously. - Plinth exits after the setup is complete. - Plinth fails with an error in case any of the setup tasks fail. The process will be continued on next invocation or access of application from UI.
To show introduction and title of a module which will be available as properties of a module. This allows the setup process to show the introduction to the application instead of a blank page.
- Also reorganize module to separate out views.
- Also reorganize views.
I've merged this with a few minor fixes. Please check that my changes are correct. |
Thanks for the changes. They look good. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The actual set of changes are small and easy. Each application required updates and I made those changes make the number of lines modified large. I tried to make all of those changes separately for easy review.
As side-effect of the implementation, I see much faster page loads due to elimination of package installation and also ability to perform queued installations and parallel setups.
Most of the intended changes are completed but very small parts remain. Here are my design notes they may be useful.
Design notes
Usability
should be visible before setup. Plinth should provide a generic
mechanism for starting setup.
Setup process should have a synchronous flow if possible. Plinth
should automatically show a progress of the setups happening.
packages. This should be synchronous and should not start a server.
manager will be running during Plinth upgrade. Plinth will be
restarted, during upgrades. Initially this may be implemented by
users having to manually run the setup process again. Later a
background process which waits for package manager to finish can
automatically trigger upgrades.
operation of Plinth and must be installed by default.
Design for Application:
init module. This will be incremented whenever the application
intends to upgrade an existin setup.
to run a pre-setup operation, install packages and post-install
operation.
arguments. This may be used to perform upgrades instead of fresh
setup. Older version will be NULL for first time setup.
functionality of Plinth. This application will be setup initially.
Design for Plinth:
Plinth and will be compared with current module version numbers to
see if an application needs upgrading.
if the module requires setup or upgrades. It will prompt and show
progress accordingly instead of allowing the view to be shown.
all applications and install critical ones.
setup for an application fails, it's dependencies will not be setup.