Skip to content

Commit 45da8c1

Browse files
author
codebot
committed
Update main
# Conflicts: # apps/services/e2_metric_connector_manager.cpp # apps/services/e2_metric_connector_manager.h
2 parents e73b461 + 356a9df commit 45da8c1

File tree

171 files changed

+2744
-1203
lines changed

Some content is hidden

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

171 files changed

+2744
-1203
lines changed

.gitlab-ci.yml

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ trigger builder:
8585
- if: $ON_MR
8686
changes:
8787
paths:
88-
- .gitlab/ci/src_cache.yml
8988
- .gitlab/ci/builders.yml
9089
- .gitlab/ci/builders/**/*
9190
- docker/scripts/**/*
@@ -115,36 +114,76 @@ trigger docker:
115114
variables:
116115
PY_DIR: docker/metrics_server
117116

118-
helm:
117+
matlab nightly:
119118
stage: ci
120119
rules:
121-
- if: $CI_DESCRIPTION =~ /Weekly/
120+
- if: $CI_DESCRIPTION =~ /Nightly Build Unit Tests/
122121
variables:
123-
CI_DESCRIPTION: Synchronization with srsGNB
122+
ON_SCHEDULE: "true"
123+
CI_DESCRIPTION: Nightly
124+
SRSRAN_COMMIT: $CI_COMMIT_SHA
124125
NOTIFY_SLACK: "true"
126+
when: delayed
127+
start_in: 3 hours
125128
inherit:
126-
variables: false
129+
variables: false
127130
trigger:
128-
project: softwareradiosystems/ci/srsgnb_k8s
129-
branch: main
130-
needs:
131-
- job: trigger docker
132-
artifacts: false
131+
project: softwareradiosystems/srsgnb_matlab
132+
branch: master
133133

134-
enterprise:
134+
enterprise nightly:
135135
stage: ci
136136
rules:
137137
- if: $CI_DESCRIPTION =~ /Nightly Build Unit Tests/
138138
variables:
139+
ON_SCHEDULE: "true"
139140
CI_DESCRIPTION: Nightly
140141
SRSRAN_COMMIT: $CI_COMMIT_SHA
141142
NOTIFY_SLACK: "true"
143+
when: delayed
144+
start_in: 3 hours
142145
inherit:
143146
variables: false
144147
trigger:
145148
project: softwareradiosystems/srsran_5g_enterprise
146149
branch: main
147150

151+
matlab weekly:
152+
stage: ci
153+
rules:
154+
- if: $CI_DESCRIPTION =~ /Weekly/
155+
variables:
156+
ON_SCHEDULE: "true"
157+
CI_DESCRIPTION: Nightly
158+
SRSRAN_COMMIT: $CI_COMMIT_SHA
159+
NOTIFY_SLACK: "true"
160+
when: delayed
161+
start_in: 20 hours
162+
inherit:
163+
variables: false
164+
trigger:
165+
project: softwareradiosystems/srsgnb_matlab
166+
branch: master
167+
168+
helm weekly:
169+
stage: ci
170+
rules:
171+
- if: $CI_DESCRIPTION =~ /Weekly/
172+
variables:
173+
ON_SCHEDULE: "true"
174+
CI_DESCRIPTION: Synchronization with srsGNB
175+
NOTIFY_SLACK: "true"
176+
when: delayed
177+
start_in: 20 hours
178+
inherit:
179+
variables: false
180+
trigger:
181+
project: softwareradiosystems/ci/srsgnb_k8s
182+
branch: main
183+
needs:
184+
- job: trigger docker
185+
artifacts: false
186+
148187
################################################################################
149188
## Static
150189
################################################################################
@@ -184,7 +223,7 @@ full-code-format:
184223
image: ${CR_REGISTRY_URI}/srsgnb/codechecker:${DOCKER_BUILDER_VERSION}
185224
stage: static
186225
tags:
187-
- ${AMD64_TAG}
226+
- amd64
188227
needs:
189228
- job: builder version
190229
optional: false
@@ -298,7 +337,7 @@ clangsa:
298337
KUBERNETES_MEMORY_REQUEST: 12Gi
299338
KUBERNETES_MEMORY_LIMIT: 12Gi
300339
tags:
301-
- ${AMD64_TAG}
340+
- amd64
302341
interruptible: false
303342
timeout: 2 hours
304343
script:
@@ -400,10 +439,10 @@ unit coverage:
400439
- |
401440
export metric_prefix=""
402441
if [[ $ON_MR == "true" ]]; then metric_prefix="_pr"; fi
403-
echo "coverage${metric_prefix},pipeline=${CI_PIPELINE_ID},os=${OS} value=${coverage_value}" >> build_time_metrics.txt
442+
echo "coverage${metric_prefix},pipeline=${CI_PIPELINE_ID},os=${OS} value=${coverage_value}" >> build/build_time_metrics.txt
404443
- |
405444
influx write --host $INFLUXDB_URL --token $INFLUXDB_TOKEN --org $INFLUXDB_ORG \
406-
--bucket ci --file build_time_metrics.txt
445+
--bucket ci --file build/build_time_metrics.txt
407446
coverage: /^\s*Line coverage:\s*\d+.\d+\%/
408447
artifacts: &unit_coverage_artifacts
409448
paths:

.gitlab/ci-shared/build.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
variables:
2+
INFRASTRUCTURE_TAG:
3+
description: Computer architecture and supported instruction sets
4+
options:
5+
- amd64
6+
- amd64-avx2
7+
- amd64-avx2-avx512
8+
- arm64
9+
- on-prem-amd64
10+
- on-prem-arm64
11+
- aws-spot-amd64
12+
- aws-spot-arm64
13+
value: "amd64-avx2"
14+
OS:
15+
description: Operating system
16+
options:
17+
- "ubuntu-24.10"
18+
- "ubuntu-24.04"
19+
- "ubuntu-23.10"
20+
- "ubuntu-22.04"
21+
- "debian-12"
22+
- "debian-11"
23+
- "archlinux-latest"
24+
- "rhel-8"
25+
value: "ubuntu-24.04"
26+
COMPILER:
27+
description: Compiler to use
28+
options:
29+
- "gcc"
30+
- "clang"
31+
value: "gcc"
32+
BUILD_ARGS:
33+
description: It will be passed to cmake
34+
value: ""
35+
MAKE_ARGS:
36+
description: It will be passed to make
37+
value: ""
38+
UHD_VERSION:
39+
description: must be one version supported in the specified OS
40+
value: ""
41+
DPDK_VERSION:
42+
description: must be one version supported in the specified OS
43+
value: ""
44+
45+
.build_and_unit_template:
46+
image: ${CR_REGISTRY_URI}/srsgnb/builder-${OS}:${DOCKER_BUILDER_VERSION}
47+
variables:
48+
# TEST
49+
TEST_EXECUTION_TIMEOUT: 0
50+
# CI
51+
KUBERNETES_CPU_REQUEST: 6
52+
KUBERNETES_CPU_LIMIT: 6
53+
KUBERNETES_MEMORY_REQUEST: 12Gi
54+
KUBERNETES_MEMORY_LIMIT: 12Gi
55+
tags:
56+
- ${INFRASTRUCTURE_TAG}
57+
before_script:
58+
- |
59+
BUILD_CMD="${BUILD_ARGS}"
60+
if [ -n "${DPDK_VERSION}" ]; then
61+
BUILD_CMD="-d ${DPDK_VERSION} ${BUILD_CMD}"
62+
export LD_LIBRARY_PATH=/opt/dpdk/${DPDK_VERSION}/lib/x86_64-linux-gnu/:/opt/dpdk/${DPDK_VERSION}/lib/aarch64-linux-gnu/:${LD_LIBRARY_PATH}
63+
fi
64+
if [ -n "${UHD_VERSION}" ]; then
65+
BUILD_CMD="-u ${UHD_VERSION} ${BUILD_CMD}"
66+
export LD_LIBRARY_PATH=/opt/uhd/${UHD_VERSION}/lib:${LD_LIBRARY_PATH}
67+
fi
68+
if [ -n "${COMPILER}" ]; then
69+
BUILD_CMD="-c ${COMPILER} ${BUILD_CMD}"
70+
fi
71+
- |
72+
build_srsran() {
73+
target="$1"
74+
shift
75+
set -x
76+
builder.sh -m "-j${KUBERNETES_CPU_REQUEST} ${target}" ${BUILD_CMD} "$@" ${SRSRANDIR}
77+
{ set +x; } 2>/dev/null
78+
}
79+
- |
80+
build_plugin() {
81+
target="$1"
82+
shift
83+
set -x
84+
builder.sh -m "-j${KUBERNETES_CPU_REQUEST} ${target}" ${BUILD_CMD} "$@" ${CI_PROJECT_DIR}
85+
{ set +x; } 2>/dev/null
86+
}
87+
- |
88+
launch_tests_srsran() {
89+
cd ${SRSRANDIR}/build
90+
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
91+
set -x
92+
ctest -j${KUBERNETES_CPU_REQUEST} --schedule-random --output-on-failure --output-junit xunit.xml "$@"
93+
{ set +x; } 2>/dev/null
94+
}
95+
- |
96+
launch_tests_plugin() {
97+
cd ${CI_PROJECT_DIR}/build
98+
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
99+
set -x
100+
ctest -j${KUBERNETES_CPU_REQUEST} --schedule-random --output-on-failure --output-junit xunit.xml "$@"
101+
{ set +x; } 2>/dev/null
102+
}

.gitlab/ci-shared/e2e.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
variables:
2+
TESTBED:
3+
description: Retina Testbed Description
4+
options:
5+
- "zmq"
6+
- "zmq_uesim"
7+
- "zmq_deb"
8+
- "zmq_srsue"
9+
- "zmq_cudu"
10+
- "rf_b200"
11+
- "rf_hp"
12+
- "android_b200"
13+
- "android_x300"
14+
- "viavi"
15+
- "none"
16+
value: "zmq"
17+
MARKERS:
18+
description: Selected pytest marker (label / tag). Tests with that mark will run.
19+
value: ""
20+
KEYWORDS:
21+
description: Select tests by keyword expressions. This will run tests which contain names that match the given string expression (case-insensitive), which can include Python operators that use filenames, class names and function names as variables
22+
value: ""
23+
PYTEST_ARGS:
24+
description: Extra pytest args for the e2e suite to run
25+
value: ""
26+
RETINA_PARAM_ARGS:
27+
description: Extra retina args for the e2e suite to run
28+
value: ""
29+
RETINA_LAUNCHER_ARGS:
30+
description: Extra launcher args
31+
value: ""
32+
E2E_LOG_LEVEL:
33+
description: Log level to set for software under test in the e2e tests
34+
options:
35+
- debug
36+
- info
37+
- warning
38+
- error
39+
value: "info"
40+
41+
.load retina variables:
42+
stage: ci
43+
script:
44+
- cat ${SRSRANDIR}/.gitlab/ci/e2e/.env
45+
artifacts:
46+
reports:
47+
dotenv: ${SRSRANDIR}/.gitlab/ci/e2e/.env
48+
49+
.prepare_test:
50+
variables:
51+
KUBECONFIG_VAR_NAME: "RETINA_NAMESPACE_KUBECONFIG"
52+
KUBECONFIG_VAR_NAME_EXTRA: "RETINA_NAMESPACE_KUBECONFIG_EXTRA"
53+
before_script: &setup_kube_config
54+
- |
55+
export FORCE_COLOR=1
56+
eval K_PATH="\$$KUBECONFIG_VAR_NAME"
57+
export KUBECONFIG=$K_PATH
58+
59+
eval K_PATH_EXTRA="\$$KUBECONFIG_VAR_NAME_EXTRA"
60+
export KUBECONFIG_EXTRA=$K_PATH_EXTRA
61+
62+
.e2e-run-template:
63+
resource_group: e2e-${GROUP}
64+
timeout: 3 hours
65+
image:
66+
name: ${RETINA_REGISTRY_PREFIX}/launcher:${RETINA_VERSION}
67+
entrypoint: ["/bin/sh", "-c"]
68+
variables:
69+
ARTIFACT_COMPRESSION_LEVEL: "slowest"
70+
KUBERNETES_CPU_REQUEST: 2
71+
KUBERNETES_CPU_LIMIT: 2
72+
KUBERNETES_MEMORY_REQUEST: 2Gi
73+
KUBERNETES_MEMORY_LIMIT: 2Gi
74+
KUBERNETES_EPHEMERAL_STORAGE_REQUEST: "20G"
75+
KUBERNETES_EPHEMERAL_STORAGE_LIMIT: "20G"
76+
KUBECONFIG_VAR_NAME: "RETINA_NAMESPACE_KUBECONFIG"
77+
KUBECONFIG_VAR_NAME_EXTRA: "RETINA_NAMESPACE_KUBECONFIG_EXTRA"
78+
GROUP: zmq
79+
tags:
80+
- "${RETINA_TAG}"
81+
extends:
82+
- .prepare_test
83+
artifacts:
84+
paths:
85+
- ${SRSRANDIR}/tests/e2e/log
86+
when: always
87+
expire_in: 1 week
88+
reports:
89+
junit: ${SRSRANDIR}/tests/e2e/out.xml
90+
script:
91+
- |
92+
# Print E2E parameters
93+
echo "GROUP=${GROUP}"
94+
echo "TESTBED=${TESTBED}"
95+
echo "MARKERS=${MARKERS}"
96+
echo "KEYWORDS=${KEYWORDS}"
97+
echo "PYTEST_ARGS=${PYTEST_ARGS}"
98+
echo "RETINA_PARAM_ARGS=${RETINA_PARAM_ARGS}"
99+
echo "RETINA_LAUNCHER_ARGS=${RETINA_LAUNCHER_ARGS}"
100+
echo "E2E_LOG_LEVEL=${E2E_LOG_LEVEL}"
101+
- cd ${SRSRANDIR}
102+
# Clean LFS files
103+
- |
104+
while read -r line; do
105+
git rm --cached "$line" >/dev/null
106+
done < <(git lfs ls-files | sed -r 's/^.{13}//')
107+
echo "srsGNB sources+build size is" $(du -hs .)
108+
# Remove any existing retina resource for this group
109+
- retina-delete-orchestration-network --user-name ci_${GROUP}
110+
# Add extra config env variables to the .env file
111+
- |
112+
echo "" >> .gitlab/ci/e2e/.env
113+
cat $RETINA_CONFIG_ENV >> .gitlab/ci/e2e/.env
114+
# Modify request to shared the complete folder with the gnb container
115+
- |
116+
yq -i '(.[] | select(.type == "gnb") | .shared_files) += [{"local_path": "../../", "remote_path": env(SRSRANDIR), "is_executable": false}]' ${SRSRANDIR}/.gitlab/ci/e2e/retina_request_${TESTBED}.yml
117+
# Set username for retina
118+
- |
119+
cd tests/e2e
120+
export LOGNAME=ci_${GROUP}
121+
# Run Retina
122+
- |
123+
E2E_CMD="retina-launcher ${RETINA_LAUNCHER_ARGS} --retina-request=${SRSRANDIR}/.gitlab/ci/e2e/retina_request_${TESTBED}.yml ${PYTEST_ARGS} -k '${KEYWORDS}' -m '${MARKERS}' --register-parameter ue.all.log_level=$E2E_LOG_LEVEL gnb.all.log_level=$E2E_LOG_LEVEL ${RETINA_PARAM_ARGS}"
124+
echo "${E2E_CMD}"
125+
eval $E2E_CMD
126+
after_script:
127+
# Remove any existing retina resource for this group
128+
- *setup_kube_config
129+
- retina-delete-orchestration-network --user-name ci_${GROUP}
130+
# Push test metrics
131+
- |
132+
find . -iname "test_metrics.csv" -exec \
133+
influx write --host $INFLUXDB_URL --token $INFLUXDB_TOKEN --org $INFLUXDB_ORG \
134+
--bucket ci --file {} \;
135+
# Artifact size
136+
- echo -e "\e[0Ksection_start:`date +%s`:e2e_folder_section[collapsed=true]\r\e[0KLog folder's tree"
137+
- |
138+
print_tree() {
139+
local dir="$1"
140+
local prefix="$2"
141+
142+
# List directories first
143+
find "$dir" -mindepth 1 -maxdepth 1 -type d | while read -r subdir; do
144+
local size=$(du -sh "$subdir" | awk '{print $1}')
145+
echo "${prefix}├── $(basename "$subdir") [$size]"
146+
print_tree "$subdir" "$prefix│ "
147+
done
148+
149+
# List files afterwards
150+
find "$dir" -mindepth 1 -maxdepth 1 -type f | while read -r file; do
151+
local size=$(du -sh "$file" | awk '{print $1}')
152+
echo "${prefix}├── $(basename "$file") [$size]"
153+
done
154+
}
155+
print_tree "${SRSRANDIR}/tests/e2e/log/" ""
156+
- echo -e "\e[0Ksection_end:`date +%s`:e2e_folder_section\r\e[0K"
157+
- |
158+
subpath=$(echo "$SRSRANDIR" | sed "s|^$CI_PROJECT_DIR||")
159+
echo "*******************************************************************************************************************************"
160+
echo "Test report ---> https://softwareradiosystems.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts${subpath}/tests/e2e/log/report.html"
161+
echo "*******************************************************************************************************************************"

0 commit comments

Comments
 (0)