project-config/nodepool/elements
Markos Chandras ba3fe3678f nodepool: elements: infra-package-needs: Install core python modules on openSUSE
openSUSE packages core python2 modules like the xml one in a separate
package called python-xml. Similarly, python3 contains the base modules
in python3-base and the xml one in python3. As such it's best to ensure
that both python-xml and python3 are installed similar to
I5cd5d1127ae62d6753c2ace44965179c5400bb9a

Also, update bindep.txt to include python3-devel and
python-xml for SUSE distros.

This is supposed to fix python3 related failures on openSUSE jobs such
as the following one:

2017-06-28 13:00:47.628446 | + virtualenv -p python3 env
2017-06-28 13:00:47.926042 | Using base prefix '/usr'
2017-06-28 13:00:47.926098 | New python executable in /home/jenkins/env/bin/python3
2017-06-28 13:00:47.926117 | Also creating executable in /home/jenkins/env/bin/python
2017-06-28 13:00:47.926144 | Please make sure you remove any previous custom paths from your /home/jenkins/.pydistutils.cfg file.
2017-06-28 13:00:48.303569 | Installing setuptools, pip, wheel...
2017-06-28 13:00:48.303705 |   Complete output from command /home/jenkins/env/bin/python3 - setuptools pip wheel:
2017-06-28 13:00:48.303733 |   Traceback (most recent call last):
2017-06-28 13:00:48.303748 |   File "<stdin>", line 7, in <module>
2017-06-28 13:00:48.303782 |   File "/usr/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 26, in <module>
2017-06-28 13:00:48.303816 |   File "/usr/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 27, in <module>
2017-06-28 13:00:48.303868 |   File "/usr/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 35, in <module>
2017-06-28 13:00:48.303904 |   File "/usr/lib64/python3.4/plistlib.py", line 65, in <module>
2017-06-28 13:00:48.303920 |     from xml.parsers.expat import ParserCreate
2017-06-28 13:00:48.303932 | ImportError: No module named 'xml'

Change-Id: I32899793a78464e25aec0e213eee9c65bd915a51
2017-07-04 08:27:42 +01:00
..
cache-devstack Remove 99-cache-testrepository-db from cache-devstack element 2017-05-25 11:45:17 -04:00
infra-package-needs nodepool: elements: infra-package-needs: Install core python modules on openSUSE 2017-07-04 08:27:42 +01:00
initialize-urandom Fix typos in initialize-urandom.py & gerrit-git-prep.sh 2016-11-08 03:57:55 +00:00
jenkins-slave Only configure jenkins cache if cache exists 2017-06-20 09:28:09 -07:00
nodepool-base Use conf.d for unbound on DIBs 2017-06-21 04:58:14 -04:00
openstack-repos Remove prepare-node element 2017-05-29 18:16:12 -04:00
zuul-worker Always add zuul group to zuul user 2017-04-28 10:14:59 +02:00
README.rst Update doc to have 'debootstrap' dep and describe minimal 2016-10-12 19:27:05 -07:00

Using diskimage-builder to build devstack-gate nodes

In addition to being able to just download and consume images that are the same as what run devstack-gate, it's easy to make your own for local dev or testing - or just for fun.

Install diskimage-builder

Install the dependencies:

sudo apt-get install kpartx qemu-utils curl python-yaml debootstrap

Install diskimage-builder:

sudo -H pip install diskimage-builder

Build an image

Building an image is simple, we have a script!

bash tools/build-image.sh

See the script for environment variables to set distribution, etc. By default it builds an ubuntu-minimal based image. You should be left with a .qcow2 image file of your selected distribution.

Infra uses the -minimal build type for building Ubuntu/CentOS/Fedora. For example: ubuntu-minimal.

It is a good idea to set TMP_DIR to somewhere with plenty of space to avoid the disappointment of a full-disk mid-way through the script run.

While testing, consider exporting DIB_OFFLINE=true, to skip updating the cache.

Mounting the image

If you would like to examine the contents of the image, you can mount it on a loopback device using qemu-nbd.

sudo apt-get install qemu-utils
sudo modprobe nbd max_part=16
sudo mkdir -p /tmp/newimage
sudo qemu-nbd -c /dev/nbd1 /path/to/devstack-gate-precise.qcow2
sudo mount /dev/nbd1p1 /tmp/newimage

or use the scripts

sudo apt-get install qemu-utils
sudo modprobe nbd max_part=16
sudo tools/mount-image.sh devstack-gate-precise.qcow2
sudo tools/umount-image.sh

Other things

It's a qcow2 image, so you can do tons of things with it. You can upload it to glance, you can boot it using kvm, and you can even copy it to a cloud server, replace the contents of the server with it and kexec the new kernel.