Project

General

Profile

OBS Maintenance » History » Revision 18

Revision 17 (osmith, 03/14/2023 10:00 AM) → Revision 18/30 (osmith, 03/14/2023 10:01 AM)

h1. OBS Maintenance 

 {{>toc}} 


 The Osmocom [[binary packages]] are built with [[OBS]] (Open Build Service) hosted on "obs.osmocom.org":https://obs.osmocom.org. In order to do that, the jenkins jobs "Osmocom_OBS_latest":https://jenkins.osmocom.org/jenkins/job/Osmocom_OBS_latest_obs.osmocom.org/ / "_nightly":https://jenkins.osmocom.org/jenkins/job/Osmocom_OBS_nightly_obs.osmocom.org/ ("config":https://gitea.osmocom.org/osmocom/osmo-ci/src/branch/master/jobs/osmocom-obs.yml) checkout the source repositories and build debian *source* packages, then upload these to OBS. 

 h2. Install osc 

 Get the command-line client for managing OBS. When using for the first time, it will ask for the credentials. 

 <pre> 
 $ sudo apt install osc 
 $ osc ls 
 </pre> 

 h2. Upgrading specific packages 

 h3. eclipse-titan 

 See the article [[upgrading eclipse-titan in the Osmocom OBS]]. 

 h3. nftables / libnftnl 

 As of writing, the nftables and libnftnl packages from the Osmocom OBS are linked to openSUSE.org:security:netfilter. When the package gets upgraded there, the build will fail in the Osmocom OBS with: 

 <pre> 
 [     29s] error: Bad source: /home/abuild/rpmbuild/SOURCES/libnftnl-1.2.4.tar.bz2: No such file or directory 
 </pre> 

 That is because the source tarballs get upgraded, but the spec file has differences and so it does not get upgraded automatically. 

 Diff the "upstream spec file":https://build.opensuse.org/package/view_file/security:netfilter/libnftnl/libnftnl.spec?expand=1 against the one in the Osmocom OBS and apply the changes, then it should work again. 

 <pre> 
 $ $EDITOR /tmp/upstream.spec    # put the upstream spec file here 
 $ mkdir /tmp/obs 
 $ cd /tmp/obs 
 $ osc co osmocom:nightly libnftnl 
 $ cd osmocom:nightly/libnftnl 
 $ diff libnftnl.spec /tmp/upstream.spec 
 $ $EDITOR libnftnl.spec    # apply changes 
 $ diff libnftnl.spec /tmp/upstream.spec    # verify 
 $ osc commit 
 $ rm -rf /tmp/obs 
 </pre> 

 Wait until the package has built, then copy it to the other feeds: 
 <pre> 
 $ osc copypac osmocom:nightly libnftnl osmocom:latest 
 $ osc copypac osmocom:nightly libnftnl osmocom:master 
 </pre> 

 Eventually the nftables version >= 1.0.2 that osmo-upf requires should make it into the distributions we support, at which point we can remove the nftables and libnftnl packages. this package. 

 h2. Workflow for testing OBS configurations 

 OBS has a "project configuration":https://en.opensuse.org/openSUSE:Build_Service_prjconf, which may need to be adjusted to state preferred dependencies for example. Before we apply project configurations to the official Osmocom OBS projects, we can test them in our own OBS project. Copy the relevant package first (adjust the username accordingly in all following examples): 

 <pre> 
 $ osc copypac osmocom:nightly osmo-gsm-manuals home:osmith42 
 </pre> 

 Visit the site in your browser: 
 * https://obs.osmocom.org/package/show/home:osmith42/osmo-gsm-manuals 

 Set up build targets: 
 * https://obs.osmocom.org/project/add_repository_from_default_list/home:osmith42 

 The package should get added to the queue already. 

 Open your project config next to the osmocom:nightly one: 
 * https://obs.osmocom.org/project/prjconf/home:osmith42 
 * https://obs.osmocom.org/project/prjconf/osmocom:nightly 

 First copy everything from the Osmocom project over to your own project. Then make changes to your config, until the builds are working as expected (dependency problems are resolved etc.). Whenever you change the config, OBS will immediately re-evaluate the build dependencies, no need to upload the source packages again. 

 When everything works as expected, copy the config changes you have made to the Osmocom project (nightly and latest). 

 Note that changing osmocom's project config did not seem to have any effect. It seems that we really must change both @osmocom:nightly@ and @osmocom:latest@ instead. 

 h2. Workflow for modifying packages 

 h3. (Optional) modify the debian dir 

 * clone the source git repository 
 * make changes to the debian dir 
 * commit your changes 
 * push to a "user/..." branch 

 h3. Build source packages and upload to your own OBS project 

 * clone osmo-ci.git 
 * open "osmo-nightly-packages.sh":https://gitea.osmocom.org/osmocom/osmo-ci/src/branch/master/scripts/osmocom-nightly-packages.sh 
 * if you intend to make changes to the script, do them and commit the changes 
 * change "PROJ":https://git.osmocom.org/osmo-ci/tree/scripts/osmocom-nightly-packages.sh?id=dc5fc51c1fa76e64db774ecb9e71fc25ad6c46cd#n10 to home:USERNAME 
 * if you made changes to the debian dir, insert your branch name after the related "checkout line":https://git.osmocom.org/osmo-ci/tree/scripts/osmocom-nightly-packages.sh?id=dc5fc51c1fa76e64db774ecb9e71fc25ad6c46cd#n172 (e.g. <code>checkout osmo-gsm-manuals osmith/some-random-change</code>) 
 * run osmocom-nightly-packages.sh 
 * check in your browser if all packages have been built by OBS as expected (iterate until you get everything right) 

 When everything works fine, contribute your patches with [[Gerrit]] as usually. 

 h2. Troubleshooting 

 h3. Debian dir doesn't work for multiple debian versions 

 Following what has been done for osmo-trx: 
 * create the debian dir to work with the latest debian stable 
 * create a patch that would make it work with an earlier release (debian 8) and save it as debian/patches/build-for-debian8.patch 
 * adjust the osmocom-*-packages.sh scripts to upload a second debian source package, which has the patch applied 
 * configure OBS to build the patched package only for the older debian releases, and the unpatched package only for the stable release 

 h3. Package is not resolvable 

 <pre> 
 have choice for jadetex needed by docbook-utils: jadetex texlive-formats-extra 
 </pre> 

 You'll need to adjust the OBS project configuration (mind the testing workflow above): 
 <pre> 
 Prefer: texlive-htmlxml 
 </pre> 

 h3. Reproduce the nightly builds locally 

 <pre> 
 $ osc co 
 $ osc build 
 </pre> 

 h2. E-Mail Notifications of build failures 

 Build failure notifications are sent to the "gerrit-log mailing list":https://lists.osmocom.org/mailman/listinfo/gerrit-log 

 h2. See also 

 * https://en.opensuse.org/Portal:Build_Service 
 * https://en.opensuse.org/openSUSE:Build_Service_prjconf
Add picture from clipboard (Maximum size: 48.8 MB)