Skip to content
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
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

rstreif
Copy link

@rstreif rstreif commented Mar 4, 2016

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 [email protected]

pragma1ce and others added 6 commits March 3, 2016 16:55
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
@rstreif
Copy link
Author

rstreif commented Mar 21, 2016

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants