Skip to content

Commit 0112729

Browse files
author
codebot
committed
Update main
# Conflicts: # tests/unittests/f1ap/common/test_helpers.cpp
2 parents 133e71a + 570cf3d commit 0112729

File tree

191 files changed

+28223
-22653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+28223
-22653
lines changed

.gitlab-ci.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ include:
3636
- project: softwareradiosystems/ci/tools
3737
ref: "8"
3838
file: .gitlab/ci-shared/tools/test_reporter.yml
39+
- project: softwareradiosystems/ci/tools
40+
ref: "8"
41+
file: .gitlab/ci-shared/tools/tagger.yml
3942
- local: .gitlab/ci/build.yml
4043
- local: .gitlab/ci/trx.yml
4144
- local: .gitlab/ci/e2e.yml
@@ -49,6 +52,7 @@ stages:
4952
- documentation
5053
- private
5154
- public
55+
- release
5256

5357
variables:
5458
SLACK_CHANNEL_OK: "#ci_gnb"
@@ -195,15 +199,6 @@ coverity-dev:
195199
- export DESCRIPTION="srsRAN Project dev build"
196200
- export COV_TOKEN="${COVERITY_TOKEN_DEV}"
197201

198-
coverity-agpl:
199-
extends: .coverity_base
200-
rules:
201-
- if: $CI_DESCRIPTION =~ /AGPL-COVERITY/
202-
before_script:
203-
- export PROJECT_NAME="srsRAN_5G_agpl"
204-
- export DESCRIPTION="srsRAN Project AGPL build"
205-
- export COV_TOKEN="${COVERITY_TOKEN_AGPL}"
206-
207202
e2e tests tox:
208203
stage: static
209204
rules:
@@ -237,10 +232,12 @@ unit coverage:
237232
variables:
238233
coverage_report: summary
239234
when: always # Even if previous stages/required jobs fail
235+
allow_failure: true
240236
- if: $CI_DESCRIPTION =~ /Nightly/
241237
variables:
242238
coverage_report: full
243239
when: always # Even if previous stages/required jobs fail
240+
allow_failure: true
244241
before_script:
245242
- PACKAGE_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/coverage/${CI_COMMIT_BRANCH}${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}/coverage_history.tar.gz
246243
# Download coverage history from the registry
@@ -280,6 +277,11 @@ unit coverage:
280277
if [[ $coverage_report = "full" ]]; then
281278
publish_to_registry
282279
fi
280+
- export PIP_EXTRA_INDEX_URL=""
281+
- apk update; apk add python3 py3-pip
282+
- pip3 install --verbose retina-reporter --index-url https://__token__:[email protected]/api/v4/projects/44296988/packages/pypi/simple
283+
- retina-reporter --input build_time_metrics.json --bucket ci --db-config token=$INFLUXDB_TOKEN org=$INFLUXDB_ORG url=$INFLUXDB_URL
284+
283285
coverage: /^\s*Line coverage:\s*\d+.\d+\%/
284286
artifacts:
285287
paths:
@@ -376,6 +378,32 @@ promote code:
376378
- git push
377379
dependencies: []
378380

381+
update agpl main dryrun:
382+
extends: .update agpl main
383+
stage: .post
384+
rules:
385+
- if: $CI_DESCRIPTION =~ /Nightly/
386+
when: always
387+
allow_failure: true
388+
variables:
389+
MODE: "dryrun"
390+
needs: []
391+
392+
tag successful schedule:
393+
extends: .create-tag
394+
stage: .post
395+
rules:
396+
- if: $CI_DESCRIPTION =~ /Nightly/
397+
when: manual
398+
- if: $CI_DESCRIPTION =~ /Weekly/
399+
when: manual
400+
variables:
401+
GIT_STRATEGY: none
402+
interruptible: false
403+
script:
404+
- create_tag $(date +"%Y.%m.%d")
405+
dependencies: []
406+
379407
################################################################################
380408
# Enable / Disable pipelines
381409
################################################################################

.gitlab/ci/build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ variables:
122122
- !reference [.fetch_src_cache, before_script]
123123
- |
124124
build_srsgnb() {
125+
start_time=$(date +%s)
126+
125127
if [ -n "${UHD_VERSION}" ]; then
126128
BUILD_ARGS="${BUILD_ARGS} -u ${UHD_VERSION}"
127129
fi
@@ -186,6 +188,13 @@ variables:
186188
/usr/local/builder_tools/bin/python /usr/local/bin/changed_tests.py -b . -o "../$OUTPUT_FINGERPRINT"
187189
cd ..
188190
fi
191+
192+
end_time=$(date +%s)
193+
execution_time=$((end_time - start_time))
194+
echo "Build time is: $execution_time seconds"
195+
export metric_prefix=""
196+
if [[ $ON_MR == "true" ]]; then metric_prefix="_cached"; fi
197+
echo '[{"name":"build","description":"Compilation","tests":[{"name":"'$OS'","description":"'$OS' build","metrics":[{"name":"build_time'$metric_prefix'","description":"Build time","value":['$execution_time'],"unit":"seconds","type":"time"}],"duts":[]}]}]' >> build_time_metrics.json
189198
}
190199
- |
191200
launch_tests() {
@@ -269,6 +278,7 @@ variables:
269278
- ${CI_JOB_ID}_coverage.xml
270279
- build/apps/gnb/gnb
271280
- build/Testing/Temporary/MemoryChecker.*.log
281+
- build_time_metrics.json
272282
expire_in: 10 minutes
273283
cache:
274284
- !reference [.fetch_src_cache, cache]

.gitlab/ci/release.yml

Lines changed: 89 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@ include:
1010
- project: softwareradiosystems/ci/tools
1111
ref: "8"
1212
file: .gitlab/ci-shared/setup/all.yml
13+
- project: softwareradiosystems/ci/tools
14+
ref: "8"
15+
file: .gitlab/ci-shared/features/all.yml
1316

1417
stages:
1518
- private
1619
- public
20+
- release
1721

18-
update agpl main:
22+
.update agpl main:
1923
stage: private
20-
rules:
21-
- if: $ON_TAG
22-
allow_failure: true
2324
interruptible: false
2425
variables:
2526
GIT_STRATEGY: none
2627
BRANCH: agpl_main
28+
MODE: ""
2729
image: ubuntu:22.04
2830
before_script:
2931
- DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends git git-lfs apt-transport-https ca-certificates
@@ -33,7 +35,14 @@ update agpl main:
3335
- git clone https://${CODEBOT_USERNAME}:${CODEBOT_TOKEN}@gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}.git /${CI_PROJECT_NAME}
3436
- cd /${CI_PROJECT_NAME}
3537
- git fetch -q origin ${CI_COMMIT_SHA} && git checkout ${CI_COMMIT_SHA}
36-
- .gitlab/ci/release/auto_merge.sh ${CI_COMMIT_SHA} ${BRANCH}
38+
- .gitlab/ci/release/auto_merge.sh ${CI_COMMIT_SHA} ${BRANCH} ${MODE}
39+
40+
update agpl main:
41+
extends: .update agpl main
42+
rules:
43+
- if: $ON_TAG
44+
variables:
45+
MODE: "push"
3746

3847
generate testvector tar gz:
3948
stage: private
@@ -46,21 +55,31 @@ generate testvector tar gz:
4655
artifacts:
4756
paths:
4857
- phy_testvectors.tar.gz
49-
expire_in: "7 days"
58+
expire_in: "30 days"
5059

51-
push:
52-
stage: public
60+
coverity-agpl:
61+
extends: .coverity_base
62+
stage: private
5363
rules:
5464
- if: $ON_TAG
55-
when: manual
56-
allow_failure: false
65+
before_script:
66+
- export PROJECT_NAME="srsRAN_5G_agpl"
67+
- export DESCRIPTION="srsRAN Project AGPL build"
68+
- export COV_TOKEN="${COVERITY_TOKEN_AGPL}"
69+
needs:
70+
- job: update agpl main
71+
optional: false
72+
artifacts: false
73+
74+
.publish:
75+
stage: public
5776
interruptible: false
5877
image: alpine:3.16.0 # sh entrypoint
5978
variables:
6079
GIT_STRATEGY: none
6180
PRIVATE_BRANCH: agpl_main
6281
PUBLIC_REPO: srsran/srsRAN_Project
63-
PUBLIC_BRANCH: main
82+
PUBLIC_BRANCH: ""
6483
before_script:
6584
- apk add git
6685
script:
@@ -71,16 +90,57 @@ push:
7190
# Push code to github main
7291
- git push github_public ${PRIVATE_BRANCH}:${PUBLIC_BRANCH}
7392

74-
release:
93+
publish branch test:
94+
extends: .publish
95+
rules:
96+
- if: $ON_TAG
97+
when: manual
98+
allow_failure: false
99+
variables:
100+
PUBLIC_BRANCH: test
101+
needs:
102+
- job: update agpl main
103+
optional: false
104+
artifacts: false
105+
106+
publish main:
107+
extends: .publish
108+
rules:
109+
- if: $ON_TAG
110+
when: manual
111+
allow_failure: false
112+
variables:
113+
PUBLIC_BRANCH: main
114+
needs:
115+
- job: publish branch test
116+
optional: false
117+
artifacts: false
118+
119+
notify main published:
120+
extends: .notifier
75121
stage: public
122+
rules:
123+
- if: $ON_TAG
124+
needs:
125+
- job: publish main
126+
optional: false
127+
artifacts: false
128+
variables:
129+
CI_DESCRIPTION: "Public GitHub Updated"
130+
MSG: "main branch has been updated."
131+
SLACK_CHANNEL: $SLACK_CHANNEL_OK
132+
LEVEL: "ok"
133+
134+
release public:
135+
stage: release
76136
rules:
77137
- if: $ON_TAG
78138
when: manual
79139
allow_failure: false
80140
interruptible: false
81141
image: alpine:3.16.0 # sh entrypoint
82142
needs:
83-
- job: push
143+
- job: publish main
84144
optional: false
85145
artifacts: false
86146
- job: generate testvector tar gz
@@ -131,3 +191,19 @@ release:
131191
-H "Content-Type: application/octet-stream" \
132192
https://uploads.github.com/repos/${PUBLIC_REPO}/releases/${RELEASE_ID}/assets?name=${ARTIFACT} \
133193
--data-binary "@${CI_PROJECT_DIR}/${ARTIFACT}"
194+
195+
notify release published:
196+
extends: .notifier
197+
stage: release
198+
rules:
199+
- if: $ON_TAG
200+
needs:
201+
- job: release public
202+
optional: false
203+
artifacts: false
204+
variables:
205+
CI_DESCRIPTION: "Public Release created on GitHub"
206+
SLACK_CHANNEL: $SLACK_CHANNEL_OK
207+
LEVEL: "ok"
208+
before_script:
209+
- MSG="release_${CI_COMMIT_TAG//./_} created"

.gitlab/ci/release/auto_merge.sh

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ rm_deleted_by_them() {
2929
# Checks the git status and tries to `git rm` the files removed from
3030
# the target branch to the commit.
3131
rm_deleted_by_us() {
32+
echo "=================="
33+
echo "= Remove deleted ="
34+
echo "=================="
35+
3236
delete_name="deleted by us:"
3337
delete_size_next=${#delete_name}+3
3438
lines=$(git status)
@@ -45,6 +49,10 @@ rm_deleted_by_us() {
4549

4650
# Fixes the conflicts using theirs and adds them to the commit.
4751
fix_conflicts_using_theirs() {
52+
echo "================="
53+
echo "= Fix conflicts ="
54+
echo "================="
55+
4856
conflict_name="both modified:"
4957
conflict_size_next=${#conflict_name}+3
5058
lines=$(git status)
@@ -54,6 +62,7 @@ fix_conflicts_using_theirs() {
5462
if [[ "$status" == "$conflict_name" ]]; then
5563
path_name=${line:$conflict_size_next:${#line}}
5664
echo "Resolving using theirs $path_name"
65+
git diff ORIG_HEAD MERGE_HEAD "$path_name"
5766
git checkout --theirs "$path_name"
5867
git add "$path_name"
5968
fi
@@ -62,12 +71,20 @@ fix_conflicts_using_theirs() {
6271
}
6372

6473
remove_lfs_files() {
74+
echo "===================="
75+
echo "= Remove lfs files ="
76+
echo "===================="
77+
6578
while read -r line; do
6679
git rm --cached "$line"
6780
done < <(git lfs ls-files | sed -r 's/^.{13}//')
6881
}
6982

7083
update_headers() {
84+
echo "=================="
85+
echo "= Update headers ="
86+
echo "=================="
87+
7188
# for actual source and header files
7289
find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.h.in" \) ! -path "*/external/*" ! -name "rfnoc_test.cc" -exec perl -0777 -pi -e "s{/\*.*?\*/}{/*
7390
*
@@ -92,7 +109,7 @@ update_headers() {
92109
*/}s" {} \;
93110

94111
# for CMake/YML files
95-
find . -type f -\( -name "CMakeLists.txt" -o -name "*.cmake" -o -name "*.yml" -o -name "*.sh" \) ! -path "*/configs/*" ! -path "*/.gitlab/*" ! -name "FindBackward.cmake" ! -name "FindRapidJSON.cmake" ! -name "CheckCSourceRuns.cmake" ! -name "CheckFunctionExistsMath.cmake" -exec perl -0777 -pi -e "s/#[^!][\s\S]*?(?=\n.*?=|\n\n)/#
112+
find . -type f -\( -name "CMakeLists.txt" -o -name "*.cmake" -o -name "*.yml" -o -name "*.sh" \) ! -path "*/configs/*" ! -path "*/.github/*" ! -path "*/.gitlab/*" ! -name "FindBackward.cmake" ! -name "FindRapidJSON.cmake" ! -name "CheckCSourceRuns.cmake" ! -name "CheckFunctionExistsMath.cmake" -exec perl -0777 -pi -e "s/#[^!][\s\S]*?(?=\n.*?=|\n\n)/#
96113
# Copyright 2021-$(date +%Y) Software Radio Systems Limited
97114
#
98115
# This file is part of srsRAN
@@ -115,14 +132,15 @@ update_headers() {
115132

116133
main() {
117134
# Check number of args
118-
if (($# != 2)); then
135+
if [ $# != 2 ] && [ $# != 3 ]; then
119136
echo >&2 "Please call script with source branch and target branch as argument"
120-
echo >&2 "E.g. ./auto_merge.sh <source_branch> <target_branch>"
137+
echo >&2 "E.g. ./auto_merge.sh <source_branch> <target_branch> [dryrun]"
121138
exit 1
122139
fi
123140

124141
local source_branch=$1
125142
local target_branch=$2
143+
local mode="${3:-push}"
126144

127145
# Checkout target branch
128146
git fetch -q origin "$target_branch"
@@ -132,26 +150,27 @@ main() {
132150
fi
133151

134152
# Merge
153+
echo "========="
154+
echo "= Merge ="
155+
echo "========="
135156
git fetch -q origin "$source_branch"
136-
if ! git merge "$source_branch"; then
137-
# Conflicts
157+
# Git merge will always generate a merge commit because history is different in both branches
158+
if ! git merge "$source_branch" -m "Update main"; then
159+
# There are conflicts
138160
git status
139161
rm_deleted_by_us
140162
rm_deleted_by_them
141163
fix_conflicts_using_theirs
142164
git commit --no-edit
143165
fi
144-
145-
# Remove any remaining lfs files
146166
remove_lfs_files
147-
git commit -a --amend --no-edit
148-
149-
# Update headers
150167
update_headers
151-
git commit -a -m "Adding AGPL copyright to new files"
168+
git commit -a --amend --no-edit
152169

153170
# Push
154-
git push origin "$target_branch"
171+
if [ "$mode" = "push" ]; then
172+
git push origin "$target_branch"
173+
fi
155174
}
156175

157176
main "$@"

0 commit comments

Comments
 (0)