summaryrefslogtreecommitdiff
path: root/docs/utils
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-03-31 18:25:40 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2020-03-31 18:25:40 +0200
commitf27f6c6c5d372b257dfe671ec26eb73f6e12ed28 (patch)
tree5e66cf8312fe844784654f8553ef15dbd1afff0e /docs/utils
parent8634eeb9de40266be503641dcff78bbdc83e109d (diff)
downloadsearxng-f27f6c6c5d372b257dfe671ec26eb73f6e12ed28.tar.gz
searxng-f27f6c6c5d372b257dfe671ec26eb73f6e12ed28.zip
docs: use make and uitls/searx.sh in containers
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'docs/utils')
-rw-r--r--docs/utils/lxc.sh.rst103
1 files changed, 80 insertions, 23 deletions
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 <utils/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 <utils/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 <lxc.sh --help>` 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 <lxc.sh help>` 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 <lxc.sh
---help>`. 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)
+<lxc-searx.env>` 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<buildhosts>` 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