Skip to content

Building packages

Working with git

SIG members can push SIG branches to any repo under git.centos.org. SIG branch names need to prefixed with c8s-sig-hyperscale. Currently we’re using:

  • c8s-sig-hyperscale: stuff meant to go in the main repository
  • c8s-sig-hyperscale-experimental: stuff meant to go in the experimental repository
  • c8s-sig-hyperscale-spin: stuff meant to go in the spin repository

To create a new package file a ticket on https://pagure.io/centos-infra/. Before doing that, think about whether you actually need a new package in CentOS proper, or whether you can use Fedora/EPEL instead.

To clone an existing package:

$ git clone ssh://git@git.centos.org/rpms/systemd.git

To make a new empty SIG branch (you can also branch c8s if you prefer starting from the existing packaging):

$ git checkout --orphan c8s-sig-hyperscale

If you need to add new source tarballs:

$ lookaside_upload -f systemd-246.1.tar.gz -n systemd -b c8s-sig-hyperscale

to push them to lookaside, then update gitignore and metadata (example: https://git.centos.org/rpms/systemd/c/482fd4b94ecc46dc4cfa4b2f8f2ddbe11535bc31?branch=c8s-sig-hyperscale)

lookaside_upload comes from https://git.centos.org/centos-git-common and requires a valid CentOS certificate.

To do a local test build

$ mock -r centos-stream-8-x86_64 --sources ./SOURCES --spec ./SPECS/*.spec

Build tags

All our build tags set the %centos_hs macro 1, so that we can gate Hyperscale-specific behavior in package specs if needed.

We have two main build tags:

  • hyperscale8s-packages-main-el8 -- our default build tag, if you're not sure, this is probably what you want to use; packages built here will have %dist set to .hs.el8
  • hyperscale8s-packages-experimental-el8 -- use this when building for experimental; this tag does not inherit from main, and packages build here will have %dist set to .hsx.el8

There are three additional special purpose tags:

  • hyperscale8s-packages-facebook-el8 -- same as main, but with %facebok set to 1 and %dist set to .hs+fb.el8; meant for Facebook-flavored builds, currently only used for systemd
  • hyperscale8s-packages-hotfixes-el8 -- do not use, use main instead
  • hyperscale8s-packages-spin-el8 -- use this when building for packages for spin that should not be in the main buildroot; prefer using main whenever possible

Destination tags

For each build tag, we have three destination tags:

  • ${tag}-candidate - regular builds end up here by default and will be included in the buildroot for subsequent builds
  • ${tag}-testing - builds tagged here end up on buildlogs.centos.org
  • ${tag}-release - builds tagged here end up on mirrors.centos.org

where ${tag} would be something like hyperscale8s-packages-main, leading to a destination tags like hyperscale8s-packages-main-release, which will end up in /centos/8-stream/hyperscale/${arch}/packages-main.

Destination tags are orthogonal to build tags: you can tag any build into any destination tag (though, obviously, some combinations won't make much sense). Common workflows:

  • when building for main, tag into main; likewise, when building for experimental tag into experimental
  • when building non-modular packages that replace modular packages (e.g. libvirt), tag them into hotfixes instead of main (but still do the builds in main)
  • when building spin-specific packages that should only be used on spin installs, tag them into spin destination tags.

Note that you won't be able to tag into a destination tag unless it's been registered to the tag first with cbs add-pkg; likewise, packages can be unregistered from tags with cbs remove-pkg.

Working with cbs

To run a scratch build from git:

$ cbs build --scratch hyperscale8s-packages-main-el8 "git+https://git.centos.org/rpms/systemd.git#$(git rev-parse HEAD)"

To run a real build, the package needs to be registered to a destination tags first:

$ cbs add-pkg --owner=dcavalca hyperscale8s-packages-main-candidate systemd
$ cbs add-pkg --owner=dcavalca hyperscale8s-packages-main-testing systemd
$ cbs add-pkg --owner=dcavalca hyperscale8s-packages-main-release systemd

This only needs to be done once per package.

To kickoff a build:

$ cbs build hyperscale8s-packages-main-el8 "git+https://git.centos.org/rpms/systemd.git#$(git rev-parse HEAD)"

To publish to buildlogs.centos.org:

$ cbs tag-build hyperscale8s-packages-main-testing systemd-246.1-2.hs.el8
Back to top