Commit Graph

22 Commits

Author SHA1 Message Date
Oliver Smith 03cb833746 jobs: update trigger timers
Ensure we trigger building new OBS packages first, then wait plenty of
time until the binary packages are available (and run jobs in the
meantime that don't need them), and only after that we run the jobs
that need the binary packages.

Otherwise TTCN3 jobs may test the packages from the previous day, and
some jobs may fail completely due to packages not being completely built
yet. For example, yesterday the new Osmocom CNI releases were tagged,
which means the :latest packages also need to be rebuilt (-> building
all OBS packages takes longer). The osmocom-release-manuals and
-tarballs jobs failed, because the new binary packages were not
available yet when they ran.

Change all timers to the format "H 20 * * *" to have a deterministic
hour and semi-random minute based on the job name.

Change-Id: Ib68f9a78bae27a63706a8c95715bf6a244b7bf1d
2023-09-13 16:11:29 +00:00
Oliver Smith f75d09a79e jobs/osmocom-obs: drop obs.osmocom.org suffix
Having the OBS URL at the end of the jenkins job was useful when we were
uploading to obs.osmocom.org and build.opensuse.org at the same time
during the transitional phase. Remove the URL from the job name as this
isn't the case anymore, and so the jobs look consistent with new
Osmocom_OBS jobs.

Change-Id: I460f9e6a508421773e300eee6c5c5654e5760cdb
2023-04-06 10:59:28 +02:00
Oliver Smith 2c57e9a2fb jobs: add build-discarder to all
Adjust all jobs that don't have a build-discarder yet and add it there.

Related: OS#5980
Change-Id: I531ae52ec7337288e3d82151391224f308ab5f9e
2023-04-03 11:22:21 +02:00
Oliver Smith c53223d047 jobs/obs: don't upload to build.opensuse.org
The transitional phase where we upload to both the old and new OBS
server is over, so just upload to the new server from now on.

Related: OS#5557
Change-Id: If6f87dc6dbb4bafa3abb1d840f8d43cce6432dfd
2022-11-04 08:03:07 +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 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 fb1f39e0c9 obs: make git fetch the default
As discussed with Neels, it makes more sense to fetch git repos by
default.

Change-Id: Ib8adfbcf59d66b26f322ad22b2df1ccbeaf15af7
2022-08-18 13:18:25 +00:00
Harald Welte 5455b42405 update git URLs (git -> https; gitea/gerrit)
Unencrypted git:// protocol offers no integrity or authentication,
making it subject to tampering.  Use https:// instead.

https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git
https://blog.readthedocs.com/github-git-protocol-deprecation/

Change-Id: Ia44e4127ff87a3d4d747225d3258188a0a891f1b
2022-08-13 04:02:51 +07:00
Oliver Smith 35030b7618 scripts/obs: rewrite pushing source pkgs to OBS
Harald requested that the OBS scripts should not stop if building one
specific source package fails, instead it should keep going and report
at the end a non-success exit code.

Given that the shell script code has historically grown and became hard
to maintain, I decided to rewrite the scripts for implementing this
feature. This rewrite solves additional problems:

* No full checkout of an OBS project like network:osmocom:latest
  anymore, with lots of packages that won't get updated (e.g. the uhd
  package has a uhd-images_3.14.1.1.tar.xz file that is 108 MB). With
  the old code, developers had to wait minutes during the checkout
  before the script reaches code that is currently being developed. Now
  only single packages get checked out right before they get updated.

* No need to clone git repositories over and over. With the new code,
  git repos only get cloned if needed (for latest it is not needed if
  the remote git tag is the same as the version in OBS). During
  development, the cloned git repositories are cached.

* Output from commands like "git tag -l" is not written to the log
  unless they failed. This makes the log more readable, which is
  especially important when a package fails to build, we keep going and
  need to spot the build error in the middle of the log later on.

* No more duplicated code for nightly and latest scripts that worked
  similar but had slight differences. Also the list of packages is not
  duplicated for nightly and latest anymore; nightly uses all packages
  and latest uses packages that have at least one git tag.

* Building source packages is decoupled from uploading them. A separate
  script build_srcpkg.py can be used to just build the deb + rpm spec
  source packages, without interacting with the OBS server.

* The scripts can optionally run in docker with a command-line switch,
  and this is used by jenkins. This way we don't need to install
  more dependencies on the host such as rebar3 which is now needed for
  erlang/osmo_dia2gsup.

* Add erlang/osmo_dia2gsup and run its generate_build_dep.sh (SYS#6006)

I have done the new implementation in python to make use of argparse
and to be able to use try/except and print a trace when building one
package fails.

Example output:
* https://jenkins.osmocom.org/jenkins/job/Osmocom_OBS_nightly_obs.osmocom.org/48/console
* https://jenkins.osmocom.org/jenkins/job/Osmocom_OBS_latest_obs.osmocom.org/46/console

Change-Id: I45a555d05a9da808c0fe0145aae665f583cb80d9
2022-08-01 16:29:20 +02:00
Oliver Smith fc4579cf76 jobs/osmocom-obs: run against obs.osmocom.org too
Split the OBS related jenkins jobs into two, one that uploads to the
new obs.osmocom.org and one that uploads to build.opensuse.org.

Set an alias for "osc" that sets the right server, and set the
expand_aliases shopt so the bash scripts that source common-obs.sh will
not ignore the alias.

Related: OS#5557
Change-Id: Ib271e16e93ebc58ed1ecb0ea881e1f1370e40928
2022-06-27 13:31:44 +02:00
Oliver Smith 1e6cae565a jobs: disable "next" repository
Related: OS#5322
Change-Id: I9efd020813540941f9afa2c03b9127c04465ce91
2021-11-22 14:52:42 +01:00
Oliver Smith e660339f2e OBS: require PROJ environment variable to be set
Uploading to network:osmocom:* should only be done when these scripts
are running in the Osmocom jenkins. Remove the default and require users
of the script to explicitly set PROJ.

Related: SYS#5370
Change-Id: If49ce217e77716b63dfde9139e869672a54b66a2
2021-04-29 16:04:00 +02:00
Oliver Smith 48c966a305 Cosmetic: jobs/obs: update repo-install-test name
Change-Id: Ic5712173ec79d286fb3591364636a38f6af74503
2021-01-21 10:30:05 +01:00
Pau Espin 57a38c7daf jjb: obs: Trigger jobs at sme point during 00H instead of 01H
There's no real need to wait until 01:00, let's try to get packages
built before.

Change-Id: I9db7108ecaab418f9b657d30c02622c56dc04798
2020-10-22 06:11:42 +00:00
Oliver Smith 504f23d82f jobs/osmocom-obs.yml: create Osmocom_OBS_next job
Change-Id: I50dca459d19dca5894b71169ae70a6c6778b2e52
2020-05-28 10:01:23 +00:00
Oliver Smith ef81fd660a jobs: upload to OBS before debian-install test
Make sure that we don't test yesterday's packages. Adjust timers to run
the OBS job around 1 o'clock, and the debian-install test around 4
o'clock. Use the H (hash) symbol for minute to spread the load.

Change-Id: I503058018172d50e9585d4804dfec1b4ece7644a
2019-07-26 08:55:21 +02:00
Oliver Smith 85163cd7f4 jobs/osmocom-obs.yml: set default git branch
I was quite surprised, that the job used "osmith/pdfs-in-doc-subpackage"
instead of "master" today [1]. Fix this randomness by adding a branch
parameter that defaults to "master".

Interestingly, we have to set the default branch to
"refs/remotes/origin/master". When using "*/master" (like we do in other
jobs), Jenkins would still chose my branch over "origin/master", even
though mine does not have "master" in the name. I have also tried
"chosing-strategy: 'default'", in case it was using the gerrit strategy
for some reason (like in [2]), and setting 'refspec:', but both did not
have any effect.

[1] https://jenkins.osmocom.org/jenkins/job/Osmocom_OBS_nightly/98/
[2] https://issues.jenkins-ci.org/browse/JENKINS-26981

Change-Id: I6d1f0e70d5c82ffd551d00ffdf2712cbfaec16cf
2019-05-23 13:08:19 +02:00
Oliver Smith 3f9776c9eb OBS: add links to job description
Add the links that the obsolete Osmocom_nightly_packages job has, before
we remove it. Also link to the binary packages wiki page.

Change-Id: Idbc7ccd0156d9c3eb6d30059384686849a36f49f
2019-04-30 08:19:01 +00:00
Harald Welte b1ec95f3c7 jenkins: Send build failures to jenkins-notifications mailing list
Change-Id: I5609a0f4b8f176ffa692db732abb4694acaaf927
2019-03-03 16:04:41 +01:00
Alexander Couzens 6ea2ec3a76 jobs: osmocom-obs: add support for the nightly build
Change-Id: I59929b4025210e1143e4d09bcfc59f91c81f0d20
2018-05-02 16:56:09 +02:00
Alexander Couzens 0fd4e7d429 jobs: osmocom-obs: introduce template var type
In preparation for the nightly jobs

Change-Id: I315215eb1d5ade257262d0717711c11f3787319f
2018-05-02 16:56:09 +02:00
Alexander Couzens efbe93e789 jobs: rename osmocom-obs-latest.yml -> osmocom-obs.yml
Prepare to template nightly and latest in one file

Change-Id: If080cca2ab51a7aab9c85da9f07c51179134f8c6
2018-05-02 16:50:49 +02:00