osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29594 )
Change subject: obs: update_obs_project: add master feed
......................................................................
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
---
M scripts/obs/lib/__init__.py
M scripts/obs/lib/config.py
M scripts/obs/lib/git.py
M scripts/obs/lib/osc.py
M scripts/obs/lib/srcpkg.py
M scripts/obs/update_obs_project.py
6 files changed, 58 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/94/29594/1
diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py
index f94c0a8..8f52dba 100644
--- a/scripts/obs/lib/__init__.py
+++ b/scripts/obs/lib/__init__.py
@@ -17,7 +17,7 @@
parser.add_argument("-f", "--feed",
help="package feed (default: nightly). The feed"
" determines the git revision to be built:"
- " 'nightly' builds 'origin/master',"
+ " 'nightly' and 'master' build 'origin/master',"
" 'latest' builds the last signed tag,"
" other feeds build their respective branch.",
metavar="FEED", default="nightly",
diff --git a/scripts/obs/lib/config.py b/scripts/obs/lib/config.py
index c9df74a..79a7849 100644
--- a/scripts/obs/lib/config.py
+++ b/scripts/obs/lib/config.py
@@ -32,6 +32,7 @@
"2022q1",
"2022q2",
"latest",
+ "master",
"nightly",
]
diff --git a/scripts/obs/lib/git.py b/scripts/obs/lib/git.py
index aab0533..8faf5b2 100644
--- a/scripts/obs/lib/git.py
+++ b/scripts/obs/lib/git.py
@@ -76,6 +76,28 @@
checkout(project, f"origin/{branch}")
+def get_head(project):
+ repo_path = get_repo_path(project)
+ ret = lib.run_cmd(["git", "rev-parse", "HEAD"], cwd=repo_path)
+ return ret.output.rstrip()
+
+
+def get_head_remote(project, branch):
+ if not branch:
+ branch = get_default_branch(project)
+ repo_url = get_repo_url(project)
+
+ print(f"{project}: getting head from git remote for {branch}")
+ ls_remote = lib.run_cmd(["git", "ls-remote", repo_url, branch])
+
+ ret = ls_remote.output.split("\t")[0]
+ if not ret:
+ lib.exit_error_cmd(ls_remote, f"failed to find head commit for"
+ "{project} in output")
+
+ return ret
+
+
def get_latest_tag(project):
pattern_str = get_latest_tag_pattern(project)
pattern = re.compile(pattern_str)
diff --git a/scripts/obs/lib/osc.py b/scripts/obs/lib/osc.py
index 51e2f5f..df5c34c 100644
--- a/scripts/obs/lib/osc.py
+++ b/scripts/obs/lib/osc.py
@@ -62,7 +62,7 @@
return ret.output.rstrip().split("\n")
-def get_package_version(proj, package):
+def get_package_version(proj, package, feed):
print(f"{package}: getting OBS version")
ret = run_osc(["list", proj, os.path.basename(package)])
@@ -70,15 +70,21 @@
if ret.output == '\n':
return "0"
- # Extract the version from the dsc filename
+ # Extract the version from the file list
for line in ret.output.split('\n'):
line = line.rstrip()
- if line.endswith(".dsc"):
- return line.split("_")[-1][:-4]
+ if feed == "master" and package != "osmocom-master":
+ # Use commit_*.txt
+ if line.startswith("commit_") and line.endswith(".txt"):
+ return line.split("_")[1].split(".")[0]
+ else:
+ # Use *.dsc
+ if line.endswith(".dsc"):
+ return line.split("_")[-1][:-4]
lib.exit_error_cmd(ret, "failed to find package version on OBS by"
- " extracting the version from the .dsc filename")
+ " extracting the version from the file list")
def create_package(proj, package):
diff --git a/scripts/obs/lib/srcpkg.py b/scripts/obs/lib/srcpkg.py
index 159f4ed..1711f70 100644
--- a/scripts/obs/lib/srcpkg.py
+++ b/scripts/obs/lib/srcpkg.py
@@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
import os
+import pathlib
import lib.config
import lib.debian
import lib.rpm_spec
@@ -13,7 +14,7 @@
lib.git.checkout(project, f"origin/{branch}")
elif feed == "latest":
lib.git.checkout_latest_tag(project)
- elif feed == "nightly":
+ elif feed in ["master", "nightly"]:
lib.git.checkout_default_branch(project)
else: # 2022q1 etc
lib.git.checkout(project, f"origin/{feed}")
@@ -117,6 +118,18 @@
f.write(f"{version}\n")
+def write_commit_txt(project):
+ """ Write the current git commit to commit_$commit.txt file, so it gets
+ uploaded to OBS along with the rest of the source package. This allows
+ figuring out if the source package is still up-to-date or not for the
+ master feed. """
+ output_path = lib.get_output_path(project)
+ commit = lib.git.get_head(project)
+
+ print(f"{project}: adding commit_{commit}.txt")
+ pathlib.Path(f"{output_path}/commit_{commit}.txt").touch()
+
+
def build(project, feed, branch, conflict_version, fetch, gerrit_id=0):
lib.git.clone(project, fetch)
lib.git.clean(project)
@@ -155,5 +168,8 @@
lib.rpm_spec.generate(project, version, epoch)
lib.rpm_spec.copy_to_output(project)
+ if feed == "master":
+ write_commit_txt(project)
+
lib.remove_cache_extra_files()
return version_epoch
diff --git a/scripts/obs/update_obs_project.py b/scripts/obs/update_obs_project.py
index 168193d..9bd46ff 100755
--- a/scripts/obs/update_obs_project.py
+++ b/scripts/obs/update_obs_project.py
@@ -66,13 +66,16 @@
fetch, is_meta_pkg, skip_up_to_date):
global srcpkgs_skipped
- if feed == "latest":
+ if feed in ["master", "latest"]:
""" Check if we can skip this package by comparing the OBS version with
the git remote. """
if is_meta_pkg:
latest_version = conflict_version if conflict_version else "1.0.0"
else:
- latest_version = lib.git.get_latest_tag_remote(package)
+ if feed == "master":
+ latest_version = lib.git.get_head_remote(package, branch)
+ else:
+ latest_version = lib.git.get_latest_tag_remote(package)
if latest_version is None:
print(f"{package}: skipping (no git tag found)")
@@ -82,7 +85,7 @@
if os.path.basename(package) not in pkgs_remote:
print(f"{package}: building source package (not in OBS)")
else:
- obs_version = lib.osc.get_package_version(proj, package)
+ obs_version = lib.osc.get_package_version(proj, package, feed)
if is_up_to_date(obs_version, latest_version):
if skip_up_to_date:
print(f"{package}: skipping ({obs_version} is up-to-date)")
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29594
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I3b0b4f4876b8c1eeb61f20d903a6f2cac6e99638
Gerrit-Change-Number: 29594
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29595 )
Change subject: jobs/osmocom-obs: add job for master feed
......................................................................
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.osm…
Related: https://obs.osmocom.org/project/show/osmocom:master
Related: OS#2385
Change-Id: I53a494f13f81ae837f2d362c54e1bdf13f121db3
---
M jobs/master-builds.yml
M jobs/osmocom-obs.yml
M scripts/obs/lib/git.py
3 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/95/29595/1
diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 7fc306f..e7b4c61 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -491,6 +491,8 @@
resolve-relative-paths: true
- trigger:
project: '{obj:trigger}'
+ - trigger:
+ project: 'Osmocom_OBS_master_obs.osmocom.org'
- email:
recipients: '{obj:email}'
send-to-individuals: true
diff --git a/jobs/osmocom-obs.yml b/jobs/osmocom-obs.yml
index ff2a18a..0036493 100644
--- a/jobs/osmocom-obs.yml
+++ b/jobs/osmocom-obs.yml
@@ -4,6 +4,8 @@
jobs:
- Osmocom_OBS_{type}_{server}
type:
+ - master:
+ conflict_version: ""
- nightly:
# For nightly we don't provide ABI compatibility, make sure packages
# from different build dates are not mixed by accident
@@ -15,10 +17,16 @@
proj: "network:osmocom"
- obs.osmocom.org:
proj: "osmocom"
+ # Pushing to build.opensuse.org is legacy, will be disabled soon (OS#5557).
+ # Don't push the new master repository there.
+ exclude:
+ - type: master
+ server: build.opensuse.org
- job-template:
name: 'Osmocom_OBS_{type}_{server}'
project-type: freestyle
+ concurrent: false
defaults: global
description: |
See <a href="https://osmocom.org/projects/cellular-infrastructure/wiki/Binary_Packages">Wiki: binary packages</a>
diff --git a/scripts/obs/lib/git.py b/scripts/obs/lib/git.py
index 8faf5b2..8081a54 100644
--- a/scripts/obs/lib/git.py
+++ b/scripts/obs/lib/git.py
@@ -88,7 +88,7 @@
repo_url = get_repo_url(project)
print(f"{project}: getting head from git remote for {branch}")
- ls_remote = lib.run_cmd(["git", "ls-remote", repo_url, branch])
+ ls_remote = lib.run_cmd(["git", "ls-remote", repo_url, f"heads/{branch}"])
ret = ls_remote.output.split("\t")[0]
if not ret:
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29595
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I53a494f13f81ae837f2d362c54e1bdf13f121db3
Gerrit-Change-Number: 29595
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/29591 )
Change subject: msgb: dont return a length when msgb->lXh is NULL
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
one could actually argue that we should OSMO_ASSERT in this case, as using msgb_lXlen() on a msgb without lXh pointer set is almost certainly a programming error.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/29591
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I1795c559f190713ebbabfbabf3453ab77da46a49
Gerrit-Change-Number: 29591
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 04 Oct 2022 12:53:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/29591 )
Change subject: msgb: dont return a length when msgb->lXh is NULL
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/29591
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I1795c559f190713ebbabfbabf3453ab77da46a49
Gerrit-Change-Number: 29591
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 04 Oct 2022 12:52:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/29591 )
Change subject: msgb: dont return a length when msgb->lXh is NULL
......................................................................
msgb: dont return a length when msgb->lXh is NULL
When any of l1h, l2h, l2h or l4h is set to NULL (which is the default
for newly allocated message buffers). Then the msgb_lXhlen() functions
will return the value of msgb->tail. This is not logical. When the
msgb->lXh pointers are not used then a mgsb_lXhlen() should return 0 and
not a very high random number.
Change-Id: I1795c559f190713ebbabfbabf3453ab77da46a49
Related: OS#5645
---
M include/osmocom/core/msgb.h
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/91/29591/1
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 117fcb0..8535e04 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -144,6 +144,8 @@
*/
static inline unsigned int msgb_l1len(const struct msgb *msgb)
{
+ if (!msgb->l1h)
+ return 0;
return msgb->tail - (uint8_t *)msgb_l1(msgb);
}
@@ -156,6 +158,8 @@
*/
static inline unsigned int msgb_l2len(const struct msgb *msgb)
{
+ if (!msgb->l2h)
+ return 0;
return msgb->tail - (uint8_t *)msgb_l2(msgb);
}
@@ -168,6 +172,8 @@
*/
static inline unsigned int msgb_l3len(const struct msgb *msgb)
{
+ if (!msgb->l3h)
+ return 0;
return msgb->tail - (uint8_t *)msgb_l3(msgb);
}
@@ -180,6 +186,8 @@
*/
static inline unsigned int msgb_l4len(const struct msgb *msgb)
{
+ if (!msgb->l4h)
+ return 0;
return msgb->tail - (uint8_t *)msgb_sms(msgb);
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/29591
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I1795c559f190713ebbabfbabf3453ab77da46a49
Gerrit-Change-Number: 29591
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-mgw/+/29589
to look at the new patch set (#3).
Change subject: Get rid of separate rtp_port field
......................................................................
Get rid of separate rtp_port field
Let's use the port part of the struct mgcp_rtp_end->addr field instead
of keeping it separate. This makes it easier passing around and
using/checking the RTP remote address + port, and avoids confusion
having to check stuff outside of the address, with its port part
potentially unset.
Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_network.h
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_iuup.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_sdp.c
M tests/mgcp/mgcp_test.c
9 files changed, 50 insertions(+), 70 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/89/29589/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29589
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c
Gerrit-Change-Number: 29589
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-mgw/+/29589 )
Change subject: Get rid of separate rtp_port field
......................................................................
Get rid of separate rtp_port field
Let's use the port part of the struct mgcp_rtp_end->addr field instead
of keeping it separate. This makes it easier passing around and
using/checking the RTP remote address + port, and avoids confusion
having to check stuff outside of the address, with its port part
potentially unset.
Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_network.h
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_iuup.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_sdp.c
M tests/mgcp/mgcp_test.c
9 files changed, 50 insertions(+), 70 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/89/29589/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29589
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c
Gerrit-Change-Number: 29589
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-mgw/+/29590 )
Change subject: osmux: Use available API to check if remote end is known
......................................................................
osmux: Use available API to check if remote end is known
Since recently the port is guaranteed to be placed at
CRCX/MDCX in the sockaddr, hence we can check it using the API instead
of checking manually only for the address part.
In osmux_send_dummy() we actually fix a bug where an in_addr was being
compared against a struct sockaddr.
Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27
---
M src/libosmo-mgcp/mgcp_osmux.c
1 file changed, 2 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/90/29590/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29590
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27
Gerrit-Change-Number: 29590
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset