[openstack-dev] [Ironic] Buildroot deploy image POC ready for testing
Chris Smart
mail at csmart.io
Tue Apr 18 06:18:55 UTC 2017
Hi all,
Over the last couple of months I have been working on creating a
smaller, more flexible deploy image for Ironic. It is now ready for
testing, if anyone is interested.
For this proof of concept I chose Buildroot [1], a well regarded, simple
to use tool for building embedded Linux images. The builds are done as a
regular non-root user and it has a menuconfig system (like the Linux
kernel) for customising the build. It supports caching of downloads and
ccache for builds.
With the current default configuration:
* Linux kernel is ~2MB
* Compressed initramfs image is ~25MB
* Bootable ISO image ~26MB
* Passing the OpenStack Ironic gating tests [2]
* Highly customisable (thanks to Buildroot)
All of the source code for building the image is up on my GitHub account
in the ipa-buildroot repository. [3]
I have also written up documentation which should walk you through the
whole build and customisation process. [4]
The ipa-buildroot repository contains the IPA specific Buildroot
configurations and tracks upstream Buildroot in a Git submodule
(actually I'm carrying one patch on top of Buildroot for now, but the
goal is to use pristine upstream Buildroot).
*In addition to this* I also have patches for ironic-python-agent on my
GitHub account that adds support for Buildroot to imagebuild. [5]
This will handle the dependencies, customisation and build of the
Buildroot Ironic image using make (like we do with tinyipa and coreos).
Using the ironic-python-agent repo is as simple as:
$ git clone https://github.com/csmart/ironic-python-agent.git
$ cd ironic-python-agent/imagebuild/buildroot
$ make help
$ # or
$ ./build-buildroot.sh --help
Buildroot will compile the kernel and initramfs, then post build scripts
clone the Ironic Python Agent repository (which defaults to upstream but
you can specify the repo and commit) and creates Python wheels to
install into the target.
Customising the build is pretty easy, too:
$ make menuconfig
$ # do buildroot changes
$ make
I created the kernel config from scratch (using tinyconfig) and
deliberately tried to balance size and functionality. It should boot on
most Intel based machines (BIOS and UEFI), however hardware support like
hard disk and ethernet controllers is deliberately limited (see kernel
config [6]). The goal was to start small and add more support as needed.
Customising the Linux kernel is also pretty easy, though:
$ make linux-menuconfig
$ # do kernel changes
$ make
Each time you run make, it'll pick up where you left off and re-create
your images.
Really happy for anyone to test it out and answer any questions you
have.
Many thanks!
Chris
[1] https://buildroot.uclibc.org/
[2] https://review.openstack.org/#/c/445763/
[3] https://github.com/csmart/ipa-buildroot
[4]
https://github.com/csmart/ipa-buildroot#openstack-ironic-python-agent
[5]
https://github.com/csmart/ironic-python-agent/tree/buildroot/imagebuild/buildroot
[6]
https://github.com/csmart/ipa-buildroot/blob/master/buildroot-ipa/board/openstack/ipa/linux-4.10.6.config
More information about the OpenStack-dev
mailing list