-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RDKTV-31830 : split Cloud Store in a separate plugin
Reason for change: Separate plugin for separate functionality. Fixes the problem of FTA/IPC/Thunder thread pool. Test Procedure: None Risks: None Signed-off-by: Nikita Poltorapavlo <npoltorapavlo@productengine.com>
- Loading branch information
1 parent
b8a7a53
commit 9de8e9f
Showing
39 changed files
with
1,101 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: L0-CloudStore | ||
|
||
on: | ||
push: | ||
paths: | ||
- CloudStore/** | ||
- .github/workflows/*CloudStore*.yml | ||
pull_request: | ||
paths: | ||
- CloudStore/** | ||
- .github/workflows/*CloudStore*.yml | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: ${{github.repository}} | ||
|
||
- name: Install valgrind, coverage, cmake | ||
run: | | ||
sudo apt update | ||
sudo apt install -y valgrind lcov cmake | ||
- name: Build Thunder | ||
working-directory: ${{github.workspace}} | ||
run: sh +x ${GITHUB_REPOSITORY}/.github/workflows/BuildThunder.sh | ||
|
||
- name: Build | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
cmake -S ${GITHUB_REPOSITORY}/CloudStore/l0test -B build/cloudstorel0test -DCMAKE_INSTALL_PREFIX="install" -DCMAKE_CXX_FLAGS="--coverage -Wall -Werror" | ||
cmake --build build/cloudstorel0test --target install | ||
- name: Run | ||
working-directory: ${{github.workspace}} | ||
run: PATH=${PWD}/install/bin:${PATH} LD_LIBRARY_PATH=${PWD}/install/lib:${LD_LIBRARY_PATH} valgrind --tool=memcheck --log-file=valgrind_log --leak-check=yes --show-reachable=yes --track-fds=yes --fair-sched=try cloudstorel0test | ||
|
||
- name: Generate coverage | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
lcov -c -o coverage.info -d build/cloudstorel0test | ||
genhtml -o coverage coverage.info | ||
- name: Upload artifacts | ||
if: ${{ !env.ACT }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifacts | ||
path: | | ||
coverage/ | ||
valgrind_log | ||
if-no-files-found: warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: L2-CloudStore | ||
|
||
on: | ||
push: | ||
paths: | ||
- CloudStore/** | ||
- .github/workflows/*CloudStore*.yml | ||
pull_request: | ||
paths: | ||
- CloudStore/** | ||
- .github/workflows/*CloudStore*.yml | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: ${{github.repository}} | ||
|
||
- name: Install cmake, protoc, grpc_cpp_plugin, grpc | ||
run: | | ||
sudo apt update | ||
sudo apt install -y cmake protobuf-compiler protobuf-compiler-grpc libgrpc++-dev | ||
- name: Build Thunder | ||
working-directory: ${{github.workspace}} | ||
run: sh +x ${GITHUB_REPOSITORY}/.github/workflows/BuildThunder.sh | ||
|
||
- name: Build | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
cmake -S ${GITHUB_REPOSITORY}/CloudStore -B build/CloudStore -DCMAKE_INSTALL_PREFIX="install" -DCMAKE_CXX_FLAGS="-Wall -Werror" -DPLUGIN_CLOUDSTORE_MODE=Local -DPLUGIN_CLOUDSTORE_URI=ss.eu.prod.developer.comcast.com:443 | ||
cmake --build build/CloudStore --target install | ||
# Usage: | ||
# PATH=${PWD}/install/bin:${PATH} LD_LIBRARY_PATH=${PWD}/install/lib:${LD_LIBRARY_PATH} valgrind --tool=memcheck --log-file=valgrind_log --leak-check=yes --show-reachable=yes --track-fds=yes --fair-sched=try Thunder -f -c ${PWD}/install/etc/Thunder/config.json | ||
# (to stop press q & enter) | ||
# curl -d '{"jsonrpc":"2.0","id":0,"method":"org.rdk.CloudStore.setValue","params":{"namespace":"test","key":"key1","value":"1","ttl":100}}' http://localhost:55555/jsonrpc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Changelog | ||
|
||
All notable changes to this RDK Service will be documented in this file. | ||
|
||
* Each RDK Service has a CHANGELOG file that contains all changes done so far. When version is updated, add a entry in the CHANGELOG.md at the top with user friendly information on what was changed with the new version. Please don't mention JIRA tickets in CHANGELOG. | ||
|
||
* Please Add entry in the CHANGELOG for each version change and indicate the type of change with these labels: | ||
* **Added** for new features. | ||
* **Changed** for changes in existing functionality. | ||
* **Deprecated** for soon-to-be removed features. | ||
* **Removed** for now removed features. | ||
* **Fixed** for any bug fixes. | ||
* **Security** in case of vulnerabilities. | ||
|
||
* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. | ||
|
||
* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. | ||
|
||
## [1.0.0] - 2024-07-15 | ||
### Added | ||
- Add CHANGELOG | ||
|
||
### Change | ||
- Reset API version to 1.0.0 | ||
- Change README to inform how to update changelog and API version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# If not stated otherwise in this file or this component's LICENSE file the | ||
# following copyright and licenses apply: | ||
# | ||
# Copyright 2022 RDK Management | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
cmake_minimum_required(VERSION 3.14) | ||
|
||
set(PLUGIN_NAME CloudStore) | ||
find_package(WPEFramework NAMES WPEFramework Thunder) | ||
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME}) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
set(PLUGIN_CLOUDSTORE_MODE "Off" CACHE STRING "Controls if the plugin should run in its own process, in process or remote") | ||
set(PLUGIN_CLOUDSTORE_URI "" CACHE STRING "Endpoint") | ||
set(PLUGIN_CLOUDSTORE_STARTUPORDER "" CACHE STRING "To configure startup order of the plugin") | ||
|
||
add_library(${MODULE_NAME} SHARED | ||
CloudStore.cpp | ||
Module.cpp | ||
) | ||
|
||
find_package(${NAMESPACE}Plugins REQUIRED) | ||
find_package(${NAMESPACE}Definitions REQUIRED) | ||
target_link_libraries(${MODULE_NAME} PRIVATE | ||
${NAMESPACE}Plugins::${NAMESPACE}Plugins | ||
${NAMESPACE}Definitions::${NAMESPACE}Definitions | ||
) | ||
|
||
find_library(RFC_LIBRARIES NAMES rfcapi) | ||
if (RFC_LIBRARIES) | ||
find_path(RFC_INCLUDE_DIRS NAMES rfcapi.h REQUIRED) | ||
target_include_directories(${MODULE_NAME} PRIVATE ${RFC_INCLUDE_DIRS}) | ||
target_link_libraries(${MODULE_NAME} PRIVATE ${RFC_LIBRARIES}) | ||
target_compile_definitions(${MODULE_NAME} PRIVATE WITH_RFC) | ||
endif () | ||
|
||
install(TARGETS ${MODULE_NAME} | ||
DESTINATION lib/${STORAGE_DIRECTORY}/plugins) | ||
|
||
set(PLUGIN_IMPLEMENTATION ${MODULE_NAME}Implementation) | ||
add_library(${PLUGIN_IMPLEMENTATION} SHARED | ||
Module.cpp | ||
CloudStoreImplementation.cpp | ||
) | ||
|
||
target_link_libraries(${PLUGIN_IMPLEMENTATION} PRIVATE | ||
${NAMESPACE}Plugins::${NAMESPACE}Plugins | ||
${NAMESPACE}Definitions::${NAMESPACE}Definitions | ||
) | ||
|
||
find_library(IARMBUS_LIBRARIES NAMES IARMBus) | ||
if (IARMBUS_LIBRARIES) | ||
find_path(IARMBUS_INCLUDE_DIRS NAMES libIBus.h PATH_SUFFIXES rdk/iarmbus REQUIRED) | ||
find_path(IARMSYS_INCLUDE_DIRS NAMES sysMgr.h PATH_SUFFIXES rdk/iarmmgrs/sysmgr REQUIRED) | ||
target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ${IARMBUS_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS}) | ||
target_link_libraries(${PLUGIN_IMPLEMENTATION} PRIVATE ${IARMBUS_LIBRARIES}) | ||
target_compile_definitions(${PLUGIN_IMPLEMENTATION} PRIVATE WITH_SYSMGR) | ||
endif () | ||
|
||
find_package(Protobuf REQUIRED) | ||
target_link_libraries(${PLUGIN_IMPLEMENTATION} PRIVATE ${Protobuf_LIBRARIES}) | ||
|
||
add_custom_target(protoc | ||
${Protobuf_PROTOC_EXECUTABLE} --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${CMAKE_CURRENT_SOURCE_DIR}/grpc/secure_storage ${CMAKE_CURRENT_SOURCE_DIR}/grpc/secure_storage/secure_storage.proto | ||
) | ||
add_dependencies(${PLUGIN_IMPLEMENTATION} protoc) | ||
|
||
target_link_libraries(${PLUGIN_IMPLEMENTATION} PRIVATE grpc++) | ||
find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin REQUIRED) | ||
|
||
add_custom_target(protoc-gen-grpc | ||
${Protobuf_PROTOC_EXECUTABLE} --grpc_out ${CMAKE_CURRENT_BINARY_DIR} --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN} -I ${CMAKE_CURRENT_SOURCE_DIR}/grpc/secure_storage ${CMAKE_CURRENT_SOURCE_DIR}/grpc/secure_storage/secure_storage.proto | ||
) | ||
add_dependencies(${PLUGIN_IMPLEMENTATION} protoc-gen-grpc) | ||
|
||
set(PROTO_SRCS secure_storage.pb.cc secure_storage.grpc.pb.cc) | ||
target_sources(${PLUGIN_IMPLEMENTATION} PRIVATE ${PROTO_SRCS}) | ||
set_property(SOURCE ${PROTO_SRCS} PROPERTY GENERATED 1) | ||
target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
install(TARGETS ${PLUGIN_IMPLEMENTATION} | ||
DESTINATION lib/${STORAGE_DIRECTORY}/plugins) | ||
|
||
write_config(${PLUGIN_NAME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
precondition = ["Platform"] | ||
callsign = "org.rdk.CloudStore" | ||
startuporder = "@PLUGIN_CLOUDSTORE_STARTUPORDER@" | ||
|
||
configuration = JSON() | ||
|
||
rootobject = JSON() | ||
rootobject.add("mode", "@PLUGIN_CLOUDSTORE_MODE@") | ||
rootobject.add("locator", "lib@PLUGIN_IMPLEMENTATION@.so") | ||
configuration.add("root", rootobject) | ||
|
||
configuration.add("uri", "@PLUGIN_CLOUDSTORE_URI@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set(autostart true) | ||
set(preconditions Platform) | ||
set(callsign "org.rdk.CloudStore") | ||
|
||
if(PLUGIN_CLOUDSTORE_STARTUPORDER) | ||
set (startuporder ${PLUGIN_CLOUDSTORE_STARTUPORDER}) | ||
endif() | ||
|
||
map() | ||
key(root) | ||
map() | ||
kv(mode ${PLUGIN_CLOUDSTORE_MODE}) | ||
kv(locator lib${PLUGIN_IMPLEMENTATION}.so) | ||
end() | ||
kv(uri ${PLUGIN_CLOUDSTORE_URI}) | ||
end() | ||
ans(configuration) |
Oops, something went wrong.