Bug 11490

Summary: Configuration Management Solution Study
Product: [Yocto Project Subprojects] IoT Reference OS Kit Reporter: Krisztian Litkey <krisztian.litkey>
Component: intel-iot-refkit-defaultAssignee: Amaranth Valluri <amarnath.valluri>
Status: RESOLVED FIXED QA Contact: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia>
Severity: enhancement    
Priority: Medium CC: amarnath.valluri, jose.perez.carranza, patrick.ohly
Version: 2.4   
Target Milestone: 2.4 M2   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Krisztian Litkey 2017-05-10 09:45:18 UTC
Evaluate the suitability of existing configuration management solutions (uci/luci, etc.) for integration into refkit.
Comment 1 Patrick Ohly 2017-07-17 18:53:09 UTC
Amarnath, are you now working on this instead of Krisztian? Is it realistic to finish this before 2.4 M2 (basically end of this month)?
Comment 2 Amaranth Valluri 2017-07-18 09:15:15 UTC
(In reply to comment #1)
> Amarnath, are you now working on this instead of Krisztian? Is it realistic
> to finish this before 2.4 M2 (basically end of this month)?

Yes, i been working on this. Currently evaluating the usage of UCI/LuCI on refkit. I think we can finish this for M2 scope.
Comment 3 Amaranth Valluri 2017-08-09 11:00:05 UTC
Here is the update on OpenWRT's uci/LuCI evaluation:

- UCI: is the configuration solution for OpenWRT's systems.
- LuCI/LuCI2/JuCI : is the web interface for configuring devices running OpenWRT system, built on top of UCI. License: Apache-2.0
- LuCI is Lua based, and uses Lua extensions to access subsystem info and is appeared to be quite resource consuming and didn't work well on devices with slow CPU and little amount of RAM.
- LuCI2 is a new(experimental) web interface with a different architecture written using JavaScript. It uses XHR(XmlHTTPRequest) method., that means building the HTML pages is done at client side. LuCI2 uses ubus(inter-process communication bus system) to communicate with the subsystem. License: Apache v2.0
- JuCI is modern web interface build using HTML5 and angular.js, and uses websockets for communicating with a compact and fast lua backend running o the device. License: GPLv3
- LuCI2 is preferred web interface over Luci and Juci due to it's simple architecture, less external dependencies and flexible licensing.
- LuCI2 web interface provides configuration ui for:
    - System information such as host name, device model, Firmware version, Kernel version, Device memory information, Storage details.
    - Routes –     IPv4/v6 routes active on the system
    - Kernel logs
    - System logs     (/var/log/messages)
    - Sending signals to running processes     
    - Add/remove ssh keys(dropbear)
    - Adding/removing network interfaces
    - enable/disable a network device
- Luci2 provides base widgets(JS objects) which can be extended to customize the ui. New UI tabs/views can be added by extending Luci's L.ui.view JavaScript object.

- External dependencies we bring-in:
    libubox – C utility functions for OpenWrt
    uci  - A small utility written in C, intended to centralize the configuration
    ubus – OpenWrt micro bus for inter process communication
    rpcd – ubus RPC backend server
    luci2 - OpenWrt web user interface
    uhttp2     – light weight web server
    ustream-ssl - Ustream SSL wrapper library

The Yocto meta data for these components are grouped under meta-configuration layer:
   https://github.com/avalluri/meta-configuration

There needs to be work done at system adaptation., i.e, Make refkit core components such as openssh, connman etc., aware of UCI configuration, by writing adapters. Similar proof of concept work is done here:
https://github.com/avalluri/rpcd-system-plugin
https://github.com/avalluri/connman-uci