2018-05-25 03:36:12 +00:00
|
|
|
.. _dev_install:
|
|
|
|
|
2016-11-03 00:38:39 +00:00
|
|
|
Developer Installation
|
|
|
|
======================
|
2016-06-17 05:45:20 +00:00
|
|
|
|
2016-11-03 00:38:39 +00:00
|
|
|
Note that for non-development use you can use distribution packages or
|
2018-05-25 03:36:12 +00:00
|
|
|
install the latest release via ``pip`` (usually in a separate
|
|
|
|
``virtualenv`` environment).
|
2016-06-17 05:45:20 +00:00
|
|
|
|
2016-11-03 00:38:39 +00:00
|
|
|
For development purposes, you can use ``pip -e`` to install the latest
|
2018-05-25 03:36:12 +00:00
|
|
|
git tree checkout into a local development/testing ``virtualenv``.
|
2016-11-03 00:38:39 +00:00
|
|
|
|
2018-05-25 03:36:12 +00:00
|
|
|
However, the recommended way is to use provided ``tox`` environments;
|
|
|
|
e.g.
|
2016-11-03 00:38:39 +00:00
|
|
|
|
2018-05-25 03:36:12 +00:00
|
|
|
.. code-block:: shell-session
|
2016-11-03 00:38:39 +00:00
|
|
|
|
2019-05-11 21:04:34 +00:00
|
|
|
$ git clone https://opendev.org/openstack/diskimage-builder
|
2016-11-03 00:38:39 +00:00
|
|
|
$ cd diskimage-builder
|
2018-05-25 03:36:12 +00:00
|
|
|
|
|
|
|
$ tox -e bindep
|
|
|
|
$ sudo apt-get install <any-missing-packages-from-bindep>
|
|
|
|
|
|
|
|
$ tox -e venv -- disk-image-create ...
|
|
|
|
|
|
|
|
This will ensure you run with the right requirements.
|
2016-06-17 05:45:20 +00:00
|
|
|
|
2015-02-12 07:07:47 +00:00
|
|
|
Invocation
|
2018-05-25 03:36:12 +00:00
|
|
|
----------
|
|
|
|
|
|
|
|
The ``image-create`` scripts should be run from the ``$PATH``; this
|
|
|
|
should will be automatically set if using a ``virtualenv`` or ``tox``.
|
2015-02-12 07:07:47 +00:00
|
|
|
|
2018-05-25 03:36:12 +00:00
|
|
|
A range of options can be set on the command-line. Try ``-h`` for
|
|
|
|
help.
|
|
|
|
|
|
|
|
Other options can be set by exporting variables; some variables for
|
|
|
|
export are listed in ``lib/img-defaults``. See specific element
|
|
|
|
instructions for other variables that may be obeyed.
|
2015-02-12 07:07:47 +00:00
|
|
|
|
2016-03-08 00:17:59 +00:00
|
|
|
The image building scripts expect to be able to invoke commands with
|
2018-05-25 03:36:12 +00:00
|
|
|
``sudo``. Thus if you want them to run non-interactively, you should
|
|
|
|
either run them as root, with ``sudo -E``, or allow your build user to
|
|
|
|
run any ``sudo`` command without password.
|
|
|
|
|
|
|
|
Element priority
|
|
|
|
----------------
|
2015-02-12 07:07:47 +00:00
|
|
|
|
2016-06-28 05:41:50 +00:00
|
|
|
The variable ``ELEMENTS_PATH`` is a colon (:) separated path list to
|
|
|
|
search for elements. The included ``elements`` tree is used when no
|
|
|
|
path is supplied and is always added to the end of the path if a path
|
|
|
|
is supplied. Earlier elements will override later elements, i.e. with
|
|
|
|
``ELEMENTS_PATH=foo:bar`` the element ``my-element`` will be chosen
|
|
|
|
from ``foo/my-element`` over ``bar/my-element``, or any in-built
|
|
|
|
element of the same name.
|
2016-03-08 00:17:59 +00:00
|
|
|
|
2018-05-25 03:36:12 +00:00
|
|
|
Output
|
|
|
|
------
|
|
|
|
|
2016-03-08 00:17:59 +00:00
|
|
|
By default, the image building scripts will not overwrite existing
|
|
|
|
disk images, allowing you to compare the newly built image with the
|
|
|
|
existing one. To change that behaviour, set the variable
|
2016-08-15 19:13:52 +00:00
|
|
|
``OVERWRITE_OLD_IMAGE`` to any value that isn't ``0``. If this value is
|
|
|
|
zero then any existing image will be moved before the new image is
|
|
|
|
written to the destination.
|
2016-03-08 00:17:59 +00:00
|
|
|
|
2018-05-25 03:36:12 +00:00
|
|
|
Size reports
|
|
|
|
------------
|
|
|
|
|
2016-03-08 00:17:59 +00:00
|
|
|
Setting the variable ``DIB_SHOW_IMAGE_USAGE`` will print out a
|
|
|
|
summarised disk-usage report for the final image of files and
|
|
|
|
directories over 10MiB in size. Setting ``DIB_SHOW_IMAGE_USAGE_FULL``
|
|
|
|
will show all files and directories. These settings can be useful
|
|
|
|
additions to the logs in automated build situations where debugging
|
|
|
|
image-growth may be important.
|