Skip to content

Commit 31d71fb

Browse files
committed
ci: test kpm_rc xApp
1 parent 27fed48 commit 31d71fb

1 file changed

Lines changed: 93 additions & 217 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 93 additions & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
# ─────────────────────────────────────────────────────────────────────────────
2-
# ns-O-RAN-flexric – CI/CD Pipeline
3-
# Trigger : workflow_dispatch (triggered manually from the GitHub Actions UI)
4-
# Runner : ubuntu-latest (Ubuntu 24.04)
5-
6-
name: ns-O-RAN-flexric CI Pipeline 2
1+
name: ns-O-RAN-flexric Consolidated CI Pipeline
72

83
on:
94
workflow_dispatch:
@@ -13,210 +8,93 @@ on:
138
- main
149

1510
jobs:
16-
17-
install-deps:
18-
name: "Install Base Dependencies"
11+
build-and-test-all:
12+
name: "Complete ns-O-RAN Build"
1913
runs-on: ubuntu-latest
2014

2115
steps:
22-
23-
- name: Update package list and install all required dependencies
24-
run: |
25-
sudo apt-get update
26-
27-
# ── E2SIM requirements ───────────────────────────────────────────
28-
sudo apt-get install -y \
29-
build-essential \
30-
git \
31-
cmake \
32-
libsctp-dev \
33-
autoconf \
34-
automake \
35-
libtool \
36-
bison \
37-
flex \
38-
libboost-all-dev
39-
40-
# ── ns-3 requirements ────────────────────────────────────────────
41-
# Note: the package name on Ubuntu is g++-13, not g++13.
42-
sudo apt-get install -y \
43-
g++-13 \
44-
python3.8 \
45-
libc6-dev
46-
47-
# ── Optional: SQLite (LENA comparison examples) ──────────────────
48-
sudo apt-get install -y sqlite3 libsqlite3-dev
49-
50-
# ── Optional: Eigen3 (MIMO features) ────────────────────────────
51-
sudo apt-get install -y libeigen3-dev
52-
53-
# ───────────────────────────────────────────────────────────────────────────
54-
# JOB 1 – E2SIM
55-
# ───────────────────────────────────────────────────────────────────────────
56-
57-
test-e2sim:
58-
name: "E2SIM Build"
59-
runs-on: ubuntu-latest
60-
needs: [install-deps]
61-
62-
steps:
63-
16+
# ───────────────────────────────────────────────────────────────────────────
17+
# 1. SYSTEM PREREQUISITES & ENVIRONMENT SETUP
18+
# ───────────────────────────────────────────────────────────────────────────
6419
- name: Checkout repository with submodules
6520
uses: actions/checkout@v4
6621
with:
6722
submodules: recursive
6823

69-
- name: Install E2SIM build dependencies
24+
- name: Install System Dependencies
7025
run: |
7126
sudo apt-get update
7227
sudo apt-get install -y \
73-
build-essential git cmake \
74-
libsctp-dev autoconf automake libtool \
75-
bison flex libboost-all-dev g++
76-
77-
- name: Set up Python 3.13
78-
uses: actions/setup-python@v5
28+
build-essential git libsctp-dev libssl-dev \
29+
autoconf automake libtool bison flex libboost-all-dev \
30+
cmake-curses-gui libpcre2-dev python3-dev \
31+
libconfig-dev libconfig++-dev sqlite3 libsqlite3-dev \
32+
libeigen3-dev ca-certificates gpg wget m4
33+
34+
- name: Setup CMake 4.2.1
35+
uses: jwlawson/actions-setup-cmake@v2
7936
with:
80-
python-version: "3.13"
81-
82-
- name: Create build directory
83-
working-directory: e2sim-kpmv3/e2sim
84-
run: mkdir -p build
37+
cmake-version: '4.2.1'
8538

86-
- name: Build E2SIM
87-
working-directory: e2sim-kpmv3/e2sim
88-
run: sudo ./build_e2sim.sh 3
89-
90-
- name: Upload e2sim build artifact
91-
uses: actions/upload-artifact@v4
39+
- name: Set up Python 3.8
40+
uses: actions/setup-python@v5
9241
with:
93-
name: e2sim-build
94-
path: e2sim-kpmv3/
95-
retention-days: 1
96-
97-
# ───────────────────────────────────────────────────────────────────────────
98-
# JOB 2 – FlexRIC
99-
# ───────────────────────────────────────────────────────────────────────────
100-
test-flexric:
101-
name: "FlexRIC Build & Install"
102-
runs-on: ubuntu-latest
103-
needs: [install-deps]
42+
python-version: "3.8"
10443

105-
steps:
106-
107-
- name: Install base apt prerequisites
44+
- name: Install GCC-13 and set as default
10845
run: |
109-
sudo apt-get update
110-
sudo apt-get install -y \
111-
build-essential git \
112-
libsctp-dev libssl-dev \
113-
cmake-curses-gui libpcre2-dev \
114-
python3-dev python3.8 \
115-
libconfig-dev libconfig++-dev \
116-
autoconf automake libtool
46+
sudo apt-get install -y gcc-13 g++-13
47+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130
48+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 130
11749
118-
- name: Install CMake ≥ 3.22 (Kitware APT repo)
50+
# ───────────────────────────────────────────────────────────────────────────
51+
# 2. BUILD E2SIM
52+
# ───────────────────────────────────────────────────────────────────────────
53+
- name: Build and Install E2SIM
54+
working-directory: e2sim-kpmv3/e2sim
11955
run: |
120-
sudo apt-get install -y ca-certificates gpg wget
121-
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
122-
| gpg --dearmor - \
123-
| sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null
124-
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] \
125-
https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \
126-
| sudo tee /etc/apt/sources.list.d/kitware.list
127-
sudo apt-get update
128-
sudo apt-get install -y cmake
129-
cmake --version
56+
mkdir -p build
57+
sudo ./build_e2sim.sh 3
58+
# THIS PART IS CRITICAL:
59+
sudo dpkg --install build/e2sim-dev_1.0.0_amd64.deb
60+
sudo ldconfig
13061
62+
# ───────────────────────────────────────────────────────────────────────────
63+
# 3. BUILD & INSTALL FLEXRIC TOOLS (SWIG, ASN1C)
64+
# ───────────────────────────────────────────────────────────────────────────
13165
- name: Install SWIG 4.1
13266
run: |
13367
git clone https://github.com/swig/swig.git
134-
cd swig
135-
git checkout release-4.1
136-
./autogen.sh
137-
./configure --prefix=/usr/
138-
make -j$(nproc)
139-
sudo make install
140-
swig -version
141-
142-
- name: Install GCC-13 and set as default compiler
143-
run: |
144-
sudo apt-get install -y gcc-13 g++-13
145-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130
146-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 130
147-
gcc --version
148-
g++ --version
68+
cd swig && git checkout release-4.1
69+
./autogen.sh && ./configure --prefix=/usr/
70+
make -j$(nproc) && sudo make install
14971
15072
- name: Install asn1c
15173
run: |
152-
sudo apt-get remove -y asn1c || true
153-
sudo apt-get install -y git autoconf automake libtool make gcc g++ m4
15474
sudo git clone https://github.com/mouse07410/asn1c /tmp/asn1c
15575
cd /tmp/asn1c
15676
sudo git checkout 940dd5fa9f3917913fd487b13dfddfacd0ded06e
157-
sudo autoreconf -iv
158-
sudo ./configure --prefix=/opt/asn1c
159-
sudo make -j$(nproc)
160-
sudo make install
161-
sudo rm -rf /tmp/asn1c
77+
sudo autoreconf -iv && sudo ./configure --prefix=/opt/asn1c
78+
sudo make -j$(nproc) && sudo make install
16279
echo "/opt/asn1c/bin" >> "$GITHUB_PATH"
163-
/opt/asn1c/bin/asn1c -version
16480
165-
166-
- name: Clone FlexRIC
81+
# ───────────────────────────────────────────────────────────────────────────
82+
# 4. BUILD & INSTALL FLEXRIC
83+
# ───────────────────────────────────────────────────────────────────────────
84+
- name: Clone and Build FlexRIC
16785
run: |
16886
git clone https://gitlab.eurecom.fr/mosaic5g/flexric.git
16987
cd flexric
170-
git checkout dev
17188
git checkout d3dc645b4
172-
173-
174-
- name: Configure FlexRIC (E2AP_V1 / KPM_V3_00)
175-
working-directory: flexric
176-
run: |
177-
mkdir build
178-
cd build
179-
cmake .. \
180-
-DE2AP_VERSION=E2AP_V1 \
181-
-DKPM_VERSION=KPM_V3_00
182-
183-
- name: Build FlexRIC
184-
working-directory: flexric/build
185-
run: make -j8
186-
187-
- name: Install FlexRIC Service Models and package for artifact
188-
working-directory: flexric/build
189-
run: |
89+
mkdir build && cd build
90+
cmake .. -DE2AP_VERSION=E2AP_V1 -DKPM_VERSION=KPM_V3_00
91+
make -j$(nproc)
19092
sudo make install
191-
sudo make DESTDIR=/tmp/flexric-install install
192-
tar czf /tmp/flexric-installed.tar.gz -C /tmp/flexric-install .
193-
194-
- name: Upload FlexRIC installed files artifact
195-
uses: actions/upload-artifact@v4
196-
with:
197-
name: flexric-install
198-
path: /tmp/flexric-installed.tar.gz
199-
retention-days: 1
200-
201-
# ───────────────────────────────────────────────────────────────────────────
202-
# JOB 3 – ns-3
203-
# ───────────────────────────────────────────────────────────────────────────
204-
test-ns3:
205-
name: "ns-3 mmWave Build"
206-
runs-on: ubuntu-latest
207-
needs: [test-e2sim, test-flexric]
208-
209-
steps:
210-
211-
- name: Checkout repository
212-
uses: actions/checkout@v4
213-
- name: Initialise mmwave-LENA-oran submodule
214-
run: |
215-
git submodule init
216-
git submodule update --recursive -- mmwave-LENA-oran
217-
echo "mmwave-LENA-oran contents:"
218-
ls mmwave-LENA-oran/
93+
sudo ldconfig
21994
95+
# ───────────────────────────────────────────────────────────────────────────
96+
# 5. CONFIGURE & BUILD NS-3
97+
# ───────────────────────────────────────────────────────────────────────────
22098
- name: Ensure oran-interface is populated
22199
run: |
222100
ORAN_DIR="mmwave-LENA-oran/contrib/oran-interface"
@@ -231,60 +109,58 @@ jobs:
231109
- name: Ensure src/nr is populated
232110
run: |
233111
NR_DIR="mmwave-LENA-oran/src/nr"
234-
if [ -z "$(ls -A "$NR_DIR" 2>/dev/null)" ]; then
235-
echo "src/nr is empty. cloning it from GitHub..."
112+
if [ ! -f "$NR_DIR/CMakeLists.txt" ]; then
113+
echo "src/nr missing CMakeLists.txt – cloning ns3-oran-lena-nr and checking out Lena_oran..."
236114
rm -rf "$NR_DIR"
237-
git clone https://github.com/MinaYonan123/ns3-oran-lena-nr.git "$NR_DIR"
115+
git clone https://github.com/MinaYonan123/ns3-oran-lena-nr.git mmwave-LENA-oran/src/nr
116+
cd mmwave-LENA-oran/src/nr
117+
git checkout Lena_oran
238118
else
239119
echo "src/nr already populated – skipping clone."
240120
fi
241121
242-
- name: Install system build dependencies
122+
- name: Build ns-3
123+
working-directory: mmwave-LENA-oran
243124
run: |
244-
sudo apt-get update
245-
sudo apt-get install -y \
246-
build-essential git cmake \
247-
libsctp-dev libssl-dev \
248-
libpcre2-dev \
249-
python3-dev python3.8 \
250-
libconfig-dev libconfig++-dev
251-
252-
- name: Install GCC-13 and set as default compiler
125+
./ns3 clean
126+
./ns3 configure
127+
./ns3 build -j$(nproc)
128+
129+
- name: Execution and Integration Test
130+
shell: bash
253131
run: |
254-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130
255-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 130
256132
257-
- name: Set up Python 3.13
258-
uses: actions/setup-python@v5
259-
with:
260-
python-version: "3.13"
133+
$GITHUB_WORKSPACE/flexric/build/examples/ric/nearRT-RIC > /tmp/ric.log 2>&1 &
134+
RIC_PID=$!
135+
echo "RIC started (PID: $RIC_PID)"
261136
262-
- name: Download e2sim build artifact
263-
uses: actions/download-artifact@v4
264-
with:
265-
name: e2sim-build
266-
path: e2sim-kpmv3/
137+
cd $GITHUB_WORKSPACE/mmwave-LENA-oran
138+
./ns3 run scratch/scenario-zero.cc > /tmp/ns3.log 2>&1 &
139+
NS3_PID=$!
140+
echo "ns-3 E2-Node started (PID: $NS3_PID)"
267141
268-
- name: Install e2sim from downloaded artifact
269-
run: |
270-
sudo dpkg --install e2sim-kpmv3/e2sim/build/e2sim-dev_1.0.0_amd64.deb
271-
sudo ldconfig
142+
echo "Waiting for E2 connection setup (20s)..."
143+
sleep 20
272144
273-
- name: Download FlexRIC installed files artifact
274-
uses: actions/download-artifact@v4
275-
with:
276-
name: flexric-install
277-
path: ${{ github.workspace }}
145+
kill -0 $RIC_PID 2>/dev/null || { echo "FAIL: RIC died during startup"; tail -n 20 /tmp/ric.log; exit 1; }
146+
kill -0 $NS3_PID 2>/dev/null || { echo "FAIL: ns-3 died during startup"; tail -n 20 /tmp/ns3.log; exit 1; }
278147
279-
- name: Restore FlexRIC installed files to system paths
280-
run: |
281-
sudo tar xzf flexric-installed.tar.gz -C /
282-
sudo ldconfig
148+
echo "Starting xApp..."
149+
$GITHUB_WORKSPACE/flexric/build/examples/xApp/c/kpm_rc/xapp_kpm_rc > /tmp/xapp.log 2>&1
150+
XAPP_EXIT=$?
283151
284-
- name: Configure ns-3
285-
working-directory: mmwave-LENA-oran
286-
run: ./ns3 configure --disable-python --enable-examples
152+
echo "=== RIC log (last 10 lines) ==="
153+
tail -n 10 /tmp/ric.log || true
154+
echo "=== ns-3 log (last 10 lines) ==="
155+
tail -n 10 /tmp/ns3.log || true
156+
echo "=== xApp log (last 30 lines) ==="
157+
tail -n 30 /tmp/xapp.log || true
287158
288-
- name: Build ns-3
289-
working-directory: mmwave-LENA-oran
290-
run: ./ns3 build
159+
kill $RIC_PID $NS3_PID 2>/dev/null || true
160+
161+
if [ $XAPP_EXIT -eq 0 ]; then
162+
echo "SUCCESS: xApp completed its test run successfully."
163+
else
164+
echo "FAIL: xApp exited with code $XAPP_EXIT"
165+
exit 1
166+
fi

0 commit comments

Comments
 (0)