Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 107 additions & 107 deletions .github/workflows/docker-CI.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,107 @@
name: Build xApp Binary

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
E2AP_VERSION: E2AP_V3
KPM_VERSION: KPM_V3_00
C_COMPILER: gcc-13
CPP_COMPILER: g++-13

jobs:
build:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: Setup and install Swig
uses: mmomtchev/setup-swig@v1
with:
version: v4.2.1

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: |
libsctp-dev \
libpcre2-dev \
ninja-build

- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build \
-GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DE2AP_VERSION=${{env.E2AP_VERSION}} \
-DKPM_VERSION=${{env.KPM_VERSION}} \
-DCMAKE_C_FLAGS_RELEASE="-O3" \
-DCMAKE_CXX_FLAGS_RELEASE="-O3" \
-DCMAKE_C_COMPILER=${{env.C_COMPILER}} \
-DCMAKE_CXX_COMPILER=${{env.CPP_COMPILER}}

- name: Build xApp and service models
working-directory: ${{github.workspace}}/build
run: |
ninja xapp_iqos \
libkpm_sm.so \
librc_sm.so \
libmac_sm.so \
libslice_sm.so \
libpdcp_sm.so \
libgtp_sm.so \
libtc_sm.so \
librlc_sm.so

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}

- name: Copy binaries
run: bash scripts/cpRicFiles.sh

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
muriloavlis/iqos-xapp
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
file: "docker/Dockerfile"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}



name: Build xApp Binary
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
E2AP_VERSION: E2AP_V3
KPM_VERSION: KPM_V3_00
C_COMPILER: gcc-13
CPP_COMPILER: g++-13
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup and install Swig
uses: mmomtchev/setup-swig@v1
with:
version: v4.2.1
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: |
libsctp-dev \
libpcre2-dev \
ninja-build
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build \
-GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DE2AP_VERSION=${{env.E2AP_VERSION}} \
-DKPM_VERSION=${{env.KPM_VERSION}} \
-DCMAKE_C_FLAGS_RELEASE="-O3" \
-DCMAKE_CXX_FLAGS_RELEASE="-O3" \
-DCMAKE_C_COMPILER=${{env.C_COMPILER}} \
-DCMAKE_CXX_COMPILER=${{env.CPP_COMPILER}}
- name: Build xApp and service models
working-directory: ${{github.workspace}}/build
run: |
ninja xapp_iqos \
libkpm_sm.so \
librc_sm.so \
libmac_sm.so \
libslice_sm.so \
libpdcp_sm.so \
libgtp_sm.so \
libtc_sm.so \
librlc_sm.so
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Copy binaries
run: bash scripts/cpRicFiles.sh
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
muriloavlis/iqos-xapp
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
file: "docker/Dockerfile"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake-build-debug
.idea
compile_commands.json
build
cmake-build-debug
.idea
compile_commands.json
build
configs/xApp.conf
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "flexric"]
path = libs/flexric
url = https://gitlab.eurecom.fr/mosaic5g/flexric.git
branch = dev
[submodule "flexric"]
path = libs/flexric
url = https://gitlab.eurecom.fr/mosaic5g/flexric.git
branch = dev
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"files.associations": {
"assert.h": "c",
"runprediction_initialize.h": "c",
"elementwiseoperationinplace.h": "c"
}
}
118 changes: 75 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,75 @@
cmake_minimum_required(VERSION 3.15)
project(xapp_iqos VERSION 0.0.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

## Definitions
add_compile_definitions(SPDLOG_ACTIVE_LEVEL)

## Add libs
add_subdirectory(libs)

## build external libs
### SPDLOG for logs
Include(FetchContent)
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.14.1
)
FetchContent_MakeAvailable(spdlog)

## Config executable
add_executable(xapp_iqos src/main.cpp
src/logger.cpp
src/kpmManager.cpp
src/e2Info.cpp
)

## Link libraries
target_include_directories(xapp_iqos PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/libs
${CMAKE_CURRENT_SOURCE_DIR}/libs/flexric/src/xApp
)
target_link_libraries(xapp_iqos PUBLIC
e42_xapp
spdlog::spdlog $<$<BOOL:${MINGW}>:ws2_32>
-pthread
-lsctp
-ldl
)
enable_language(OBJC)
cmake_minimum_required(VERSION 3.15)
project(xapp_iqos VERSION 0.0.1 LANGUAGES CXX C ASM)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

## Enable OpenMP
find_package(OpenMP)
if(OpenMP_FOUND)
message(STATUS "OpenMP found: ${OpenMP_CXX_FLAGS}")
add_compile_definitions(_OPENMP)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
message(WARNING "OpenMP not found. Ensure it is installed for your compiler.")
endif()

## Definitions
add_compile_definitions(SPDLOG_ACTIVE_LEVEL)

## Add libs
add_subdirectory(libs)

## build external libs
### SPDLOG for logs
Include(FetchContent)
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.14.1
)
FetchContent_MakeAvailable(spdlog)

## Config executable
add_executable(xapp_iqos src/main.cpp
src/logger.cpp
src/kpmManager.cpp
src/e2Info.cpp
src/cellstr_sort.c
src/elementwiseOperationInPlace.c
src/find.c
src/getCategoryNames.c
src/insertionsort.c
src/internal_softmax.c
src/introsort.c
src/postProcessOutputToReturnCategorical.c
src/predict.c
src/predictForRNN.c
src/rtGetInf.c
src/rtGetNaN.c
src/rt_nonfinite.c
src/runPrediction.c
src/runPrediction_data.c
src/runPrediction_initialize.c
src/runPrediction_terminate.c
src/SoftmaxLayer.c
src/strcmp.c
src/strtrim.c
)

## Link libraries
target_include_directories(xapp_iqos PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/libs
${CMAKE_CURRENT_SOURCE_DIR}/libs/flexric/src/xApp
)
target_link_libraries(xapp_iqos PUBLIC
e42_xapp
spdlog::spdlog $<$<BOOL:${MINGW}>:ws2_32>
-pthread
-lsctp
-ldl
)
Loading