Building in the Open Build Service ================================== .. note:: **Abstract** This document gives a brief overview how to build images with {kiwi} in version |version| inside of the Open Build Service. A tutorial on the Open Buildservice itself can be found here: https://en.opensuse.org/openSUSE:Build_Service_Tutorial The next generation {kiwi} is fully integrated with the Open Build Service. In order to start it's best to checkout one of the integration test image build projects from the base Testing project `Virtualization:Appliances:Images:Testing_$ARCH:$DISTRO` at: https://build.opensuse.org For example the test images for SUSE on x86 can be found `here `__. Advantages of using the Open Build Service (OBS) ------------------------------------------------ The Open Build Service offers multiple advantages over running {kiwi} locally: * OBS will host the latest successful build for you without having to setup a server yourself. * As {kiwi} is fully integrated into OBS, OBS will automatically rebuild your images if one of the included packages or one of its dependencies or {kiwi} itself get updated. * The builds will no longer have to be executed on your own machine, but will run on OBS, thereby saving you resources. Nevertheless, if a build fails, you get a notification via email (if enabled in your user's preferences). Differences Between Building Locally and on OBS ----------------------------------------------- Note, there is a number of differences when building images with {kiwi} using the Open Build Service. Your image that build locally just fine, might not build without modifications. The notable differences to running {kiwi} locally include: * OBS will pick the {kiwi} package from the repositories configured in your project, which will most likely not be the same version that you are running locally. This is especially relevant when building images for older versions like SUSE Linux Enterprise. Therefore, include the custom appliances repository as described in the following section: :ref:`obs-recommended-settings`. * When {kiwi} runs on OBS, OBS will extract the list of packages from :file:`config.xml` and use it to create a build root. In contrast to a local build (where your distributions package manager will resolve the dependencies and install the packages), OBS will **not** build your image if there are multiple packages that could be chosen to satisfy the dependencies of your packages [#f1]_. This shows errors like this: .. code:: bash unresolvable: have choice for SOMEPACKAGE: SOMEPAKAGE_1 SOMEPACKAGE_2 This can be solved by explicitly specifying one of the two packages in the project configuration via the following setting: .. code:: bash Prefer: SOMEPACKAGE_1 Place the above line into the project configuration, which can be accessed either via the web interface (click on the tab ``Project Config`` on your project's main page) or via ``osc meta -e prjconf``. .. warning:: We strongly encourage you to remove your repositories from :file:`config.xml` and move them to the repository configuration in your project's settings. This usually prevents the issue of having the choice for multiple package version and results in a much smoother experience when using OBS. * By default, OBS builds only a single build type and the default profile. If your appliance uses multiple build types, put each build type into a profile, as OBS cannot handle multiple build types. There are two options to build multiple profiles on OBS: 1. Use the `` element and add it bellow the XML declaration (``): .. code:: xml