From 5b8d66bbacadf4feac2b2bdf23f28f7a41898679 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 7 Aug 2025 18:15:26 +0200 Subject: [PATCH] Write simple CI documentation and add sample script --- ci-scripts/README.md | 60 ++++++++++++ .../xml_files/container_5g_rfsim_simple.xml | 97 +++++++++++++++++++ doc/README.md | 2 + 3 files changed, 159 insertions(+) create mode 100644 ci-scripts/README.md create mode 100644 ci-scripts/xml_files/container_5g_rfsim_simple.xml diff --git a/ci-scripts/README.md b/ci-scripts/README.md new file mode 100644 index 0000000000..becd518e4c --- /dev/null +++ b/ci-scripts/README.md @@ -0,0 +1,60 @@ +This document outlines how to use the OAI CI framework and gives a quickstart. + +[[_TOC_]] + +# Quickstart + +There is a script `main.py` that + +- reads scenario files from XML +- executes the steps (e.g., deployment of CN/gNB/UE, attach, ping, ...) + +To simplify, a script `run_locally.sh` can be used to run a single scenario +locally. First, download images for gNB&UE (we assume you already downloaded +the CN) and tag them "latest", which is expected by `run_locally.sh`: + + docker pull oaisoftwarealliance/oai-gnb:develop + docker tag oaisoftwarealliance/oai-gnb:develop oai-gnb + docker pull oaisoftwarealliance/oai-nr-ue:develop + docker tag oaisoftwarealliance/oai-nr-ue:develop oai-nr-ue + +Now, run the scenario: + + cd ~/openairinterface5g/ci-scripts/ + ./run_locally.sh xml_files/container_5g_rfsim_simple.xml + +Output should look like + +``` +[2025-08-07 18:07:49,631] INFO: ---------------------------------------- +[2025-08-07 18:07:49,631] INFO: Creating HTML header +[2025-08-07 18:07:49,631] INFO: ---------------------------------------- +[2025-08-07 18:07:49,766] INFO: ---------------------------------------- +[2025-08-07 18:07:49,767] INFO: Starting Scenario: xml_files/container_5g_rfsim_simple.xml +[2025-08-07 18:07:49,767] INFO: ---------------------------------------- +[2025-08-07 18:07:49,767] INFO: placing all artifacts for this run in /home/richie/oai/cmake_targets/log/container_5g_rfsim_simple.xml.d/ + +[...] + +[2025-08-07 18:07:49,771] INFO: ---------------------------------------- +[2025-08-07 18:07:49,771] INFO: Test ID: 1 (#1) +[2025-08-07 18:07:49,771] INFO: Deploy OAI 5G CoreNetwork +[2025-08-07 18:07:49,771] INFO: ---------------------------------------- +``` + +it will run an end-to-end test, connecting one UE to the gNB, and ping, before +undeploying. As shown, logs will be under +`/home/richie/oai/cmake_targets/log/container_5g_rfsim_simple.xml.d/`. The +python code also produces an HTML report in `ci-scripts/test_results.html`. + +# Running with local changes + +In order to run the tests as above, with local changes, please [build images +locally](../docker/README.md). + +It is not yet possible to override an existing image with changes made locally +to a source file and run it directly through the CI framework. However, it is +possible to override an existing image with local changes, and run the scenario +manually following the console logs steps provided above. This is described in +the [5G RFsimulator +README](yaml_files/5g_rfsimulator/README.md#6-running-with-local-changes). diff --git a/ci-scripts/xml_files/container_5g_rfsim_simple.xml b/ci-scripts/xml_files/container_5g_rfsim_simple.xml new file mode 100644 index 0000000000..738ce1a077 --- /dev/null +++ b/ci-scripts/xml_files/container_5g_rfsim_simple.xml @@ -0,0 +1,97 @@ + + + rfsim-5gnr-tdd + Monolithic SA TDD gNB + wrench + + 000001 + 000002 + 000003 + 000008 + 020001 + 444444 + 100001 + + + + + Deploy_Object + Deploy OAI 5G CoreNetwork + localhost + ci-scripts/yaml_files/5g_rfsimulator + mysql oai-amf oai-smf oai-upf oai-ext-dn + + + + Deploy_Object + Deploy OAI 5G gNB RF sim SA + localhost + ci-scripts/yaml_files/5g_rfsimulator + oai-gnb + + + + Deploy_Object + Deploy OAI 5G NR-UE RF sim SA + localhost + ci-scripts/yaml_files/5g_rfsimulator + oai-nr-ue + + + + Attach_UE + Attach OAI UE (Wait for IP) + rfsim5g_ue + localhost + + + + Ping + Ping ext-dn from NR-UE + rfsim5g_ue + localhost + rfsim5g_ext_dn + localhost + -c 20 -i 0.25 + 5 + + + + Detach_UE + Detach OAI UE 1 + rfsim5g_ue + localhost + + + + Undeploy_Object + true + Undeploy all OAI 5G stack + localhost + ci-scripts/yaml_files/5g_rfsimulator + 1,0,0,0 + 1,0,0,0 + + + diff --git a/doc/README.md b/doc/README.md index 40f838750a..226592ac60 100644 --- a/doc/README.md +++ b/doc/README.md @@ -133,6 +133,8 @@ The other SDRs (AW2S, LimeSDR, ...) have no READMEs. - Component tests are under `tests/`. Currently, there is a simple CU-UP tester, see the corresponding [README.md](../tests/nr-cuup/README.md). - [TESTBenches.md](./TESTBenches.md) lists the CI setup and links to pipelines +- The CI setup uses a [custom framework](../ci-scripts/README.md) to run + end-to-end tests. # Developer tools