Contents
Community Build System
CBS is a community build system for SpecialInterestGroup members. It allows to build packages with Koji against CentOS5, CentOS6 and CentOS7.
Quickstart
1. Signing up for an account
Visit the Accounts System
- Select 'New Account'
- Fill out the form with your information
- Apply for membership in the SIG Group you wish to contribute to
The administrators will work with the SIG members to finalize sponsorship requests every Monday shortly before the CBS Meeting
When approved, you will need to install the client tools and generate your SSL Certificate, see HowTos/CentosPackager for details.
Execute cbs moshimoshi and you should see your username in the answer.
BONUS: (unsupported) auto completion for zsh and bash users available from Github (Please note bash completion has been updated recently while zsh is older. wink wink)
2. Getting Help
There are a number of ways to get help if you're having trouble with CBS:
- Join #centos-devel on the Libera.chat IRC Network
Post a message to the centos-devel@centos.org mailing list
File a bug at https://bugs.centos.org (Project: Buildsys, Category: community buildsys)
RPM 101
- A quick reminder on RPM terminology:
{{{SRPM=ksh-20120801-10.el6.4.src.rpm NAME=ksh VERSION=20120801 RELEASE=10.el6.4 DISTTAG=el6 }}}
Koji 101
Koji has a few easy concepts that need to be well understood:
a tag: It can be a buildroot definition tag (<SIGNAME><MAJOR>-<PROJECT>-<PROJECT-RELEASE>-<TAG>-build, storage7-gluster-37-el7-build), or a destination tag (<SIGNAME><MAJOR>-<PROJECT>-<PROJECT-RELEASE>-release or <SIGNAME><MAJOR>-<PROJECT>-<PROJECT-RELEASE>-testing).
- a target: It associates a buildroot definition tag with a destination tag.
- The target will be used on the command line when you build a srpm.
By default all successfully built packages are going to <SIGNAME><MAJOR>-<PROJECT>-<PROJECT-RELEASE>-testing.
A target has a structure within CBS: <SIGNAME><MAJOR>-<PROJECT><PROJECT-RELEASE>-<DISTTAG> e.g: virt6-xen-44-el6, storage7-gluster-37-el7, storage7-gluster-37-el7.centos, etc...
- The target will be used on the command line when you build a srpm.
- a package: The name of a source rpm. e.g: ksh-20120801-10.el6.4.src.rpm
- a build of a package: This refers to the entire build generated by koji. e.g: ksh-20120801-10.el6_5.4.rpm, ksh-20120801-10.el6.4-devel.rpm, etc...
- the action of tagging: You can tag a build to different destination tags. It may be used in a CBS workflow to promote a package from -testing to -release for example.
Building with CBS
Let's consider in the following documentation that our sig is call "bananas". Please replace it with your sig name but the "bananas" tags have been created as a playground, so you can experiment.
1. Scratch builds
Koji gives you the option to use any target and build a scratch package.
cbs build --scratch bananas6-el6 ksh-20120801-10.el6.4.src.rpm
2. Standard builds
- The first step, when you build a new package, is to allow the package on the destination tag you would like
cbs add-pkg --owner "username" bananas6-testing ksh cbs add-pkg --owner "username" bananas6-release ksh
This action is done once per package, per sig.
- Then you can start to build:
cbs build bananas6-el6 ksh-20120801-10.el6.4.src.rpm
3. Adding existing builds to a tag
Sometimes you want to build a package but you get an error message like this:
GenericError: Build already exists (id=1231, state=COMPLETE): {'name': '$pkgname'..... lot of details ....}
This means that you have added the package to a destination tag (through the "cbs add-pkg" command, see above) but when you tried to build the package, it was already built with the same NVR through koji but probably in a different tag. So, instead of building it again, koji simply refuses to rebuild a package already built with the same NVR. The simple solution is just to "tag" that build so that it appears in your tag repo automatically. Let's suppose that package name is yaml-cpp and that yaml-cpp-0.5.1-6.el7 was already built (you can use the search operation in koji to see who built it and in which tag).
cbs tag-build bananas7-testing yaml-cpp-0.5.1-6.el7
Kojira will then regenerate the repodata, this time including that already built package.
4. Git builds
A quick example:
cbs add-pkg --owner "username" bananas7-testing tzdata cbs add-pkg --owner "username" bananas7-release tzdata cbs build bananas7-el7 "git+https://git.centos.org/git/rpms/tzdata.git?#e24d98"
Common error messages
1. pkg already built case
GenericError: Build already exists
See the "Adding existing builds to a tag" paragraph above
2. Expired certificate
If you see this error message :
"Error: [('SSL routines','SSL_shutdown', 'shutdown while in init')]
It can be that your ~/.centos.cert x509 certificate has expired. You can confirm this with the following command :
openssl x509 -in ~/.centos.cert -noout -text|grep "Not After"
If it has expired, you can just regenerate a new certificate with centos-cert (as described in Step 2 on https://wiki.centos.org/HowTos/CentosPackager)
3. Using old SSLv3
If you see this error message:
Error: [('SSL routines', 'SSL3_READ_BYTES', 'sslv3 alert handshake failure'), ('SSL routines', 'SSL3_WRITE_BYTES', 'ssl handshake failure')]
Then you need to manually patch your koji instance to use TLSv1 rather than SSLv3 (which has been proven to be insecure).
Advanced configuration
1. Using multiple koji instances
Koji support profiles with the -p flag. We define a profile called 'cbs' (which is why you are able to use the convenience command: /usr/bin/cbs)
- To use a profile from the generic koji command line you can run:
koji -p cbs list-tags
- You can then keep your Fedora config or other koji instance configured in parallel.
- The default server without specifying "-p" should go in [koji] section as it is done in the default config.
Known issues
- Building from git.c.o is not yet enabled.
External Links
Official doc: https://fedoraproject.org/wiki/Koji