Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
28210cd
common: tools: add identifier pool
mlohvynenko Jun 30, 2025
ad29106
common: cloudprotocol: add state structures
mlohvynenko Jun 30, 2025
62f1545
cm: storagestate: add storage state interfaces
mlohvynenko Jun 26, 2025
e020fb1
common: types: add less operator for instance ident
mlohvynenko Jul 1, 2025
32f035d
common: crypto: support SHA3-224 hash algorithm
mlohvynenko Jul 1, 2025
d2783f4
common: tools: enhance fs platform interface with set user quota
mlohvynenko Jul 2, 2025
b4eb07c
common: config: remove redundant sha1 digest size definition
mlohvynenko Jul 2, 2025
a5fd070
cm: communication: add communication interface
mlohvynenko Jul 3, 2025
2049308
sm: common: move types common to cm & sm to common folder
mykola-kobets-epam Jul 3, 2025
fb51304
cm: add networkmanager interface
mykola-kobets-epam Jul 3, 2025
4352d1b
cm: add imageprovider interface
mykola-kobets-epam Jul 3, 2025
ed30d38
cm: add nodeinfoprovider interface
mykola-kobets-epam Jul 3, 2025
cb57da3
cm: add nodemanager interface
mykola-kobets-epam Jul 3, 2025
22411af
cm: add resourcemanager interface
mykola-kobets-epam Jul 3, 2025
beb0a3b
cm: add storage interface
mykola-kobets-epam Jul 3, 2025
6730f67
cm: networkmanager: extend allow con size
Jul 23, 2025
885da28
common: tools: mark enum stringer class constructors as constexpr
mlohvynenko Jul 16, 2025
8633d2e
common: types: add failed item status enum value
mlohvynenko Jul 22, 2025
75197b3
common: cloudprotocol: add supported cloud message type enum values
mlohvynenko Jul 18, 2025
5f7d2b6
common: cloudprotocol: add comparison operators for states
mlohvynenko Jul 11, 2025
250ea3e
common: types: update instance status structure
mlohvynenko Jul 16, 2025
8ca2b34
common: cloudprotocol: add unit config status structure
mlohvynenko Jul 16, 2025
14d2aca
common: cloudprotocol: add monitoring message
mlohvynenko Jul 17, 2025
c5e4fa0
common: cloudprotocol: log: remove log message type enum
mlohvynenko Jul 17, 2025
d94a20c
common: cloudprotocol: align request log message with protocol
mlohvynenko Jul 17, 2025
d48229a
common: cloudprotocol: add alerts cloud message
mlohvynenko Jul 18, 2025
3d64803
common: crypto: define certificate chains count constant
mlohvynenko Jul 18, 2025
ecc2c84
common: cloudprotocol: add certificates messages
mlohvynenko Jul 18, 2025
6244294
common: cloudprotocol: add provisioning cloud messages
mlohvynenko Jul 21, 2025
15cbe33
common: types: move bearer token len constant to types
mlohvynenko Jul 21, 2025
1ab3260
common: cloudprotocol: add service discovery messages
mlohvynenko Jul 21, 2025
d806248
common: cloudprotocol: add cloud protocol envvars messages
mlohvynenko Jul 22, 2025
77f8c07
common: cloudprotocol: add cloud message structures
mlohvynenko Jul 11, 2025
51488b9
cm: communication: update interface to have a single send method
mlohvynenko Jul 18, 2025
dd65c77
cm: communication: add message handler interface
mlohvynenko Jul 11, 2025
5560fab
cm: launcher: nodemanager: increase state checksum size
mlohvynenko Jul 24, 2025
783fc41
build: add parallel option to specify number of jobs
mlohvynenko Jul 24, 2025
b85375a
common: cloudprotocol: move unit status to cloudprotocol
mlohvynenko Jul 25, 2025
798a056
common: cloudprotocol: add unit config structure
mlohvynenko Jul 25, 2025
90c27a0
common: cloudprotocol: add desired status message
mlohvynenko Jul 25, 2025
f8bed6c
cmake: move AddModule.cmake from aos_core_cpp repo
al1img Jul 28, 2025
4c7c579
common: combine headers with appropriate sources
al1img Jul 28, 2025
8c2b8af
common: fix includes for new dir structure
al1img Jul 29, 2025
9570d78
cmake: add HEADERS params to AddModule
al1img Jul 30, 2025
57d7aca
cmake: add OBJECTS params to AddModule
al1img Aug 5, 2025
9f64b0d
common: cmake: update cmake files to make common buildable
al1img Jul 30, 2025
6aba176
common: change header guards to match Aos core pattern
al1img Jul 30, 2025
b674a04
common: tests: move tests sources to appropriate modules
al1img Jul 30, 2025
d7318ad
common: tests: remove intermediate var from softhsm.cmake
al1img Jul 30, 2025
efc970e
common: tests: set monitoring variables in testconfig.hpp
al1img Jul 30, 2025
31e50c5
common: tests: fix includes for new dir structure
al1img Jul 30, 2025
213890a
common: tests: cmake: update cmake files to make tests buildable
al1img Jul 30, 2025
109d14b
common: tests: cmake: move applying test config from main to core cmake
al1img Jul 30, 2025
3ac6d01
common: tools: tests: fix log module in log test
al1img Jul 30, 2025
77deeb5
common: tests: change header guards to match Aos core pattern
al1img Jul 31, 2025
5f871a0
iam: combine headers with appropriate sources
al1img Jul 30, 2025
7106418
iam: fix includes for new dir structure
al1img Jul 31, 2025
987ff98
iam: cmake: update cmake files to make common buildable
al1img Jul 31, 2025
fa8d5d0
iam: change header guards to match Aos core pattern
al1img Jul 31, 2025
9a4f122
iam: tests: move tests sources to appropriate modules
al1img Jul 31, 2025
146a6de
iam: tests: fix includes for new dir structure
al1img Jul 31, 2025
34be4e6
iam: tests: cmake: update cmake files to make tests buildable
al1img Jul 31, 2025
abdcab3
iam: tests: change header guards to match Aos core pattern
al1img Jul 31, 2025
c51cbe0
sm: combine headers with appropriate sources
al1img Jul 31, 2025
5bf8cd3
sm: fix includes for new dir structure
al1img Jul 31, 2025
2519e28
sm: cmake: update cmake files to make common buildable
al1img Jul 31, 2025
042ccdb
sm: change header guards to match Aos core pattern
al1img Jul 31, 2025
aad6ea1
sm: tests: move tests sources to appropriate modules
al1img Jul 31, 2025
468e962
tests: move AOS_CONFIG_LAUNCHER_RUNTIME_DIR from cmake to testconfig.hpp
al1img Jul 31, 2025
a47c045
sm: tests: fix includes for new dir structure
al1img Jul 31, 2025
c66bb95
sm: tests: cmake: update cmake files to make tests buildable
al1img Jul 31, 2025
0c0063b
sm: tests: change header guards to match Aos core pattern
al1img Jul 31, 2025
9e59848
cm: combine headers with appropriate sources
al1img Jul 31, 2025
ca8d704
cm: imagemanger: move image provider to iamgemanager namespace
al1img Jul 31, 2025
65798fc
cm: launcher: move launcher instances to launcher namespace
al1img Jul 31, 2025
5605756
cm: move all headers to cm doxygen group
al1img Jul 31, 2025
428b370
cm: fix includes for new dir structure
al1img Jul 31, 2025
379b920
cm: cmake: update cmake files to make common buildable
al1img Jul 31, 2025
81703f9
cm: change header guards to match Aos core pattern
al1img Jul 31, 2025
a239aad
tests: move mock headers to corresponding Aos componenets
al1img Jul 31, 2025
1854bbd
tests: move stubs headers to corresponding Aos componenets
al1img Jul 31, 2025
b724c76
certhandler: move certmodules, certprovider into certhandler module
al1img Jul 31, 2025
52fdf9e
identhandler: move identmodules into identhandler module
al1img Jul 31, 2025
474256b
cmake: fix excluding from lcov tests path's
al1img Aug 4, 2025
ec0ec47
ci: fix excluding from clang-format 3rd parties files
al1img Aug 4, 2025
3fbf599
ci: update sonarqube-scan-action to v5
al1img Aug 4, 2025
397d92c
ci: sonarqube: set connection timeout to 6000 seconds
al1img Aug 5, 2025
01eb61f
ci: fix sonar sources and tests path's
al1img Aug 4, 2025
3308b8b
common: tools: fix lint warning in ringbuffer.hpp
al1img Aug 4, 2025
79ab57c
docker: move docker files from aos_core_cpp
al1img Aug 4, 2025
8ed46ff
doc: fix link warning in README.md
al1img Aug 4, 2025
a05e3d4
common: tests: utils: move tests utils to tests::utils namespace
al1img Aug 5, 2025
6904579
cmake: make add_moudle define PUBLIC
al1img Aug 5, 2025
da33592
cmake: set required cmake required version to 3.23
mlohvynenko Aug 6, 2025
05e16fc
common: cloudprotocol: rename cloudprotocol.hpp to common.hpp
al1img Aug 11, 2025
3aa3cc3
common: cloudprotocol: rename cloudmessage.hpp to protocol.hpp
al1img Aug 11, 2025
4b2397f
common: cloudprotocol: add Aos identifier struct
al1img Aug 11, 2025
fec7790
common: fix strings array name in Aos enums
al1img Aug 11, 2025
ec247db
common: iam: rename NodeStatus to NodeState
al1img Aug 11, 2025
af60265
sm: resourcemanager: temporary use own NodeConfig struct
al1img Aug 12, 2025
2b1fd50
common: types: add dedicated const for CPU variant len cCPUVariantLen
al1img Aug 13, 2025
e14f7f6
common: cloudprotocol: add desired status message
al1img Aug 12, 2025
8a4db30
common: cloudprotocol: shorthand cert secret and cert desc consts
al1img Aug 12, 2025
9e486ae
common: cloudprotocol: use calculated value for cert chain len
al1img Aug 12, 2025
7bc3b17
common: config: move AOS_CONFIG_MAX_NUM_EXPOSED_PORTS to types consts
al1img Aug 13, 2025
747da84
cm: networkmanager: move CONNECTIONS_PER_INSTANCE_MAX_COUNT to CM
al1img Aug 13, 2025
b7102d7
common: cloudprotocol: use default value for install cert status
al1img Aug 13, 2025
0d20af5
common: tools: suppress cppcheck templateRecursion for Array
al1img Aug 20, 2025
8fc23ac
build: remove unused variables from build.sh
al1img Aug 26, 2025
a21bfbe
build: allow continue build with --clean option
al1img Aug 26, 2025
c17694c
build: add --build-type option to select build type
al1img Aug 26, 2025
f043768
ci: add relase build on CI
al1img Aug 26, 2025
89a9dc5
cmake: increase stack usage warning up to 8192 bytes
al1img Aug 26, 2025
4390ca3
common: monitoring: fix stack size issue
Aug 21, 2025
fe25f15
Revert "common: iam: rename NodeStatus to NodeState"
al1img Aug 28, 2025
d7190a7
common: cloudprotocol: add NodeState enum
al1img Aug 28, 2025
81c79fa
common: cloudprotocol: fix includes after renaming
al1img Aug 28, 2025
6d6885a
common: types: move CertType and UpdateItemType to common types
al1img Aug 28, 2025
ac598cc
common: cloudprotocol: fix typo in cCodeNameLen const
al1img Aug 28, 2025
9990bb4
common: cloudprotocol: use common cDescriptionLen const for cert
al1img Aug 28, 2025
baf0af7
common: cloudprotocol: use cMaxNumURLs for max URLs items
al1img Aug 28, 2025
37e00c6
common: types: add "error" status for NodeStatus enum
al1img Aug 28, 2025
74d19e6
common: cloudprotocol: remove BaseState from state messages
al1img Aug 28, 2025
8af6df9
common: tools: use String instead of StaticString in StringToUUID
al1img Aug 28, 2025
172ab1f
common: cloudprotocol: make node identifier in NodeConfig optional
al1img Aug 28, 2025
a5129be
build: remove include and tests file filter from lint
al1img Aug 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 11 additions & 7 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ jobs:
fetch-depth: 0

- name: Install build wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v4
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v5

- name: Build
- name: Build (Release)
run: |
./build.sh build --ci
./build.sh build --build-type Release

- name: Build (Debug)
run: |
./build.sh build --ci --clean

- name: Test
run: |
Expand All @@ -62,9 +66,9 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.total

- name: SonarQube analysis
- name: SonarQube analysis (on push)
if: github.event_name == 'push'
uses: SonarSource/sonarqube-scan-action@v4
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Expand All @@ -73,9 +77,9 @@ jobs:
--define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
--define sonar.coverageReportPaths=build/coverage_sonarqube.xml

- name: SonarQube analysis
- name: SonarQube analysis (on pull request)
if: github.event_name == 'pull_request_target'
uses: SonarSource/sonarqube-scan-action@v4
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: jidicula/[email protected]
with:
clang-format-version: "15"
exclude-regex: src\/common\/crypto\/mbedtls\/drivers\/.*|mbedtls_config\.h|include\/aos\/common\/pkcs11\/cryptoki/.*|seqoid\.hpp
exclude-regex: src\/core\/common\/crypto\/mbedtls\/drivers\/.*|mbedtls_config\.h|src\/core\/common\/pkcs11\/cryptoki/.*|seqoid\.hpp

- name: Run cmake-format style check
run: |
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and push docker image

on:
push:
paths:
- "docker/**"
- ".github/workflows/docker-build.yml"

branches:
- main
- develop
- feature*

defaults:
run:
working-directory: ./docker

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to github container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup docker buildx
uses: docker/setup-buildx-action@v3

- name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/aos-core-build:latest
47 changes: 13 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
# SPDX-License-Identifier: Apache-2.0
#

cmake_minimum_required(VERSION 3.19)

# Check compiler using static library instead of applicion
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
cmake_minimum_required(VERSION 3.23)

project("aos_core_lib_cpp")

Expand All @@ -34,8 +31,9 @@ message(STATUS)
# Config
# ######################################################################################################################

set(AOS_CORE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(AOS_STACK_USAGE 4096)
# Check compiler using static library instead of application
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(AOS_STACK_USAGE 8192)

# ######################################################################################################################
# Compiler flags
Expand All @@ -47,15 +45,12 @@ set(CMAKE_CXX_FLAGS "${common_flags} ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${common_flags} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_STANDARD 17)

if(WITH_TEST)
add_definitions(-include ${AOS_CORE_LIB_DIR}/include/aos/test/aoscoretestconfig.hpp)
endif()

# ######################################################################################################################
# Dependencies
# ######################################################################################################################

set(CMAKE_MODULE_PATH ${AOS_CORE_LIB_DIR}/cmake)
set(VERSION_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

if(WITH_TEST)
find_package(GTest REQUIRED)
Expand All @@ -70,7 +65,7 @@ if(WITH_COVERAGE)

append_coverage_compiler_flags()

set(COVERAGE_EXCLUDES "build/*" "tests/*" "/usr/*")
set(COVERAGE_EXCLUDES "build/*" "src/core/*/*/tests/*" "/usr/*")
set(GCOVR_ADDITIONAL_ARGS --gcov-ignore-parse-errors=negative_hits.warn_once_per_file)

setup_target_for_coverage_lcov(
Expand All @@ -85,28 +80,6 @@ if(WITH_COVERAGE)
)
endif()

# ######################################################################################################################
# Includes
# ######################################################################################################################

include_directories(include)

# ######################################################################################################################
# Targets
# ######################################################################################################################

add_subdirectory(src/common)
add_subdirectory(src/sm)
add_subdirectory(src/iam)

if(WITH_TEST)
add_subdirectory(tests)
endif()

# ######################################################################################################################
# Doc
# ######################################################################################################################

if(WITH_DOC)
find_package(Doxygen)

Expand All @@ -120,3 +93,9 @@ if(WITH_DOC)
VERBATIM
)
endif()

# ######################################################################################################################
# Subdirectories
# ######################################################################################################################

add_subdirectory(src)
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,27 @@ cd build/
make install
```

## Use docker container

Build container:

```console
docker build -t aos-core-build:latest -f docker/Dockerfile .
```

Run container:

```console
docker run -v ${PWD}:/opt/aos_core_cpp -w /opt/aos_core_cpp -it --rm aos-core-build:latest
```

All above commands for build, test, coverage etc. can be used inside the docker container.

## Development tools

The following tools are used for code formatting and analyzing:

| Tool | Description | Configuration | Link
| Tool | Description | Configuration | Link |
| --- | --- | --- | --- |
| `clang-format` | used for source code formatting | .clang-format | <https://clang.llvm.org/docs/ClangFormat.html> |
| `cmake-format` | used for formatting cmake files | .cmake-format | <https://github.com/cheshirekow/cmake_format> |
Expand Down
31 changes: 20 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ print_usage() {
echo " doc generates documentation"
echo
echo "Options:"
echo " --clean cleans build artifacts"
echo " --aos-service <services> specifies services (e.g., sm,mp,iam)"
echo " --clean cleans build artifacts before building"
echo " --ci uses build-wrapper for CI analysis (SonarQube)"
echo " --parallel <N> specifies number of parallel jobs for build (default: all available cores)"
echo " --build-type <type> specifies build type (default: Debug, other options: Release, RelWithDebInfo, MinSizeRel)"
echo
}

Expand Down Expand Up @@ -57,15 +58,15 @@ conan_setup() {

print_next_step "Generate conan toolchain"

conan install ./conan/ --output-folder build --settings=build_type=Debug --build=missing
conan install ./conan/ --output-folder build --settings=build_type="$ARG_BUILD_TYPE" --build=missing
}

build_project() {
print_next_step "Run cmake configure"

cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_BUILD_TYPE="$ARG_BUILD_TYPE" \
-G "Unix Makefiles" \
-DCoverage_SONARQUBE=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
Expand All @@ -77,11 +78,11 @@ build_project() {
if [ "$ARG_CI_FLAG" == "true" ]; then
print_next_step "Run build-wrapper and build (CI mode)"

build-wrapper-linux-x86-64 --out-dir "$BUILD_WRAPPER_OUT_DIR" cmake --build ./build/ --config Debug --parallel
build-wrapper-linux-x86-64 --out-dir "$BUILD_WRAPPER_OUT_DIR" cmake --build ./build/ --config "$ARG_BUILD_TYPE" --parallel "$ARG_PARALLEL_JOBS"
else
print_next_step "Run build"

cmake --build ./build/ --config Debug --parallel
cmake --build ./build/ --config "$ARG_BUILD_TYPE" --parallel "$ARG_PARALLEL_JOBS"
fi

echo
Expand All @@ -101,6 +102,16 @@ parse_arguments() {
shift
;;

--parallel)
ARG_PARALLEL_JOBS="$2"
shift 2
;;

--build-type)
ARG_BUILD_TYPE="$2"
shift 2
;;

*)
error_with_usage "Unknown option: $1"
;;
Expand All @@ -111,8 +122,6 @@ parse_arguments() {
build_target() {
if [ "$ARG_CLEAN_FLAG" == "true" ]; then
clean_build

return
fi

conan_setup
Expand Down Expand Up @@ -141,8 +150,7 @@ run_lint() {
print_next_step "Run static analysis (cppcheck)"

cppcheck --enable=all --inline-suppr --std=c++17 --error-exitcode=1 \
--suppressions-list=./suppressions.txt --project=build/compile_commands.json --file-filter='src/*' \
--file-filter='tests/*' --file-filter='include/*'
--suppressions-list=./suppressions.txt --project=build/compile_commands.json --file-filter='src/*'

echo
echo "Static analysis completed!"
Expand Down Expand Up @@ -170,8 +178,9 @@ command="$1"
shift

ARG_CLEAN_FLAG=false
ARG_AOS_SERVICES=""
ARG_CI_FLAG=false
ARG_PARALLEL_JOBS=$(nproc)
ARG_BUILD_TYPE="Debug"

case "$command" in
build)
Expand Down
Loading
Loading