lxc.sh.rst 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. .. _snap: https://snapcraft.io
  2. .. _snapcraft LXD: https://snapcraft.io/lxd
  3. .. _LXC/LXD Image Server: https://uk.images.linuxcontainers.org/
  4. .. _LXC: https://linuxcontainers.org/lxc/introduction/
  5. .. _LXD: https://linuxcontainers.org/lxd/introduction/
  6. .. _`LXD@github`: https://github.com/lxc/lxd
  7. .. _lxc.sh:
  8. ================
  9. ``utils/lxc.sh``
  10. ================
  11. .. sidebar:: further reading
  12. - snap_, `snapcraft LXD`_
  13. - LXC_, LXD_
  14. - `LXC/LXD Image Server`_
  15. - `LXD@github`_
  16. With the use of *Linux Containers* (LXC_) we can scale our tasks over a stack of
  17. containers, what we call the: *lxc suite*. Before you can start with
  18. containers, you need to install and initiate LXD_ once::
  19. $ snap install lxd
  20. $ lxd init --auto
  21. The *searx suite* (:origin:`lxc-searx.env <utils/lxc-searx.env>`) is loaded by
  22. default, every time you start the ``lxc.sh`` script (you do not need to care
  23. about). To make use of the containers from the *searx suite*, you have to build
  24. the :ref:`LXC suite containers <lxc.sh --help>` first. But be warned, this
  25. might take some time::
  26. $ sudo -H ./utils/lxc.sh build
  27. A cup of coffee later, your LXC suite is build up and you can run whatever task
  28. you want / in a selected or even in all :ref:`LXC suite containers <lxc.sh
  29. --help>`. Each container shares the root folder of the repository and the
  30. command ``utils/lxc.sh cmd`` handles relative path names *transparent*::
  31. $ sudo -H ./utils/lxc.sh cmd -- ls -la Makefile
  32. ...
  33. [searx-ubu2004] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile
  34. [searx-fedora31] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile
  35. [searx-archlinux] -rw-r--r-- 1 root root 7603 Mar 30 11:54 Makefile
  36. With this in mind, you can run :ref:`searx.sh` and install packages, needed by
  37. searx::
  38. $ sudo -H ./utils/lxc.sh cmd -- ./utils/searx.sh install packages
  39. And run one of the :origin:`Makefile` targets::
  40. $ sudo -H ./utils/lxc.sh cmd -- make test.sh
  41. You can install a *buildhost environment* into the containers (time for another
  42. cup of coffee)::
  43. $ sudo -H ./utils/lxc.sh install buildhost
  44. If you want to get rid off all the containers, just type::
  45. $ sudo -H ./utils/lxc.sh remove
  46. To clean up your local images use::
  47. $ sudo -H ./utils/lxc.sh remove images
  48. .. _lxc.sh --help:
  49. Overview
  50. ========
  51. The ``--help`` output of the script is largely self-explanatory:
  52. .. program-output:: ../utils/lxc.sh --help