Skip to content
Snippets Groups Projects
Commit 8dca3cd5 authored by Suvendhu Hansa's avatar Suvendhu Hansa :speech_balloon:
Browse files

Align with doc structure

parent d7a069be
Branches
Tags
1 merge request!70Align with doc structure
Pipeline #81094 passed
Showing
with 13375 additions and 152 deletions
...@@ -10,3 +10,4 @@ ...@@ -10,3 +10,4 @@
*.gcov *.gcov
*.o *.o
*.so *.so
docs/index.md
...@@ -42,158 +42,10 @@ For installation of oci based application containers, bundle path need to define ...@@ -42,158 +42,10 @@ For installation of oci based application containers, bundle path need to define
For installation of lxc based containers, bundle path need to defined in above uci in 'lxc_bundle_root' option. For installation of lxc based containers, bundle path need to defined in above uci in 'lxc_bundle_root' option.
It is suggested to configure a non-volatile secondary memory location in this options. Also 'lan_bridge' need to point to a valid bridge where application containers network namespace shall be attached. It is suggested to configure a non-volatile secondary memory location in this options. Also 'lan_bridge' need to point to a valid bridge where application containers network namespace shall be attached.
## swmodd uBus ## Important topics
* [LXC template](./docs/guide/lxc_template.md)
`swmodd` must be launched on startup after `uspd`. It exposes the SoftwareModules datamodel objectes over ubus. The `swmodd` registers `swmodules` namespaces with ubus, that has the shown below functionalities: * [Deployment of application containers](./docs/guide/application_container.md)
* [UBUS methods](./docs/guide/ubus_methods.md)
```bash
root@iopsys:~# ubus -v list swmodules
'swmodules' @19113d4c
"ee_list":{}
"reload":{}
"du_list":{"eeid":"Integer","ee_name":"String"}
"eu_list":{"eeid":"Integer","ee_name":"String"}
"du_install":{"eeid":"Integer","ee_name":"String","uuid":"String","url":"String","username":"String","password":"String"}
"du_update":{"eeid":"Integer","ee_name":"String","uuid":"String","url":"String","username":"String","password":"String"}
"du_uninstall":{"eeid":"Integer","ee_name":"String","du_name":"String"}
"eu_set_state":{"eeid":"Integer","ee_name":"String","eu_name":"String","state":"Boolean"}
"ee_set_state":{"eeid":"Integer","ee_name":"String","state":"String"}
root@iopsys:~#
```
For more info on the `swmodules` ubus schema see [link](./docs/api/swmodules.md) or [raw schema](./schemas/ubus/swmodules.json)
## swmodd lxc templates
swmodd also includes LXC templates to easily create LXC based containers. This template shall used only for development and test purpose.
#### To create a new container using iopsys template:
`lxc-create -n <container_name> -t iopsys`
example:
```bash
root@iopsys:~# lxc-create -n test -t iopsys
root@iopsys:~#
```
### How to deploy application containers
`swmodd` support deployment of application containers which support OCI image and runtime formats using CRUN.
#### How to create an application container tar
To convert an docker image to OCI application container, we need to use `skopeo` and `umoci` utilities.
In below exaple [httpd](https://hub.docker.com/_/httpd) docker container is used
- Create an empty directory in local laptop/desktop
```bash
$ mkdir lcm
$ cd lcm
```
- Copy the docker image using skopeo, make sure to use correct tag as per the target architecture
```bash
$ skopeo copy docker://httpd:latest oci:httpd_copy:latest
```
- Unpack the downloaded image in OCI format using umoci
```bash
$ sudo -i
# cd <working_dir_path>
# umoci unpack --image httpd_copy:latest httpd
```
- Move to the directory containing config.json and rootfs and create a tar
```bash
# cd httpd
# tar cf ../httpd.tar *
```
- Use this tar in `install_du` ubus command to deploy the application container
##### Sulu application container
An example makefile to generate sulu application container tar ball can be accessed [here](./examples/sulu/README.md)
### swmodd ubus examples
The outputs shown below are just an example, it can vary on each system. Long outputs are truncated to beautify the document.
#### List down the available execution environments
```bash
root@iopsys:~# ubus call swmodules ee_list
{
"environment": [
{
"ee_name": "OpenWRT_Linux",
"eeid": 1,
"status": "Up",
"pause": 0,
"autoboot": 1,
"type": "Virtual_EE",
"vendor": "iopsys-eca940fff680",
"version": "4.19.235",
"allocated_disk_space": 27632,
"available_disk_space": 26716,
"allocated_memory": 1014988,
"available_memory": 476840,
"parent_ee_ref": 0
}
]
}
root@iopsys:~#
```
#### Install new application container as deployment unit
This requires support to pull images from container registry.
```bash
root@iopsys:~# ubus call swmodules du_install '{"url":"docker://httpd:latest"}'
{
"status": true
}
root@iopsys:~#
```
#### List available deployment units/installed services
```bash
root@iopsys:~# ubus call swmodules du_list
{
"deployment_unit": [
{
"du_name": "httpd",
"ee_name": "OpenWRT_Linux",
"eeid": 1,
"uuid": "347dd4bf-6b51-4d62-be61-77c8ded98698",
"duid": "w0t0000",
"url": "docker://httpd:latest",
"version": "",
"config": "",
"description": "",
"du_status": "Installed",
"eu_name": "httpd",
"vendor": ""
}
]
}
root@iopsys:~#
```
#### List execution units/running services
```bash
root@iopsys:~# ubus call swmodules eu_list
{
"execution_unit": [
{
"eu_name": "httpd",
"command": "",
"state": "Active",
"config": "",
"version": "4.19.235",
"description": "This is a CRUN container",
"ee_name": "OpenWRT_Linux",
"eeid": 1,
"euid": "22728",
"disk_space": 91840,
"memory_space": 1014988,
"vendor": "umoci-default",
"req_state": "Active",
"autostart": true,
"du_name": "httpd"
}
]
}
```
## Dependencies ## Dependencies
`swmodd` compile time and run time dependencies. `swmodd` compile time and run time dependencies.
......
title: "DOCS"
nav:
- "api"
- "guide"
- "..."
title: "API"
nav:
- "ubus"
- "..."
title: "ubus"
nav:
- "..."
File moved
File added
This diff is collapsed.
File added
File added
File added
File added
This diff is collapsed.
File added
File added
File added
////
/// Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Color variables
:root {
// Default color shades
--md-default-fg-color: hsla(0, 0%, 0%, 0.87);
--md-default-fg-color--light: hsla(0, 0%, 0%, 0.54);
--md-default-fg-color--lighter: hsla(0, 0%, 0%, 0.32);
--md-default-fg-color--lightest: hsla(0, 0%, 0%, 0.07);
--md-default-bg-color: hsla(0, 0%, 100%, 1);
--md-default-bg-color--light: hsla(0, 0%, 100%, 0.7);
--md-default-bg-color--lighter: hsla(0, 0%, 100%, 0.3);
--md-default-bg-color--lightest: hsla(0, 0%, 100%, 0.12);
// Primary color shades
--md-primary-fg-color: hsla(#{hex2hsl($clr-indigo-500)}, 1);
--md-primary-fg-color--light: hsla(#{hex2hsl($clr-indigo-400)}, 1);
--md-primary-fg-color--dark: hsla(#{hex2hsl($clr-indigo-700)}, 1);
--md-primary-bg-color: hsla(0, 0%, 100%, 1);
--md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7);
// Accent color shades
--md-accent-fg-color: hsla(#{hex2hsl($clr-indigo-a200)}, 1);
--md-accent-fg-color--transparent: hsla(#{hex2hsl($clr-indigo-a200)}, 0.1);
--md-accent-bg-color: hsla(0, 0%, 100%, 1);
--md-accent-bg-color--light: hsla(0, 0%, 100%, 0.7);
// Light theme (default)
> * {
// Code color shades
--md-code-fg-color: hsla(200, 18%, 26%, 1);
--md-code-bg-color: hsla(0, 0%, 96%, 1);
// Code highlighting color shades
--md-code-hl-color: hsla(#{hex2hsl($clr-yellow-a200)}, 0.5);
--md-code-hl-number-color: hsla(0, 67%, 50%, 1);
--md-code-hl-special-color: hsla(340, 83%, 47%, 1);
--md-code-hl-function-color: hsla(291, 45%, 50%, 1);
--md-code-hl-constant-color: hsla(250, 63%, 60%, 1);
--md-code-hl-keyword-color: hsla(219, 54%, 51%, 1);
--md-code-hl-string-color: hsla(150, 63%, 30%, 1);
--md-code-hl-name-color: var(--md-code-fg-color);
--md-code-hl-operator-color: var(--md-default-fg-color--light);
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
--md-code-hl-comment-color: var(--md-default-fg-color--light);
--md-code-hl-generic-color: var(--md-default-fg-color--light);
--md-code-hl-variable-color: var(--md-default-fg-color--light);
// Typeset color shades
--md-typeset-color: var(--md-default-fg-color);
// Typeset `a` color shades
--md-typeset-a-color: var(--md-primary-fg-color);
// Typeset `mark` color shades
--md-typeset-mark-color: hsla(#{hex2hsl($clr-yellow-a200)}, 0.5);
// Typeset `del` and `ins` color shades
--md-typeset-del-color: hsla(6, 90%, 60%, 0.15);
--md-typeset-ins-color: hsla(150, 90%, 44%, 0.15);
// Typeset `kbd` color shades
--md-typeset-kbd-color: hsla(0, 0%, 98%, 1);
--md-typeset-kbd-accent-color: hsla(0, 100%, 100%, 1);
--md-typeset-kbd-border-color: hsla(0, 0%, 72%, 1);
// Typeset `table` color shades
--md-typeset-table-color: hsla(0, 0%, 0%, 0.12);
// Admonition color shades
--md-admonition-fg-color: var(--md-default-fg-color);
--md-admonition-bg-color: var(--md-default-bg-color);
// Footer color shades
--md-footer-fg-color: hsla(0, 0%, 100%, 1);
--md-footer-fg-color--light: hsla(0, 0%, 100%, 0.7);
--md-footer-fg-color--lighter: hsla(0, 0%, 100%, 0.3);
--md-footer-bg-color: hsla(0, 0%, 0%, 0.87);
--md-footer-bg-color--dark: hsla(0, 0%, 0%, 0.32);
}
// Shadow depth 1
--md-shadow-z1:
0 #{px2rem(4px)} #{px2rem(10px)} hsla(0, 0%, 0%, 0.05),
0 0 #{px2rem(1px)} hsla(0, 0%, 0%, 0.1);
// Shadow depth 2
--md-shadow-z2:
0 #{px2rem(4px)} #{px2rem(10px)} hsla(0, 0%, 0%, 0.1),
0 0 #{px2rem(1px)} hsla(0, 0%, 0%, 0.25);
// Shadow depth 3
--md-shadow-z3:
0 #{px2rem(4px)} #{px2rem(10px)} hsla(0, 0%, 0%, 0.2),
0 0 #{px2rem(1px)} hsla(0, 0%, 0%, 0.35);
}
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 460 84" style="enable-background:new 0 0 460 84;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<g>
<g>
<rect x="2.8" y="4.3" class="st0" width="16.7" height="76.1"/>
<path class="st0" d="M88.8,3C65.3,3,48.3,20.8,48.3,42.4v0.2c0,21.6,16.9,39.1,40.3,39.1c23.5,0,40.6-17.7,40.6-39.4v-0.2
C129.1,20.5,112.3,3,88.8,3z M111.6,42.6c0,13-9.4,23.7-22.8,23.7c-13.5,0-23-10.9-23-23.9v-0.2c0-13,9.4-23.7,22.8-23.7
c13.5,0,23.1,10.9,23.1,23.9v0.2H111.6z"/>
<path class="st0" d="M271.4,34.9c-13.2-3.4-16.4-5-16.4-10v-0.2c0-3.7,3.4-6.6,9.8-6.6s13,2.8,19.8,7.5l8.7-12.6
c-7.7-6.2-17.2-9.7-28.3-9.7c-15.5,0-26.6,9.1-26.6,22.9v0.2c0,15.1,9.9,19.4,25.2,23.3c12.7,3.3,15.3,5.4,15.3,9.7v0.2
c0,4.5-4.1,7.2-11,7.2c-8.7,0-15.9-3.6-22.7-9.2l-9.9,11.9c9.1,8.2,20.8,12.2,32.3,12.2c16.4,0,27.9-8.5,27.9-23.6v-0.2
C295.5,44.5,286.8,38.9,271.4,34.9z"/>
<polygon class="st0" points="347.3,34.9 329.1,4.3 309.5,4.3 338.8,50.4 338.8,80.4 355.5,80.4 355.5,50.1 384.8,4.3 365.7,4.3
"/>
<path class="st0" d="M432.2,34.9c-13.2-3.4-16.4-5-16.4-10v-0.2c0-3.7,3.4-6.6,9.8-6.6s13,2.8,19.8,7.5l8.7-12.6
c-7.7-6.2-17.2-9.7-28.3-9.7c-15.6,0-26.6,9.1-26.6,22.9v0.2c0,15.1,9.9,19.4,25.2,23.3c12.7,3.3,15.3,5.4,15.3,9.7v0.2
c0,4.5-4.1,7.2-11,7.2c-8.7,0-15.9-3.6-22.7-9.2l-9.9,11.9c9.1,8.2,20.8,12.2,32.3,12.2c16.4,0,27.9-8.5,27.9-23.6v-0.2
C456.3,44.5,447.6,38.9,432.2,34.9z"/>
<path class="st0" d="M186,4.3h-31.5v15.3h30c8.5,0,13.8,4.1,13.8,11.7v0.2c0,6.6-5,11.7-13.4,11.7h-30.4v37.2h16.9V58.3h12.9
c17.3,0,31.1-9.2,31.1-27.1V31C215.5,15.2,204.3,4.3,186,4.3z"/>
</g>
</g>
</svg>
@page {
size: a4 portrait;
margin: 25mm 10mm 25mm 10mm;
counter-increment: page;
font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
white-space: pre;
color: grey;
@top-left {
content: '© 2022 IOPSYS';
}
@top-center {
content: string(chapter);
}
@top-right {
content: 'Page ' counter(page);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment