Commit Graph

459 Commits

Author SHA1 Message Date
Oliver Smith 82ff45e7f7 repo-install-test: add debian12
Related: OS#6057
Change-Id: I51fa3c5212b5e29f4c2804384781693e8de2c097
2023-08-03 11:03:58 +02:00
Oliver Smith 592c48ac76 scripts/jenkins-gerrit: sort jobs list
Having two debian entries in there in random order looks weird so sort
the job lists.

Change-Id: I795f821783b52a6a9cd1967d33f67b656efccf22
2023-07-31 08:22:09 +00:00
Oliver Smith 56b1633d8b scripts/jenkins-gerrit: make assert more verbose
Change-Id: I0ea40663220f7eb8ee72e43f3f6b776be5835db2
2023-07-31 08:22:09 +00:00
Oliver Smith 1dcb49a811 jobs/gerrit-binpkgs: don't hardcode distros
Make it possible to set a list of distributions to check in
gerrit-verifications.yml instead of only having one boolean for testing
two hardcoded rpm and deb distributions.

Change-Id: I59487e3dc2f55057de1b6a322f088fff0d18654c
2023-07-31 08:22:09 +00:00
Oliver Smith bd763747ad jobs/gerrit: refactor pipeline script
* Deduplicate the code to run a job by moving it to a function.
* Print the status of jobs right after they finished, instead of waiting
  until all jobs are done
* Make the status print messages more readable

Change-Id: I641a5b483721ce2bbf21bd61d8f4e83faf94ac24
2023-07-31 08:22:09 +00:00
Oliver Smith f71fceff65 jobs: master/gerrit: use debian bookworm (12)
Upgrade from debian 11 for master and debian 10 for gerrit
verifications to using debian 12 for both.

Previously we intentionally built against the older debian 10 version
to ensure that our programs still build there. However it is easier to
maintain the docker containers if we just use the most recent debian
version for both and it makes the build environment more consistent - if
a patch passes in gerrit verifications, we expect it to pass in master
builds as well. And the other way around, I can just run CI of all
master jobs when developing a change and assume that if they pass,
gerrit verifications will run as well.

As long as we provide binary packages in OBS for debian 11, 10, ... we
will still notice if a build breaks on an older debian release. I think
this is good enough given that it will probably not happen that often,
but if we decide that we really want to ensure it still builds on older
distros at gerrit-verification time then the more suitable place to add
this would be in the deb-build verification test. It is more
maintainable there, because the dependencies just get installed from the
debian/control file, no need to add all of them to a docker container
beforehand.

The new container is debian-bookworm-build, see the docker-playground
commit for reasoning why it is not debian-bookworm-jenkins.

Related: OS#6057
Depends: docker-playground I49aaf62b5b97775f923453611df3b91354a640a0
Change-Id: I079e55a1325083714c8d39f922b2563e843fc0bc
2023-07-13 14:55:23 +02:00
Oliver Smith 4afadcdddb obs: make limesuite build with debian 12
Related: OS#6057
Change-Id: Ic81dfbfa232b92e3fd9af9c5d7d0f2aca4b9879c
2023-06-22 13:25:41 +02:00
Oliver Smith 5bc3e0587a Fix failing Osmocom-release-manuals job
Add a workaround that upgrades the osmocom-nightly package before
installing build dependencies for the given package.

This is not very elegant, it would make more sense if the docker image
we use here did not have the nightly Osmocom repository configured in
the first place (as this job is about creating manuals for tagged
releases). But the image is used by jenkins build verification too and I
don't think it's a good use of time to change this right now.

Fix for:
  + apt-get -y build-dep /build
  Note, using directory '/build' to get the build dependencies
  Reading package lists...
  Building dependency tree...
  Reading state information...
  Some packages could not be installed. This may mean that you have
  requested an impossible situation or if you are using the unstable
  distribution that some required packages have not yet been created
  or been moved out of Incoming.
  The following information may help to resolve the situation:

  The following packages have unmet dependencies:
   osmo-gsm-manuals-dev : Depends: osmocom-nightly (= 202305300026) but 202305290026 is to be installed

Change-Id: If28a34d3e5b07216c5310b19623fcc42692f65c3
2023-05-30 14:01:51 +02:00
Oliver Smith cdd4eece45 data/build_rpm: force refresh of package indexes
The yum-builddep command already has a mechanism to update the package
index data if the last update (when the docker image was built) was some
time ago. However when the packages we use happened to be updated in
that timeframe, the indexes are not updated and attempting to download
them leads to 404 errors. Force refresh all package indexes to avoid
this.

Fixes: OS#6038
Change-Id: I6e2592466b6190782cdd93e00b3d5020fd665372
2023-05-19 10:14:24 +02:00
Oliver Smith 0b87eb3fbf obs: build_binpkg: ubuntu: use manuals container
Use the optimization of only installing osmo-gsm-manuals-dev and all its
dependencies once not only with debian, but also with ubuntu.

Change-Id: Ic9fef9f10b4384538e7a73479bf57a9b737a9a55
2023-05-10 12:13:33 +02:00
Oliver Smith 106120cace obs: build_binpkg: add feed argument
Make it possible to configure a different feed than master inside the
docker container that gets used to build the packages. This way we can
build ubuntu packages against nightly.

We don't build the Osmocom packages in the master feed for Ubuntu as we
rarely have a build error that only happens on ubuntu. With this patch,
it can be easily reproduced if it happens.

Change-Id: Ibc27459815f26e8c691c83fe594ff84962b991f5
2023-05-10 12:13:27 +02:00
Oliver Smith 3dff9ee40c obs: build_binpkg --docker: set metavar to DISTRO
Make it obvious that the argument passed to --docker is the Linux
distribution that will be used.

$ ./build_binpkg.py -h
usage: build_binpkg.py [-h] [-d [DISTRO]] [-j JOBS] [-r] [-v] package

Change-Id: Ibf6f1a8fce7fd13795f1c25c75e14fb9eb8aa2b6
2023-05-10 11:41:11 +02:00
Oliver Smith badcf3d055 obs: support all debian/ubuntu/almalinux versions
Adjust the code so one can pass all versions, instead of hardcoding
only debian:11, ubuntu:22.04, almalinux:8. I'll use this for
reproducing a build error that happens on e.g. ubuntu:18.04.

Change-Id: Id85f5b67d144dc178d3fb23ff8e533a671473363
2023-05-10 11:41:07 +02:00
Oliver Smith 4bd8942f4d publish-manuals-for-tags: enable IU/PFCP VTY cmds
Enable configure options to build manuals with all VTY commands in the
script that builds manuals for tagged releases.

Related: OS#6013
Change-Id: I9685857348e3b38f13acc1429c7a49fb9e5d92f3
2023-04-26 10:13:10 +02:00
Oliver Smith bdbc48a372 obs: update_obs_project: add ALL_OSMOCOM_PACKAGES
Add this alias to use all Osmocom packages, but no the misc packages
that would also be selected if not specifying the packages argument at
all (limesuite, neocon, open5gs).

This will be used for building packages from the rhizomatica branches,
so we don't check the git repositories of these misc projects for the
git branches.

Related: OS#5981
Change-Id: I4265f43408bc21ac8765449d6766381c75cafe86
2023-04-06 10:59:28 +02:00
Oliver Smith ccb0dba7f3 obs: update_obs_project: add --delete arg
Add a new argument to delete packages from OBS if the git branch does
not exist anymore, but the packages still exists in OBS.

Related: OS#5981
Change-Id: Ib5ccf93a5a0cf8981fc35976bb9e0d3a29721b8d
2023-04-06 10:59:28 +02:00
Oliver Smith ff8ec46ac5 obs: add --conflict-pkgname arg
Prepare to create new feeds for the rhizomatica/testing and
rhizomatica/production branches, which will be based on osmocom:latest.
They will depend on osmocom-latest (the "conflict package"/meta
package), even though their feed name is not latest.

Related: OS#5981
Change-Id: I58e33bb003e2a4af9e9a7b53e5f79a91c3b541eb
2023-04-06 10:58:40 +02:00
Oliver Smith 78ca65b5d3 obs: wireshark: user proper OBS api url
Set the proper https://obs.osmocom.org api URL, not "obs.osmocom.org".
The latter only works on jenkins because we have set up an alias there,
but not locally without setting up the same alias.

Change-Id: I663ba4f137a57890ba9a2079ef3453bb7544de8b
2023-04-05 09:51:35 +00:00
Oliver Smith 4427bd1b42 scripts/manuals: fix missing UserKnownHostsFile
Fix for:
  :: Listing files on server: /docs
  Host key verification failed.

Related: OS#5902
Change-Id: I485e2268eec50f46ed0436d4b3a5cedfab20af96
2023-03-24 10:43:17 +01:00
Oliver Smith f9a7f1e893 jobs/osmocom-release-manuals: add new job
Add a jenkins job that automatically builds manuals for release tags, if
they don't exist on the server already.

Closes: OS#5902
Related: https://downloads.osmocom.org/docs/
Change-Id: I0ecb238660553c3c857e1b310873eca8a8d09dab
2023-03-23 10:48:30 +00:00
Oliver Smith 937425179d obs: wireshark: remove laforge/amr-2023 branch
Remove it, as the AMR patches have been upstreamed \o/

Related: https://gitlab.com/wireshark/wireshark/-/merge_requests/10025
Change-Id: I7f3f06bc5390ffac9b3760035831ae17d28b744e
2023-03-22 12:02:12 +01:00
Oliver Smith b55b11d671 obs: build_binpkg: add ubuntu 22.04
Add it for debugging a build failure that we only saw on Ubuntu.

Related: OS#5946
Change-Id: I4a927447d8f8b89411b93c563fbc6aa8d4998ffa
2023-03-22 09:30:53 +00:00
Oliver Smith 24f3e088dc scripts/docker-rebuild: add debian-bullseye-jenkins-arm
Prepare to let all master-builds jobs use debian-bullseye instead of
debian-buster.

Depends: docker-playground I8e1741f86ffb8abd658d1e4e0415dfd11fb1a8a1
Related: OS#5949
Change-Id: I55bd5869ecd753549b8f2f2822e825623d940acd
2023-03-21 16:48:50 +01:00
Oliver Smith e7eba15315 jobs: add Osmocom_OBS_wireshark
Add a nightly jenkins job that does the following:
* Clone Wireshark from upstream
* Merge several Osmocom branches on top
* Build a source package
* Submit it to the osmocom:wireshark OBS project

Related: OS#2537
Change-Id: Ifb49c5cb22a4de0da30a920e5450a27172b11d73
2023-03-17 11:33:55 +01:00
Oliver Smith 1ab4ce32f9 obs: add --version-append argument
Related: OS#2537
Change-Id: Iff5a530bebd645be13e0206ce0a670e1dfe6e2f9
2023-03-17 11:33:55 +01:00
Oliver Smith dc1415959f obs: add --allow-unknown-package
Prepare to add a wireshark package. It will be in its own
osmocom:wireshark repository, and not in osmocom:nightly, :latest,
:master, so it's not added to lib/config.py.

Move lib.set_args() before parse_packages(), so the latter is able to
use lib.args.allow_unknown_package.

Related: OS#2537
Change-Id: I007f937ccb629e0593ec9253541ed05df42fac66
2023-03-17 11:33:55 +01:00
Oliver Smith 3ccebc4514 obs: srcpkg.build: fix conflict_version regression
During refactoring, conflict_version was changed to version here, which
was wrong. The packages need to depend on the conflict_version of the
meta package, version is the version of the package itself.

Fix for:
  The following packages have unmet dependencies:
   libosmo-netif-dev : Depends: osmocom-nightly (= 202303160009) but it is not going to be installed
                       Depends: libosmocore but it is not going to be installed
                       Depends: libosmonetif11 (= 1.3.0.8.9e65.202303160009) but it is not going to be installed
   libosmocore-dev : Depends: osmocom-nightly (= 1.8.0.79-b394d.202303170006) but it is not going to be installed
                     Depends: libosmocore but it is not going to be installed

Fixes: 0ed0e464 ("obs: don't pass conflict_version through functions")
Change-Id: I2326e3817c6f6887ef1196e603c3877768119a66
2023-03-17 11:33:45 +01:00
Oliver Smith 8d137c66a7 obs: add --git-skip-checkout argument
Prepare to use this for wireshark, to build a branch on-the-fly that
does not get pushed to origin, with Osmocom patches on top of upstream
master.

Related: OS#2537
Change-Id: Ifc963daf51ba3542f67420daaf7b29745404a92e
2023-03-15 18:25:52 +01:00
Oliver Smith f7ff90d64b obs: don't pass skip_up_to_date through functions
Change-Id: Ide0c1f5452f5ce965541b45039345abc52b3d140
2023-03-15 18:25:52 +01:00
Oliver Smith 78cd3a3c75 obs: don't pass meta through functions
Change-Id: Ieb49e5f8630e3e918b11a7a225febbbcee2e82b3
2023-03-15 18:25:52 +01:00
Oliver Smith 372b33a582 obs: don't pass fetch through functions
Change-Id: I0689868db6fadaaaca470cdefbf60ceedc2eb225
2023-03-15 18:25:52 +01:00
Oliver Smith 0ed0e46421 obs: don't pass conflict_version through functions
Change-Id: I3d712e94d56269c49ee5baecfee1fa9f35101488
2023-03-15 18:25:52 +01:00
Oliver Smith 06f7482a7e obs: don't pass branch through functions
Change-Id: I9ec6d04c51bc795dd9cd4738313e60a556791eb2
2023-03-15 18:25:52 +01:00
Oliver Smith dd36e9f489 obs: don't pass feed through functions
Change-Id: I9124d33c45ef3fef48666b485fd169eec0eb393a
2023-03-15 18:25:52 +01:00
Oliver Smith e4313bc6b7 obs: don't pass proj through functions
Change-Id: Id213ae155f34c74529845ff86468b68ffa6ffb1d
2023-03-15 18:25:52 +01:00
Oliver Smith 9337c6c035 obs: lib.args: store argparse result here
Prepare to add more arguments to the OBS scripts, so they can be used
for building the wireshark package in its own OBS project.

It was not so clear to me when writing this initially, but with more and
more arguments getting added: it's not very maintainable to pass each
variable from the argparse result several functions down to where it
gets used... so unfortunately this means the code needs to be refactored
to just use libs.args in the few lines of code where the arguments
actually get used.

This patch adds lib.args, and the next patches refactor existing code to
use it instead of passing parameters, where it makes sense. After that
follow the patches related to adding the wireshark package.

Related: OS#2537
Change-Id: I48853444f1386dfb842c174ebc45f9decc8bec0f
2023-03-15 18:20:21 +01:00
Oliver Smith 3e5c5d4a75 build-old-tags: tags_to_ignore: add osmo-hlr
Add the osmo-hlr releases where tests are not foward-compatible to the
related libosmocore change. Fixup releases 1.6.1 and 1.5.1 have been
made that are foward compatible.

Related: libosmocore I446e54d0ddf4a18c46ee022b1249af73552e3ce1
Change-Id: Ia772c9e823e494fdfce179da58735d3e6cee8e95
2023-02-23 12:23:42 +01:00
Oliver Smith 4170c2b71e jobs/gerrit: start endianness job in pipeline
Related: OS#5884
Change-Id: Ib84a51aa8465cf513cb2e4b31121a04760f688e9
2023-02-20 17:27:03 +01:00
Oliver Smith 51748a77a7 jenkins-gerrit: make links clickable again
After gerrit was upgraded, the comment formatting changed. Links inside
blocks indented with two spaces cannot be clicked anymore, so change it
to a listing.

Change-Id: I4dc338c22e9afe4b9d9df845c6f5d9b3a91f93d9
2023-02-20 11:27:37 +01:00
Oliver Smith 6dcd1360ff repo-install-test: run uname -a
Print the kernel version running inside the VM.

Change-Id: Ic111ac8eda11c5609ec6ce7cf8a22584d32ed567
2023-02-13 12:30:58 +01:00
Oliver Smith 378abe1844 repo-install-test: add DOMAIN variable
Allow overriding the downloads.osmocom.org domain of the url where
packages are downloaded from, so we can download them from
people.osmocom.org instead while developing / debugging, e.g.:
  https://people.osmocom.org/packages/home:/osmith:/nightly/

Change-Id: I36bc0eae9fdee75512c1dbdca84cd6224b8c192a
2023-02-13 12:30:58 +01:00
Oliver Smith 6e945b50c3 repo-install-test: update tests for e1d/ggsn/pfcp
Disable workarounds for OS#5817, where packaging bugs have been fixed.

Change-Id: I2452993abc1c0fe78bef464f1a62fe578b48016b
2023-02-13 12:30:55 +01:00
Oliver Smith b31d480ed6 repo-install-test: adjust to 2023-02 releases
Change-Id: Ic1d912efbe504b6e35b59e31d12b983b9d924355
2023-02-13 11:56:12 +01:00
Oliver Smith e3f0badc7d repo-install-test: disable osmo-upf service check
Don't check the osmo-upf service until it's fixed, so we don't miss
other errors that repo-install-test may find.

Related: OS#5905
Change-Id: I970cad1bdb4586afa8ba5b4dac31bb9ac02b7b2d
2023-02-13 11:56:12 +01:00
Oliver Smith 7f0060ae70 obs: git.py: fix f-string
Change-Id: Iaaedf019012d77e4a385054532d1d10659ef8e76
2023-02-08 16:25:22 +01:00
Harald Welte 8abf46760a coverity: Add many missing projects
Add the following projects to our coverity test job:
  osmo-pcap
  osmo-e1d
  osmo-e1-recorder
  osmo-upf
  osmo-isdntap
  osmo-uecups
  osmo-remsim

Change-Id: Idee49aa4c15fcfb1a469db9e4978523af5608d70
2023-01-31 13:29:48 +01:00
Oliver Smith c914967c53 jobs/master,gerrit: use minimal image for arm
Building debian-buster-jenkins on the raspberry pis may take > 1h,
depending on what changed. It has a lot of things we don't use, so build
and use a minimal image with the rpis instead.

Closes: OS#5863
Depends: docker-playground I4fb4b48b233acaef815c4c27ec6f17f12cfe836b
Change-Id: I73e62fbbf93824c0d37963039de4e00f26a43cbe
2023-01-24 08:04:54 +00:00
Oliver Smith 989c47bc91 scripts/osmo-build.sh / ARTIFACT_STORE: remove
This script was supposed to cache already built Osmocom libraries. But
it was only used with openbsc, didn't work as expected anymore (looking
at openbsc-master, it just builds all deps from source without caching)
and will be replaced with logic that allows using ccache in a future
patch.

Using ccache has the big advantage that we can cache all build objects
where the source files did not change, and not just do it on a
dependency level. Oftentimes only few source files change in our
patches, so we can really cache everything else that is not affected
within any git repository and not just a dependency that didn't change.

ccache also does automatic cache size management to ensure a cache stays
within a given size limit.

Related: OS#5848
Depends: openbsc Ib3272feec76b30412ca60dec204255b64e33831b
Change-Id: Id94d6126b476077d57839e4a884621b8c034f0c6
2023-01-23 13:31:08 +00:00
Oliver Smith 9f1889a494 jobs/gerrit-verifications: post comment on start
Post a link to gerrit when starting the build that contains the link to
the pipeline, without sending mail notifications.

This is useful when a gerrit verification build takes rather long, and
it's not clear if a build for gerrit verification was actually started
or not. Also I find this useful when debugging the CI scripts.

Change-Id: I75c5b8874f606739ff557ff0711bb9449a2b4259
2023-01-18 12:35:34 +00:00
Oliver Smith ed604a0bb3 jobs/gerrit-verifications-comment: rename
Rename the jenkins job from gerrit-pipeline-result to
gerrit-verifications-comment, as the next patch will not only use this
job to post a comment at the end of the gerrit verification, but also at
the beginning when the pipeline starts.

Give the pipeline_summary* scripts more generic names as well.

Change-Id: I1b947522aa5f2bb21f5e438db9df3420c998f1bc
2023-01-18 12:35:34 +00:00
Harald Welte 0334fe327e obs: add 2023q1
Change-Id: Id8fa36ac79a6d83d0384e629ef0b8c4db432cc0e
Related: SYS#6283
2023-01-11 21:50:20 +01:00
Oliver Smith 57a9e54524 obs: put git submodules into source packages
We started using git submodules with osmo-trx. Adjust the obs scripts
to actually make the git submodules part of the source packages.

Note that this didn't fail in jenkins before with the rpm build
verification, as jenkins updates git submodules on its own.

Fix for:
[  165s] Makefile.am:32: error: required directory ./osmocom-bb/src/host/trxcon does not exist

Change-Id: I51b423f3885d6ead5c21a83bdf8ef6051dc34fe3
2022-12-23 15:10:19 +01:00
Oliver Smith 9223287228 repo-install-test: sort centos pkgs from repoquery
Apparently the output of repoquery isn't always sorted, it started
failing on jenkins after moving the test inside qemu. Add an explicit
sort.

Fix for:
  + comm -23 osmocom_packages_all.txt blacklist.txt
  comm: file 1 is not in sorted order

Related: OS#5365
Change-Id: Icb00df102555e06b66b1c2597488b625e3c77f1c
2022-12-09 11:56:03 +01:00
Oliver Smith c551a3c297 repo-install-test: print osmocom_packages_all.txt
While I'm developing this, Jenkins is currently failing here. Make it
easier to debug this by printing the file contents.

Related: OS#5365
Change-Id: Ifbf4ca7f49c1f4441f84695aea0936515e01ffd4
2022-12-09 11:56:03 +01:00
Oliver Smith 9f68d7d370 repo-install-test: update test_binaries
Related: OS#5365
Change-Id: Iaad0260b5872d29b41a97aac3ea5ba0af81c6adb
2022-12-09 11:56:03 +01:00
Oliver Smith 36215cfff2 repo-install-test: fix osmo-trx-usrp1 check
The DISTRO variable is either debian10 or debian11, fix the broken
check. This condition is there in the first place, because we don't
build the usrp1 backend for centos8.

Change-Id: I987f27db257961faf06824df2dcc8f9db1fedccf
Related: OS#5365
2022-12-09 11:56:03 +01:00
Oliver Smith f5bd274018 repo-install-test: update services list
Add services from new projects and enable previously disabled services,
now that this test runs in qemu and services have more permissions like
setting realtime priorities.

Related: OS#5365
Change-Id: Iec7db433cac4c77226e0f1ae2ba502de0d1a8a2b
2022-12-09 11:56:03 +01:00
Oliver Smith ed2d877bc6 repo-install-test: fix check for Release.key
$release_key is not defined, replace it with the path.

Change-Id: I6bd13cc6149db1f2ba25ef1ee343115d3c53cf3b
2022-12-09 10:55:15 +00:00
Oliver Smith aae43b731f repo-install-test: add SKIP_PREPARE_VM env var
Change-Id: I96c7aef70d9d2c6318ce4e43c24450461bc00d91
2022-12-09 10:55:15 +00:00
Oliver Smith 048492d1c8 repo-install-test: run inside qemu + kvm
Change repo-install-test to run inside of qemu instead of docker. This
job needs to run systemd to verify that the systemd services start up
properly. Running systemd inside docker was never officially supported,
it worked with cgroups1 but does not work anymore with cgroups2.

An alternative approach was running inside podman instead of docker
(running systemd inside of podman is officially supported). However we
would have needed various workarounds with podman and wouldn't be able
to test all Osmocom systemd services in the end, due to lack of
permissions (see review of I394918fc61de36acce65ffb33defcb8fc21801c4).

By running with a separate kernel inside qemu we can run all Osmocom
services.

Related: OS#5365
Change-Id: Ie7f1bccb05779cb3614016c0b965b810bbb1471b
2022-12-09 10:55:15 +00:00
Oliver Smith d198fe6b38 Cosmetic: repo-install-test: sort env vars comment
Related: OS#5365
Change-Id: Ic21b46e614c7bfd8e0306599b4d33a1b963db376
2022-12-09 10:55:15 +00:00
Oliver Smith 21a641d6c2 scripts/docker-cleanup: remove fallback code
Remove the fallback clean up code, as it also may lead to images getting
removed right before we need to use them. Besides that, it should be
dead code by now since docuum should be running on all our jenkins nodes
to clean up old images based on last use date.

Change-Id: I9ca0c2ba245bdd75d9fb8eaf341055e8c2ab1b55
2022-12-09 10:40:58 +01:00
Oliver Smith a7df704d4d scripts/docker-cleanup: fix timing problems
Don't delete images while they are being used, to fix these errors we
see from time to time in the middle of "docker build" on jenkins:
unknown parent image ID sha256:1b072e35048cd8b680eddabdc641ac678edb1184d222d5e7b3fbe0b3c333129a

This happens because "docker build" creates so-called dangling images
for each step processed of a Dockerfile. The "docker system prune" call
deletes these dangling images (among other things).

Remove the "docker system prune" call. We already have the docuum daemon
to deal with unused images (dangling and not dangling), it removes them
based on last use date so that the used space is always below a
configured limit. As it deletes images that haven't been used the
longest when it reaches the limit, it will not result in the problem
explained above.

Besides images, "docker system prune" also removes unused containers
(instances of images created with 'docker run' without --rm) and
networks. Add "docker container prune" and "docker network prune"
commands to remove them from now on.

Also remove the redundant container removal logic (previous it was
redundant with "docker system prune", now redundant with "docker
container prune").

Related: https://docs.docker.com/config/pruning/
Change-Id: Ia1b466eea43dd135373949e8e3e6b005c169ea0c
2022-12-09 10:40:33 +01:00
Oliver Smith 4fe56c0968 obs: build_deb/rpm: show contents after build
After building packages with the OBS scripts, show their contents. This
allows easy checking if config files were correctly packaged etc. By
adding it here, it will also show up at the end of the related jenkins
jobs for gerrit verifications.

Related: OS#5817
Change-Id: Ie30b07f35f7e41990fa352523427d86458291d4d
2022-12-08 15:42:59 +01:00
Oliver Smith ce5875fd07 jobs/osmo-gsm-tester virtual: fix docker img
Build the docker image right before using it, instead of building it in
another jenkins job update-osmo-ci-on-slaves via
osmo-ci-docker-rebuild.sh.

The logic in osmo-ci-docker-rebuild.sh was broken. I didn't realize at
the time that this image is only used for the virtual osmo-gsm-tester,
not the physical ones. But only the machines running the physical
osmo-gsm-tester have the /var/tmp/osmo-gsm-tester/state path. The
virtual osmo-gsm-tester isn't running on these machines but on generic
jenkins nodes.

Building the image right before using it makes sense for this job, as it
is the only user of the image. If it was already built from the same
Dockerfile, a cached version is used.

Fix for:
  Unable to find image 'osmocom-build/osmo-gsm-tester:latest' locally

Fixes: 9139e76b ("osmo-ci-docker-rebuild: don't always build osmo-gsm-tester")
Change-Id: Icad9459de1d3a3a4e65ecacf7f903433bb504cc9
2022-12-01 15:04:38 +01:00
Oliver Smith 521b83ba3a scripts/osmocom-build-old…: skip openbsc 1.4.{0,1}
Don't attempt to build openbsc 1.4.0 and 1.4.1 in the
osmocom-build-old-tags-against-master job, as it fails to build with a
modern gcc with a potential null pointer dereference warning that gets
treated as error. This was fixed in 1.4.2 with openbsc patch
I93d816a20ba208e9fd32a1fc172a78ccd326e1ba.

A more modern gcc gets used, as this job gets changed to not only run on
jenkins nodes with debian 9 installed, but also more modern versions.
This job does not run in docker, and since it still passes it doesn't
seem worth changing that now.

Related: OS#5793
Change-Id: Ibf4b66195fbd70a68d63929b156a9aac54a699bc
2022-11-30 17:46:43 +01:00
Oliver Smith 1263d6e0b9 obs/srcpkg: open5gs: download all subprojects
With recent changes in open5gs, building the source packages we
generated fails:
[   45s] ../lib/metrics/meson.build:52:4: ERROR: Automatic wrap-based subproject downloading is disabled
[   45s] dh_auto_configure: error: cd obj-x86_64-linux-gnu && LC_ALL=C.UTF-8 meson .. --wrap-mode=nodownload --buildtype=plain --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=lib/x86_64-linux-gnu --libexecdir=lib/x86_64-linux-gnu returned exit code 1

Fix this by downloading all subprojects. This is now possible as I added
a meson.build file to the prometheus-client-c repository that open5gs
uses: https://github.com/open5gs/prometheus-client-c/pull/2

Change-Id: If3910b520382b177a77b216c93771ea88414723d
2022-11-21 16:48:35 +01:00
Oliver Smith f560ce08ab jenkins-gerrit: fix ambiguous use of review api
Fix an error when the same Change-Id is used on multiple branches or in
theory projects. This is actually allowed by gerrit, and we use this
e.g. when backporting patches from master.

Use the project, change number (e.g. 30147) and patchset number (e.g. 2)
instead of the Change-Id.

Fix for:
  + ssh -p 29418 -l jenkins gerrit.osmocom.org gerrit review 4835a62cd88f0d69db76fb3bfd2df02176a91a6d --json
  fatal: "4835a62cd88f0d69db76fb3bfd2df02176a91a6d" matches multiple patch sets

Related: https://gerrit-review.googlesource.com/Documentation/cmd-review.html
Change-Id: I2d627f8f3b400fa57a50a228d47df2194f60fd08
2022-11-15 11:38:08 +00:00
Oliver Smith e4a33ebda2 jenkins-gerrit: display JOB_TYPE infront of url
In the summary comment posted by jenkins to the patch on gerrit, display
the JOB_TYPE infront of the URL instead of "build", if the build job is
a matrix job that uses JOB_TYPE as variable.

For such jobs, it changes:
  [build] https://jenkins.osmocom.org/…
  [build] https://jenkins.osmocom.org/…
  [build] https://jenkins.osmocom.org/…
  [build] https://jenkins.osmocom.org/…
  [lint] https://jenkins.osmocom.org/…
to:
  [manuals] https://jenkins.osmocom.org/…
  [gateware] https://jenkins.osmocom.org/…
  [firmware] https://jenkins.osmocom.org/…
  [software] https://jenkins.osmocom.org/…
  [lint] https://jenkins.osmocom.org/…

JOB_TYPE is used by osmo-e1-hardware and pysim.

Change-Id: I51f49e4799961776dbddaedd76c14ed37a0e6c84
2022-11-07 08:16:23 +00:00
Oliver Smith 288fa2d51e obs: check_builders: at least 10, fail on error
The number of builders connected to the OBS server seems to fluctuate a
bit (used to be 14, then 17 now 16). Make sure that we have at least 10
builders connected. Fix that the test didn't exit with 1 on error.

Related: https://obs.osmocom.org/monitor
Change-Id: Iedd506601a5450550e21bf701309b4ea79a3d897
2022-11-04 15:08:00 +00:00
Oliver Smith 8d7596a311 obs: build_binpkg: add --run-shell-on-error arg
Allow easy inspection of the build dir inside docker on error.

Related: OS#5737
Change-Id: I218c3189d36d24c64cbd7b9eab379aff8ce2bee2
2022-11-03 13:01:43 +01:00
Oliver Smith 13b76cced1 obs: fix building rpms with man pages
Add the "%ext_man .gz" macro from OBS, so building rpms with man pages
does not fail with errors like:
  File not found: /home/user/rpmbuild/BUILDROOT/osmo-ggsn-1.9.0.3.0d3b-0.x86_64/usr/share/man/man8/osmo-ggsn.8

Fixes: OS#5737
Change-Id: Ib6950fb46e9f94aabae98021b215f69838557045
2022-11-03 12:22:45 +01:00
Oliver Smith c4df55dcfd jenkins-gerrit: send mail for V+1 for some users
Add a list of users that do not only get a notification mail when the
gerrit verification failed, but also on success.

Change-Id: I603b8a911c8f17aa726d9e3d5d644ad3262b42dd
2022-10-27 16:43:14 +02:00
Oliver Smith f52c26a695 jobs: add osmocom-obs-check-builders
Add a job that checks if the amount of connected builders to the OBS
server matches what we expect. This should prevent what we had today,
that it only was noticed by chance several days after all builders
failed to connect and the packages were outdated since then.

I'm not sure if there is a proper api to do this check, but I don't
expect the string we check for to change often so this should work fine.

Change-Id: I6e7c1f206551722d6bfe1631b9c1da8d34d85ba8
2022-10-26 08:35:05 +00:00
Oliver Smith 1cd0685b55 jenkins-gerrit: add note for build fails/pkgs pass
One might be wondering what happened if the build job failed, but
building the binary packages succeeded. Since we run 'make check' in
all cases. Add this short explanation:

  The build job(s) failed, but deb/rpm jobs passed.
  We don't enable external/vty tests when building
  packages, so maybe those failed. Check the logs.

Related: OS#2385
Change-Id: I70027ec970a220c3ddfa766302faec7bd8752118
2022-10-21 08:34:15 +00:00
Oliver Smith 5be9a7442b obs: fix master rpm repository description
Instead of having the description of the nightly repository (copy paste
error), put in "osmocom:master". This gets printed a few times in the
log of the gerrit-binpkgs-rpm jenkins job and may lead to confusion -
the nightly repository is not used, it's a separate master repository.

Related: OS#2385
Change-Id: Ia5a88b064da66d7bf5cebe910961f752262b1bac
2022-10-19 10:46:11 +02:00
Oliver Smith 84866a7d8e jenkins-gerrit: add link to retrigger the build
It's useful to be able to retrigger the pipeline, for example if the
build failed because a depending patch was not merged yet and later it
is merged. Add the link where the "Retrigger" button is to make this
convenient.

Related: OS#2385
Change-Id: I647efac9e79d755282b78f14bd27244c99ef7f11
2022-10-14 16:35:14 +02:00
Oliver Smith 5354547dff jenkins-gerrit: tweak notify setting
Instead of notifying everybody listed as reviewers and in CC:
* notify the owner if the build failed
* notify nobody if the build was successful

Related: OS#2385
Change-Id: I7c6c183b98624eb75d5dccd9766ee3ff5568b06e
2022-10-12 12:22:44 +02:00
Oliver Smith 348751bc05 jenkins-gerrit: add 0-9 to re_start_build
Let it match "Starting building: gerrit-osmo-ttcn3-hacks-build #5". It
failed on the 3 in ttcn3 before.

Related: OS#2385
Change-Id: I247af55e2c0e3a2dd088ab1c951d8535cfc93229
2022-10-12 11:07:42 +02:00
Oliver Smith a02b53fe4f jenkins-gerrit: meaningful re_start_build error
Related: OS#2385
Change-Id: Ib29b7ce69a27453b460f946ad67bd12faffc2c89
2022-10-12 11:07:09 +02:00
Oliver Smith 9c2e2575a9 obs: support Osmocom projects without prefix
Allow running build_srcpkg.py with "osmo_dia2gsup" instead of
"erlang/osmo_dia2gsup", because that's how it gets passed along from
jobs/gerrit-verifications.yml for the binary package build
verifications.

Related: OS#2385
Change-Id: I09304b219e7002495bd3fcce61bc68c34d5ffcd8
2022-10-11 12:07:40 +02:00
Oliver Smith 4e679c8f2e jobs/gerrit-verifications: write summary comment
Instead of having multiple mails from jenkins per submitted gerrit
patch, only have one at the end of the pipeline that writes a summary
with all relevant links and votes +1/-1 for verified.

This also resolves the problem we had for a long time, that the link for
the build job didn't directly point to the relevant console output.
Instead it pointed to a matrix job that didn't have a direct link to the
relevant job.

The summary looks like this:

1 failed:
  [build] https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-bsc-nat-build/a1=default,a2=default,a3=default,a4=default,label=osmocom-gerrit-debian9/11/consoleFull

3 passed:
  [rpm] https://jenkins.osmocom.org/jenkins/job/gerrit-binpkgs-rpm/5/consoleFull
  [deb] https://jenkins.osmocom.org/jenkins/job/gerrit-binpkgs-deb/5/consoleFull
  [lint] https://jenkins.osmocom.org/jenkins/job/gerrit-lint/11/consoleFull

Build Failed

Related: OS#2385
Change-Id: Idcab969e1b5ca4e0f1383bee8f36f2d1aac4f624
2022-10-11 12:07:40 +02:00
Oliver Smith d0ef24c3c6 obs: config: update note about testing packages
Related: OS#2385
Change-Id: If6d772052ca64ef93536bf8729a72271f67fbecb
2022-10-11 12:07:40 +02:00
Oliver Smith 38109f8429 obs/README: add overview with build_binpkg.py
Related: OS#2385
Change-Id: I1b741ad325e6541e6d59dfd50de66bee805e56fe
2022-10-11 12:07:40 +02:00
Oliver Smith 7614916a72 obs: build_binpkg: use almalinux:8 naming
Instead of using "--docker centos:8" as argument and translating it
later on in the code to use "almalinux:8" as base distribution, use
"--docker almalinux:8" as argument. It was brought up in code review
that this makes it less confusing.

Related: OS#2385
Change-Id: Id8298e8bafe065010f7bc00f1ff261aa6431ed4c
2022-10-11 12:07:40 +02:00
Oliver Smith c449c5de8d obs: build_binpkg: optimize osmo-gsm-manuals-dev
Installing osmo-gsm-manuals-dev plus depends takes a long time. Don't do
this for every build, instead do it once when building a second docker
container and then use that.

Related: OS#2385
Change-Id: I8475bd954352b572197795ad4cd9461e39896d48
2022-10-06 09:45:02 +02:00
Oliver Smith 6298cbbe0f obs: build_binpkg: debian: don't install manpages
Configure dpkg to not extract man pages. Otherwise it will spend some
time regenerating the man page index whenever installing build
dependencies before starting to build a package.

Related: OS#2385
Change-Id: I1c9e3883b976e023c96dfd59eb147770f7ad99a7
2022-10-06 09:45:02 +02:00
Oliver Smith 449dae8c13 obs: add build_binpkg.py
Add a script to build deb/rpm packages, as it would be done on
obs.osmocom.org. This will be used by jenkins to verify deb and rpm
builds for each submitted gerrit patch.

I have attempted to use 'osc build' instead of directly calling
apt-get build-dep and dpkg-buildpackage (and rpm equivalents). Using
'osc build' would have the advantage that the build works as close to
the OBS build as possible. However it would try to install dependencies
with sudo, so we would need to have sudo available in the docker
container that builds the untrusted code from gerrit. Let's not do that.

Related: OS#2385
Change-Id: I4c6b5d61af35df98cbc70d9ddc8ad36d38a9ce18
2022-10-06 09:45:02 +02:00
Oliver Smith d423d17e07 obs: lib.docker: fix redundant get_image_name()
Related: OS#2385
Change-Id: Ifa4e316db63c1a3bb9e0d845e7f755d04cf1297e
2022-10-06 09:45:02 +02:00
Oliver Smith 1816b47606 obs: run_in_docker_and_exit: no os.path.basename
Don't use os.path.basename on the script_path parameter passed to the
function. A future patch will pass a script that is inside the data
subdirectory to this function, therefore this is needed.

Related: OS#2385
Change-Id: Ide78d976f9af445c4c8d8748bc274d7289064769
2022-10-06 07:44:31 +00:00
Oliver Smith b88200546a obs: prepare for multiple dockerfiles
Rename Dockerfile to build_srcpkg.Dockerfile and adjust related code to
allow using a different Dockerfile for building the binary packages in a
future patch.

Related: OS#2385
Change-Id: I8ef7944a4a81acd6c915998f37139eebad2b2d3e
2022-10-06 07:44:31 +00:00
Oliver Smith 10bd88ab54 obs: run_in_docker_and_exit: remove args param
No need to pass args here. It was only used for args.verbose, and that
isn't necessary since we don't need to restore the verbose mode.

Related: OS#2385
Change-Id: I620cdef46e18f4c66644f14003caf2183c89686f
2022-10-06 07:44:31 +00:00
Oliver Smith 9ffc482315 obs: run_in_docker_and_exit: --rm on extra line
Put it on an extra line like the other arguments to prevent it from
getting overlooked.

Related: OS#2385
Change-Id: Ie7dea2734e7c47766dfe64b7091bc4f5f72d53a5
2022-10-06 07:44:31 +00:00
Oliver Smith b5d65e6dae jobs/osmocom-obs: add job for master feed
Add one new job for building source packages and sending them to
obs.osmocom.org. Trigger it from all master-* jobs.

I've also considered adding one job per existing master job that would
only update one package at a time (master-libosmocore-obs,
master-osmo-bsc-obs, ...). With some additional development effort it
should be possible, and it would make each individual master OBS job
faster. But given that with the current implementation it only takes
20s to 30s for *all* packages if there are no changes, as it compares
git remote HEAD with the version currently on OBS before starting to
clone repositories and building the source packages (similar to
Osmocom_OBS_latest_obs.osmocom.org), it didn't seem worth optimizing.

Set concurrent to false as the triggers from master-builds will likely
cause it to run multiple times in parallel otherwise.

Related: https://jenkins.osmocom.org/jenkins/view/OBS/job/Osmocom_OBS_master_obs.osmocom.org/
Related: https://obs.osmocom.org/project/show/osmocom:master
Related: OS#2385
Change-Id: I53a494f13f81ae837f2d362c54e1bdf13f121db3
2022-10-06 07:44:31 +00:00
Oliver Smith 3a6250a9fb obs: update_obs_project: add master feed
Add a new master feed, where packages are updated as soon as patches get
merged to master. Upload a commit_$COMMIT.txt file for each package in
this feed and use it to determine if the package needs to be updated or
not.

In most packages the commit is already part of the version in the dsc
file, e.g. "libosmocore_1.7.0.38.c3b90.dsc", but that's harder to parse
and is more likely to have a hash collision (just 5 characters).

Related: OS#2385
Change-Id: I3b0b4f4876b8c1eeb61f20d903a6f2cac6e99638
2022-10-06 07:44:31 +00:00
Oliver Smith a91667d04c obs: build_srcpkg_if_needed: switch if branches
Make it slightly easier to read, before extending the latest branch with
master too in a follow-up patch.

Related: OS#2385
Change-Id: I4f1d4e250eb4d8163f1ded29106a44deb0d0feff
2022-10-06 07:44:31 +00:00
Oliver Smith ba8df68397 obs: lib.git.get_default_branch: add function
Refactor checkout_default_branch so the get_default_branch logic can be
used from another function in a future patch.

Related: OS#2385
Change-Id: If3f0ab500ff165d81f61b19ad41af90bd39dce8f
2022-10-06 07:44:31 +00:00
Vadim Yanitskiy 4bb6385a22 scripts: osmo_git_clone_url(): properly handle 'satellite/osmo-gmr'
Coverity job currently fails because it fails to fetch osmo-gmr.git.

Change-Id: I4d52dbf0f81332dc1856944a6a3c7376cb1e0638
Fixes: I17590d0b0b46274e2ceb007e20d7d1dc039f4e8d
2022-10-01 17:42:55 +07:00
Oliver Smith 7fc58133d6 Replace most remaining git.osmocom.org urls
Replace the legacy git.osmocom.org clone URLs with either gerrit or
gitea in most places. Besides not using legacy urls anymore, the
advantage of using gerrit directly is that we don't have a delay of 10
min to several hours on the repository.

Not replaced:
* ansible/roles/osmocom-workstation: not sure if still used, would need
  a bit of a rewrite to use logic similar to osmo_git_clone_url().

Related: https://osmocom.org/projects/cellular-infrastructure/wiki/Git_infrastructure
Change-Id: I90409c9e7f4db4e1765647021625f9acfccaa78b
2022-09-26 15:07:59 +02:00
Oliver Smith a5521ff99e scripts/common: remove osmo_git_clone_date
This had been added for debugging purposes and isn't used anymore. Also
one less hit for git grep git.osmocom.org.

Change-Id: I10cbb598f0d5d675034ca87568a8b6f1920f2ad3
2022-09-26 14:54:01 +02:00