-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added Settings and Python Logging #5
Open
rstreif
wants to merge
7
commits into
magnusfeuer:master
Choose a base branch
from
rstreif:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
In order to get the SWM PoC closer to CIAT and eventually production I added the following functionality: * Added the file common/settings.py that contains configuration settings: * Moved the list of software operations to settings so that it can easily be extended. * Added Python Logging to settings. * Added configuration parameters for mounting/unmounting the squashfs update files. * Configurable list of software operations Originally this list of operations was part of the software_loading_manager/software_operation.py module. However, if we ever wanted to extend that list with operations provided by other plugins we would have to edit this source file. To make this easier, the operations list is now part of settings. * Python Logging All debug and other output was sent to the console using print statements. That makes unattended operation in production and during CIAT rather hard. We are now using Python Logging for all the debug etc. messages. Only the output for simulated operations and usage are still using direct output to the console. The former will eventually go away for production anyway. * Mount Command Options The squashfs archives need to be mounted. However, only root can execute mount and umount commands. That is problematic when running in an CIAT environment. Hence, the mount and umount commands and potentially options are not configurable through settings. To mount squashfs as a regular user there is squashfuse. Unfortunately, it is not part of regular Linux distros but there is no alternative that is. When using squashfuse it has to built from source at https://github.com/vasi/squashfuse. However, that is straight forward. Signed-off-by: Rudolf J Streif <rudolf.streif@gmail.com>
Since swm now supports mounting as root using mount/umount (which of course require root privileges) and as user using squashfuse (which needs to be installed on the system) the startup script checks the configuration from settings.py and checks if the requirements are met. Signed-off-by: Rudolf J Streif <rudolf.streif@gmail.com>
The hiearchy of ManifestProcessor, Manifest and SoftwareOperation was tightly coupled where Manifest had a reference to ManifestProcessor and SoftwareOperation a reference to Manifest. Refactoring enabled a simpler architectuere that made that coupling unnecessary. Signed-off-by: Rudolf J Streif <rudolf.streif@gmail.com>
To provide better tracking of software updates and the results of individual operations, this patchset adds database support. The database is a simple Sqlite database, however, the ORM also supports MySQL and Postgresql RDBMS. As ORM Python Storm is used. Signed-off-by: Rudolf J Streif <rudolf.streif@gmail.com>
Implemented actual installation, removal and upgrade operations into the Package Manager for either RPM-based or DEB-based distributions. What type of package manager is used is set through the PACKAGE_MANAGER variable in the common/settings.py configuration module. Added test software update images for RPM (rpm_update) and DEB (deb_update) that attempt to install the nano editor. The start_swm.sh scripts tries to figure out what distribution it is running on and then selects the correct software update image accordingly. Signed-off-by: Rudolf J Streif <rudolf.streif@gmail.com>
Hi Magnus, Tons of commits now for the new SWM functionality. If you have time please have a look and let me know. Then I can also push it to the GENIVI repo. |
The script start_swm.sh launched a terminal for every SWM component. That is useful for testing but hinders CI. Enabled all SWM components so that they can be started in the foreground as well as daemons in the background. The start_swm.sh script has a new option '-b' that launches background mode. The new script stop_swm.sh can be used to stop the running SWM components. Signed-off-by: Rudolf J Streif <rudolf.streif@gmail.com>
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.
In order to get the SWM PoC closer to CIAT and eventually production
I added the following functionality:
easily be extended.
update files.
Originally this list of operations was part of the
software_loading_manager/software_operation.py module. However, if we
ever wanted to extend that list with operations provided by other plugins
we would have to edit this source file. To make this easier, the operations
list is now part of settings.
All debug and other output was sent to the console using print statements.
That makes unattended operation in production and during CIAT rather hard.
We are now using Python Logging for all the debug etc. messages. Only the
output for simulated operations and usage are still using direct output to
the console. The former will eventually go away for production anyway.
The squashfs archives need to be mounted. However, only root can execute
mount and umount commands. That is problematic when running in an CIAT
environment. Hence, the mount and umount commands and potentially options
are not configurable through settings. To mount squashfs as a regular user
there is squashfuse. Unfortunately, it is not part of regular Linux distros
but there is no alternative that is. When using squashfuse it has to built
from source at https://github.com/vasi/squashfuse. However, that is straight
forward.
Signed-off-by: Rudolf J Streif rudolf.streif@gmail.com