@@ -1,5 +1,4 @@
11
2−
32.. _snap: https://snapcraft.io
43.. _snapcraft LXD: https://snapcraft.io/lxd
54.. _LXC/LXD Image Server: https://uk.images.linuxcontainers.org/
@@ -7,6 +6,8 @@
76.. _LXD: https://linuxcontainers.org/lxd/introduction/
87.. _`LXD@github`: https://github.com/lxc/lxd
98
9+.. _archlinux: https://www.archlinux.org/
10+
1011.. _lxc.sh:
1112
1213================
@@ -21,24 +22,31 @@
2122 - `LXD@github`_
2223
2324With the use of *Linux Containers* (LXC_) we can scale our tasks over a stack of
24−containers, what we call the: *lxc suite*. Before you can start with
25−containers, you need to install and initiate LXD_ once::
25+containers, what we call the: *lxc suite*. The *searx suite*
26+(:origin:`lxc-searx.env <utils/lxc-searx.env>`) is loaded by default, every time
27+you start the ``lxc.sh`` script (*you do not need to care about*).
28+
29+Before you can start with containers, you need to install and initiate LXD_
30+once::
2631
2732 $ snap install lxd
2833 $ lxd init --auto
2934
30−The *searx suite* (:origin:`lxc-searx.env <utils/lxc-searx.env>`) is loaded by
31−default, every time you start the ``lxc.sh`` script (you do not need to care
32−about). To make use of the containers from the *searx suite*, you have to build
33−the :ref:`LXC suite containers <lxc.sh --help>` first. But be warned, this
34−might take some time::
35+To make use of the containers from the *searx suite*, you have to build the
36+:ref:`LXC suite containers <lxc.sh help>` initial. But be warned, this might
37+take some time::
3538
3639 $ sudo -H ./utils/lxc.sh build
3740
3841A cup of coffee later, your LXC suite is build up and you can run whatever task
3942you want / in a selected or even in all :ref:`LXC suite containers <lxc.sh
40−--help>`. Each container shares the root folder of the repository and the
41−command ``utils/lxc.sh cmd`` handles relative path names *transparent*::
43+help>`.
44+
45+*Good to know ...*
46+
47+Eeach container shares the root folder of the repository and the
48+command ``utils/lxc.sh cmd`` **handles relative path names transparent**,
49+compare output of::
4250
4351 $ sudo -H ./utils/lxc.sh cmd -- ls -la Makefile
4452 ...
@@ -46,29 +54,70 @@ command ``utils/lxc.sh cmd`` handles relative path names *transparent*::
4654 [searx-fedora31] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile
4755 [searx-archlinux] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile
4856
49−With this in mind, you can run :ref:`searx.sh` and install packages, needed by
50−searx::
57+If there comes the time you want to **get rid off all** the containers and
58+**clean up local images** just type::
5159
52− $ sudo -H ./utils/lxc.sh cmd -- ./utils/searx.sh install packages
60+ $ sudo -H ./utils/lxc.sh remove
61+ $ sudo -H ./utils/lxc.sh remove images
5362
54−And run one of the :origin:`Makefile` targets::
5563
56− $ sudo -H ./utils/lxc.sh cmd -- make test.sh
64+Install suite
65+=============
5766
58−You can install a *buildhost environment* into the containers (time for another
59−cup of coffee)::
67+To install the complete :ref:`searx suite (includes searx, morty & filtron)
68+<lxc-searx.env>` into all LXC_ use::
6069
61− $ sudo -H ./utils/lxc.sh install buildhost
70+ $ sudo -H ./utils/lxc.sh install suite
6271
63−If you want to get rid off all the containers, just type::
72+The command above installs a searx suite (see :ref:`installation scripts`). To
73+get the IP (URL) of the filtron service in the containers use ``show suite``
74+command. To test instances from containers just open the URLs in your
75+WEB-Browser::
6476
65− $ sudo -H ./utils/lxc.sh remove
77+ $ sudo ./utils/lxc.sh show suite | grep filtron
78+ [searx-ubu1604] INFO: (eth0) filtron: http://n.n.n.135:4004/
79+ [searx-ubu1804] INFO: (eth0) filtron: http://n.n.n.141:4004/
80+ [searx-ubu1910] INFO: (eth0) filtron: http://n.n.n.137:4004/
81+ [searx-ubu2004] INFO: (eth0) filtron: http://n.n.n.127:4004/
82+ [searx-fedora31] INFO: (eth0) filtron: http://n.n.n.18:4004/
83+ [searx-archlinux] INFO: (eth0) filtron: http://n.n.n.12:4004/
6684
67−To clean up your local images use::
85+
86+Running commands
87+================
6888
69− $ sudo -H ./utils/lxc.sh remove images
89+**Inside containers, you can use make or run scripts** from the
90+:ref:`toolboxing`. By example: to setup a :ref:`buildhosts` and run the
91+Makefile target ``test`` in the archlinux_ container::
92+
93+ sudo -H ./utils/lxc.sh cmd searx-archlinux ./utils/searx.sh buildhost
94+ sudo -H ./utils/lxc.sh cmd searx-archlinux make test
95+
96+
97+Setup searx buildhost
98+=====================
7099
71−.. _lxc.sh --help:
100+You can **install the searx buildhost environment** into one or all containers.
101+The installation procedure to set up a :ref:`build host<buildhosts>` takes its
102+time. Installation in all containers will take more time (time for another cup
103+of coffee).::
104+
105+ sudo -H ./utils/lxc.sh cmd -- ./utils/searx.sh buildhost
106+
107+To build (live) documentation inside a archlinux_ container::
108+
109+ sudo -H ./utils/lxc.sh cmd searx-archlinux make docs-clean docs-live
110+ ...
111+ [I 200331 15:00:42 server:296] Serving on http://0.0.0.0:8080
112+
113+To get IP of the container and the port number *live docs* is listening::
114+
115+ $ sudo ./utils/lxc.sh show suite | grep docs-live
116+ ...
117+ [searx-archlinux] INFO: (eth0) docs-live: http://n.n.n.12:8080/
118+
119+
120+.. _lxc.sh help:
72121
73122Overview
74123========
@@ -77,3 +126,11 @@ The ``--help`` output of the script is largely self-explanatory:
77126
78127.. program-output:: ../utils/lxc.sh --help
79128
129+
130+.. _lxc-searx.env:
131+
132+searx suite
133+===========
134+
135+.. literalinclude:: ../../utils/lxc-searx.env
136+ :language: bash