From dd53c45a2cb46f882a856869de26215942749cba Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 30 Mar 2020 18:47:01 +0200 Subject: docs: add utils/lxc.sh docs, normalize filtron, morty & searx docs Signed-off-by: Markus Heiser --- docs/utils/lxc.sh.rst | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 docs/utils/lxc.sh.rst (limited to 'docs/utils/lxc.sh.rst') diff --git a/docs/utils/lxc.sh.rst b/docs/utils/lxc.sh.rst new file mode 100644 index 000000000..68577ea13 --- /dev/null +++ b/docs/utils/lxc.sh.rst @@ -0,0 +1,79 @@ + + +.. _snap: https://snapcraft.io +.. _snapcraft LXD: https://snapcraft.io/lxd +.. _LXC/LXD Image Server: https://uk.images.linuxcontainers.org/ +.. _LXC: https://linuxcontainers.org/lxc/introduction/ +.. _LXD: https://linuxcontainers.org/lxd/introduction/ +.. _`LXD@github`: https://github.com/lxc/lxd + +.. _lxc.sh: + +================ +``utils/lxc.sh`` +================ + +.. sidebar:: further reading + + - snap_, `snapcraft LXD`_ + - LXC_, LXD_ + - `LXC/LXD Image Server`_ + - `LXD@github`_ + +With the use of *Linux Containers* (LXC_) we can scale our tasks over a stack of +containers, what we call the: *lxc suite*. Before you can start with +containers, you need to install and initiate LXD_ once:: + + $ snap install lxd + $ lxd init --auto + +The *searx suite* (:origin:`lxc-searx.env `) is loaded by +default, every time you start the ``lxc.sh`` script (you do not need to care +about). To make use of the containers from the *searx suite*, you have to build +the :ref:`LXC suite containers ` first. But be warned, this +might take some time:: + + $ sudo -H ./utils/lxc.sh build + +A cup of coffee later, your LXC suite is build up and you can run whatever task +you want / in a selected or even in all :ref:`LXC suite containers `. Each container shares the root folder of the repository and the +command ``utils/lxc.sh cmd`` handles relative path names *transparent*:: + + $ sudo -H ./utils/lxc.sh cmd -- ls -la Makefile + ... + [searx-ubu2004] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile + [searx-fedora31] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile + [searx-archlinux] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile + +With this in mind, you can run :ref:`searx.sh` and install packages, needed by +searx:: + + $ sudo -H ./utils/lxc.sh cmd -- ./utils/searx.sh install packages + +And run one of the :origin:`Makefile` targets:: + + $ sudo -H ./utils/lxc.sh cmd -- make test.sh + +You can install a *buildhost environment* into the containers (time for another +cup of coffee):: + + $ sudo -H ./utils/lxc.sh install buildhost + +If you want to get rid off all the containers, just type:: + + $ sudo -H ./utils/lxc.sh remove + +To clean up your local images use:: + + $ sudo -H ./utils/lxc.sh remove images + +.. _lxc.sh --help: + +Overview +======== + +The ``--help`` output of the script is largely self-explanatory: + +.. program-output:: ../utils/lxc.sh --help + -- cgit v1.2.3 From f27f6c6c5d372b257dfe671ec26eb73f6e12ed28 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 31 Mar 2020 18:25:40 +0200 Subject: docs: use make and uitls/searx.sh in containers Signed-off-by: Markus Heiser --- docs/utils/lxc.sh.rst | 103 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 80 insertions(+), 23 deletions(-) (limited to 'docs/utils/lxc.sh.rst') diff --git a/docs/utils/lxc.sh.rst b/docs/utils/lxc.sh.rst index 68577ea13..20f387158 100644 --- a/docs/utils/lxc.sh.rst +++ b/docs/utils/lxc.sh.rst @@ -1,5 +1,4 @@ - .. _snap: https://snapcraft.io .. _snapcraft LXD: https://snapcraft.io/lxd .. _LXC/LXD Image Server: https://uk.images.linuxcontainers.org/ @@ -7,6 +6,8 @@ .. _LXD: https://linuxcontainers.org/lxd/introduction/ .. _`LXD@github`: https://github.com/lxc/lxd +.. _archlinux: https://www.archlinux.org/ + .. _lxc.sh: ================ @@ -21,24 +22,31 @@ - `LXD@github`_ With the use of *Linux Containers* (LXC_) we can scale our tasks over a stack of -containers, what we call the: *lxc suite*. Before you can start with -containers, you need to install and initiate LXD_ once:: +containers, what we call the: *lxc suite*. The *searx suite* +(:origin:`lxc-searx.env `) is loaded by default, every time +you start the ``lxc.sh`` script (*you do not need to care about*). + +Before you can start with containers, you need to install and initiate LXD_ +once:: $ snap install lxd $ lxd init --auto -The *searx suite* (:origin:`lxc-searx.env `) is loaded by -default, every time you start the ``lxc.sh`` script (you do not need to care -about). To make use of the containers from the *searx suite*, you have to build -the :ref:`LXC suite containers ` first. But be warned, this -might take some time:: +To make use of the containers from the *searx suite*, you have to build the +:ref:`LXC suite containers ` initial. But be warned, this might +take some time:: $ sudo -H ./utils/lxc.sh build A cup of coffee later, your LXC suite is build up and you can run whatever task you want / in a selected or even in all :ref:`LXC suite containers `. Each container shares the root folder of the repository and the -command ``utils/lxc.sh cmd`` handles relative path names *transparent*:: +help>`. + +*Good to know ...* + +Eeach container shares the root folder of the repository and the +command ``utils/lxc.sh cmd`` **handles relative path names transparent**, +compare output of:: $ sudo -H ./utils/lxc.sh cmd -- ls -la Makefile ... @@ -46,29 +54,70 @@ command ``utils/lxc.sh cmd`` handles relative path names *transparent*:: [searx-fedora31] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile [searx-archlinux] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile -With this in mind, you can run :ref:`searx.sh` and install packages, needed by -searx:: +If there comes the time you want to **get rid off all** the containers and +**clean up local images** just type:: - $ sudo -H ./utils/lxc.sh cmd -- ./utils/searx.sh install packages + $ sudo -H ./utils/lxc.sh remove + $ sudo -H ./utils/lxc.sh remove images -And run one of the :origin:`Makefile` targets:: - $ sudo -H ./utils/lxc.sh cmd -- make test.sh +Install suite +============= -You can install a *buildhost environment* into the containers (time for another -cup of coffee):: +To install the complete :ref:`searx suite (includes searx, morty & filtron) +` into all LXC_ use:: - $ sudo -H ./utils/lxc.sh install buildhost + $ sudo -H ./utils/lxc.sh install suite -If you want to get rid off all the containers, just type:: +The command above installs a searx suite (see :ref:`installation scripts`). To +get the IP (URL) of the filtron service in the containers use ``show suite`` +command. To test instances from containers just open the URLs in your +WEB-Browser:: - $ sudo -H ./utils/lxc.sh remove + $ sudo ./utils/lxc.sh show suite | grep filtron + [searx-ubu1604] INFO: (eth0) filtron: http://n.n.n.135:4004/ + [searx-ubu1804] INFO: (eth0) filtron: http://n.n.n.141:4004/ + [searx-ubu1910] INFO: (eth0) filtron: http://n.n.n.137:4004/ + [searx-ubu2004] INFO: (eth0) filtron: http://n.n.n.127:4004/ + [searx-fedora31] INFO: (eth0) filtron: http://n.n.n.18:4004/ + [searx-archlinux] INFO: (eth0) filtron: http://n.n.n.12:4004/ -To clean up your local images use:: + +Running commands +================ - $ sudo -H ./utils/lxc.sh remove images +**Inside containers, you can use make or run scripts** from the +:ref:`toolboxing`. By example: to setup a :ref:`buildhosts` and run the +Makefile target ``test`` in the archlinux_ container:: + + sudo -H ./utils/lxc.sh cmd searx-archlinux ./utils/searx.sh buildhost + sudo -H ./utils/lxc.sh cmd searx-archlinux make test + + +Setup searx buildhost +===================== -.. _lxc.sh --help: +You can **install the searx buildhost environment** into one or all containers. +The installation procedure to set up a :ref:`build host` takes its +time. Installation in all containers will take more time (time for another cup +of coffee).:: + + sudo -H ./utils/lxc.sh cmd -- ./utils/searx.sh buildhost + +To build (live) documentation inside a archlinux_ container:: + + sudo -H ./utils/lxc.sh cmd searx-archlinux make docs-clean docs-live + ... + [I 200331 15:00:42 server:296] Serving on http://0.0.0.0:8080 + +To get IP of the container and the port number *live docs* is listening:: + + $ sudo ./utils/lxc.sh show suite | grep docs-live + ... + [searx-archlinux] INFO: (eth0) docs-live: http://n.n.n.12:8080/ + + +.. _lxc.sh help: Overview ======== @@ -77,3 +126,11 @@ The ``--help`` output of the script is largely self-explanatory: .. program-output:: ../utils/lxc.sh --help + +.. _lxc-searx.env: + +searx suite +=========== + +.. literalinclude:: ../../utils/lxc-searx.env + :language: bash -- cgit v1.2.3 From af988dbf71ce4b14d2056676d7d9691335266d83 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 3 Apr 2020 17:08:42 +0200 Subject: utils/lxc.sh: support build of selected containers $ sudo -H ./utils/lxc.sh build $ sudo -H ./utils/lxc.sh show [images|suite|info|config []] Signed-off-by: Markus Heiser --- docs/utils/lxc.sh.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'docs/utils/lxc.sh.rst') diff --git a/docs/utils/lxc.sh.rst b/docs/utils/lxc.sh.rst index 20f387158..fcddfb340 100644 --- a/docs/utils/lxc.sh.rst +++ b/docs/utils/lxc.sh.rst @@ -33,14 +33,17 @@ once:: $ lxd init --auto To make use of the containers from the *searx suite*, you have to build the -:ref:`LXC suite containers ` initial. But be warned, this might -take some time:: +:ref:`LXC suite containers ` initial. But be warned, **this might +take some time**:: $ sudo -H ./utils/lxc.sh build A cup of coffee later, your LXC suite is build up and you can run whatever task you want / in a selected or even in all :ref:`LXC suite containers `. +help>`. If you do not want to build all containers, **you can build just +one**:: + + $ sudo -H ./utils/lxc.sh build searx-ubu1804 *Good to know ...* @@ -50,9 +53,12 @@ compare output of:: $ sudo -H ./utils/lxc.sh cmd -- ls -la Makefile ... - [searx-ubu2004] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile - [searx-fedora31] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile - [searx-archlinux] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile + +In the containers, you can run what ever you want, e.g. to start a bash use:: + + $ sudo -H ./utils/lxc.sh cmd searx-ubu1804 bash + INFO: [searx-ubu1804] bash + root@searx-ubu1804:/share/searx# If there comes the time you want to **get rid off all** the containers and **clean up local images** just type:: -- cgit v1.2.3 From f693149cded4f783380f8f02154bd9288b72cdd5 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 8 Apr 2020 18:38:36 +0200 Subject: Changes from the installation tests on (all) LXC containers. Tested and fixed HTTP & uWSGI installation on: ubu1604 ubu1804 ubu1910 ubu2004 fedora31 archlinux Signed-off-by: Markus Heiser --- docs/utils/lxc.sh.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docs/utils/lxc.sh.rst') diff --git a/docs/utils/lxc.sh.rst b/docs/utils/lxc.sh.rst index fcddfb340..44ab79030 100644 --- a/docs/utils/lxc.sh.rst +++ b/docs/utils/lxc.sh.rst @@ -88,7 +88,11 @@ WEB-Browser:: [searx-fedora31] INFO: (eth0) filtron: http://n.n.n.18:4004/ [searx-archlinux] INFO: (eth0) filtron: http://n.n.n.12:4004/ - +To install a reverse proxy for filtron and morty use:: + + sudo -H ./utils/lxc.sh cmd -- FORCE_TIMEOUT=0 ./utils/filtron.sh apache install + sudo -H ./utils/lxc.sh cmd -- FORCE_TIMEOUT=0 ./utils/morty.sh apache install + Running commands ================ -- cgit v1.2.3 From 5fc17de8617d0d5771578f38f62a9d4714054747 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 19 Apr 2020 12:34:37 +0200 Subject: docs: marginal fix of command's './utils/lxc.sh show suite' output Signed-off-by: Markus Heiser --- docs/utils/lxc.sh.rst | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'docs/utils/lxc.sh.rst') diff --git a/docs/utils/lxc.sh.rst b/docs/utils/lxc.sh.rst index 44ab79030..9ca9b6bc0 100644 --- a/docs/utils/lxc.sh.rst +++ b/docs/utils/lxc.sh.rst @@ -81,17 +81,19 @@ command. To test instances from containers just open the URLs in your WEB-Browser:: $ sudo ./utils/lxc.sh show suite | grep filtron - [searx-ubu1604] INFO: (eth0) filtron: http://n.n.n.135:4004/ - [searx-ubu1804] INFO: (eth0) filtron: http://n.n.n.141:4004/ - [searx-ubu1910] INFO: (eth0) filtron: http://n.n.n.137:4004/ - [searx-ubu2004] INFO: (eth0) filtron: http://n.n.n.127:4004/ - [searx-fedora31] INFO: (eth0) filtron: http://n.n.n.18:4004/ - [searx-archlinux] INFO: (eth0) filtron: http://n.n.n.12:4004/ + [searx-ubu1604] INFO: (eth0) filtron: http://n.n.n.246:4004/ http://n.n.n.246/searx + [searx-ubu1804] INFO: (eth0) filtron: http://n.n.n.147:4004/ http://n.n.n.147/searx + [searx-ubu1910] INFO: (eth0) filtron: http://n.n.n.140:4004/ http://n.n.n.140/searx + [searx-ubu2004] INFO: (eth0) filtron: http://n.n.n.18:4004/ http://n.n.n.18/searx + [searx-fedora31] INFO: (eth0) filtron: http://n.n.n.46:4004/ http://n.n.n.46/searx + [searx-archlinux] INFO: (eth0) filtron: http://n.n.n.32:4004/ http://n.n.n.32/searx -To install a reverse proxy for filtron and morty use:: +To :ref:`install a nginx ` reverse proxy for filtron and +morty use (or alternatively use :ref:`apache `):: + + sudo -H ./utils/lxc.sh cmd -- FORCE_TIMEOUT=0 ./utils/filtron.sh nginx install + sudo -H ./utils/lxc.sh cmd -- FORCE_TIMEOUT=0 ./utils/morty.sh nginx install - sudo -H ./utils/lxc.sh cmd -- FORCE_TIMEOUT=0 ./utils/filtron.sh apache install - sudo -H ./utils/lxc.sh cmd -- FORCE_TIMEOUT=0 ./utils/morty.sh apache install Running commands ================ -- cgit v1.2.3 From 4f7a6c09dd1b799a53a25166b49d23adceccea7d Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 18 Jun 2020 18:39:56 +0200 Subject: [fix] buildhosts documentation Signed-off-by: Markus Heiser --- docs/utils/lxc.sh.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/utils/lxc.sh.rst') diff --git a/docs/utils/lxc.sh.rst b/docs/utils/lxc.sh.rst index 9ca9b6bc0..ae1412870 100644 --- a/docs/utils/lxc.sh.rst +++ b/docs/utils/lxc.sh.rst @@ -102,7 +102,7 @@ Running commands :ref:`toolboxing`. By example: to setup a :ref:`buildhosts` and run the Makefile target ``test`` in the archlinux_ container:: - sudo -H ./utils/lxc.sh cmd searx-archlinux ./utils/searx.sh buildhost + sudo -H ./utils/lxc.sh cmd searx-archlinux ./utils/searx.sh install buildhost sudo -H ./utils/lxc.sh cmd searx-archlinux make test @@ -114,7 +114,7 @@ The installation procedure to set up a :ref:`build host` takes its time. Installation in all containers will take more time (time for another cup of coffee).:: - sudo -H ./utils/lxc.sh cmd -- ./utils/searx.sh buildhost + sudo -H ./utils/lxc.sh cmd -- ./utils/searx.sh install buildhost To build (live) documentation inside a archlinux_ container:: -- cgit v1.2.3