Skip to content

Commit

Permalink
Merge branch 'rdkcentral:sprint/24Q3' into RDKTV-29770_24Q3
Browse files Browse the repository at this point in the history
  • Loading branch information
anjuraveendran2024 authored Jul 9, 2024
2 parents ccb2d82 + d8dccf8 commit ccaf3c8
Show file tree
Hide file tree
Showing 14 changed files with 316 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/L2-PersistentStore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake -S ${GITHUB_REPOSITORY}/PersistentStore -B build/PersistentStore -DCMAKE_INSTALL_PREFIX="install" -DCMAKE_CXX_FLAGS="-Wall -Werror" -DPLUGIN_PERSISTENTSTORE_PATH="/tmp/persistentstore/l2test/test"
cmake -S ${GITHUB_REPOSITORY}/PersistentStore -B build/PersistentStore -DCMAKE_INSTALL_PREFIX="install" -DCMAKE_CXX_FLAGS="-Wall -Werror" -DPLUGIN_PERSISTENTSTORE_PATH="/tmp/persistentstore/l2test/test" -DPLUGIN_PERSISTENTSTORE_WITH_ACCOUNT_SCOPE=true -DPLUGIN_PERSISTENTSTORE_MODE=Local -DPLUGIN_PERSISTENTSTORE_URI=ss.eu.prod.developer.comcast.com:443
cmake --build build/PersistentStore --target install
# Usage:
Expand Down
3 changes: 3 additions & 0 deletions Monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ set(PLUGIN_MONITOR_WEBKITBROWSER_RESIDENT_APP "${PLUGIN_WEBKITBROWSER_RESIDENT_A
set(PLUGIN_MONITOR_WEBKITBROWSER_UX "${PLUGIN_WEBKITBROWSER_UX}" CACHE BOOL "Enable monitor for the WebKitBrowser UX plugin")
set(PLUGIN_MONITOR_WEBKITBROWSER_YOUTUBE "${PLUGIN_WEBKITBROWSER_YOUTUBE}" CACHE BOOL "Enable monitor for the WebKitBrowser Youtube plugin")
set(PLUGIN_MONITOR_SYSTEMAUDIOPLAYER "${PLUGIN_SYSTEMAUDIOPLAYER}" CACHE BOOL "Enable monitor for the SystemAudioPlayer plugin")
# By Default NetworkManager plugin Monitor is in ON state
set(PLUGIN_MONITOR_NETWORKMANAGER ON)

# Plugins built from outside of this repository have to be enabled manually
set(PLUGIN_MONITOR_AMAZON OFF CACHE BOOL "Enable monitor for the Amazon plugin")
Expand All @@ -51,6 +53,7 @@ set(PLUGIN_MONITOR_WEBKITBROWSER_APPS_MEMORYLIMIT "614400" CACHE STRING "monitor
set(PLUGIN_MONITOR_WEBKITBROWSER_RESIDENT_APP_MEMORYLIMIT "614400" CACHE STRING "monitor resident app memory limit")
set(PLUGIN_MONITOR_WEBKITBROWSER_UX_MEMORYLIMIT "614400" CACHE STRING "monitor ux memory limit")
set(PLUGIN_MONITOR_WEBKITBROWSER_YOUTUBE_MEMORYLIMIT "614400" CACHE STRING "monitor youtube memory limit")
set(PLUGIN_MONITOR_NETWORKMANAGER_MEMORYLIMIT "614400" CACHE STRING "monitor networkmanager memory limit")

# deprecated/legacy flags support
if(PLUGIN_MONITOR_APPS_MEMORYLIMIT)
Expand Down
12 changes: 12 additions & 0 deletions Monitor/Monitor.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ if boolean("@PLUGIN_MONITOR_WEBKITBROWSER_RESIDENT_APP@"):
observable_config.add("restart", restart_config)
observable_list.append(observable_config)

if boolean("@PLUGIN_MONITOR_NETWORKMANAGER@"):
observable_config = JSON()
observable_config.add("callsign", "org.rdk.NetworkManager")
observable_config.add("memory", "5")
observable_config.add("memorylimit", "@PLUGIN_MONITOR_NETWORKMANAGER_MEMORYLIMIT@")
observable_config.add("operational", "1")
restart_config = JSON()
restart_config.add("window", "60")
restart_config.add("limit", "3")
observable_config.add("restart", restart_config)
observable_list.append(observable_config)

if boolean("@PLUGIN_MONITOR_CLONED_APPS@"):
observable_config = JSON()
observable_config.add("callsign", "SearchAndDiscovery")
Expand Down
17 changes: 17 additions & 0 deletions Monitor/Monitor.config
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,23 @@ if(PLUGIN_MONITOR_WEBKITBROWSER_RESIDENT_APP)
map_append(${configuration} observables ${RESIDENT_APP_MONITOR_CONFIG})
endif()

if(PLUGIN_MONITOR_NETWORKMANAGER)
map()
kv(callsign org.rdk.NetworkManager)
kv(memory 5)
kv(memorylimit ${PLUGIN_MONITOR_NETWORKMANAGER_MEMORYLIMIT})
kv(operational 1)
key(restart)
map()
kv(window 60)
kv(limit 3)
end()
end()
ans(NETWORK_MANAGER_MONITOR_CONFIG)
map_append(${configuration} observables ___array___)
map_append(${configuration} observables ${NETWORK_MANAGER_MONITOR_CONFIG})
endif()

if(PLUGIN_MONITOR_INSTANCES_LIST)

# 'PLUGIN_MONITOR_INSTANCES_LIST' contains a semi-colon (';') separated list of Monitor observable
Expand Down
14 changes: 4 additions & 10 deletions PersistentStore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,13 @@
cmake_minimum_required(VERSION 3.14)

set(PLUGIN_NAME PersistentStore)
find_package(WPEFramework)
if (NOT WPEFramework_FOUND)
find_package(Thunder)
if (Thunder_FOUND)
add_compile_definitions(WITH_THUNDER_NAMESPACE)
endif ()
endif ()
find_package(WPEFramework NAMES WPEFramework Thunder)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(CMAKE_CXX_STANDARD 11)

set(PLUGIN_PERSISTENTSTORE_MODE "Local" CACHE STRING "Controls if the plugin should run in its own process, in process or remote")
set(PLUGIN_PERSISTENTSTORE_URI "ss.eu.prod.developer.comcast.com:443" CACHE STRING "Account scope endpoint")
set(PLUGIN_PERSISTENTSTORE_MODE "Off" CACHE STRING "Controls if the plugin should run in its own process, in process or remote")
set(PLUGIN_PERSISTENTSTORE_URI "" CACHE STRING "Account scope endpoint")
set(PLUGIN_PERSISTENTSTORE_PATH "/opt/secure/persistent/rdkservicestore" CACHE STRING "Path")
set(PLUGIN_PERSISTENTSTORE_LEGACYPATH "/opt/persistent/rdkservicestore" CACHE STRING "Previously used path")
set(PLUGIN_PERSISTENTSTORE_KEY "" CACHE STRING "Encryption key")
Expand All @@ -39,7 +33,7 @@ set(PLUGIN_PERSISTENTSTORE_MAXVALUE "3000" CACHE STRING "For single text data, i
set(PLUGIN_PERSISTENTSTORE_LIMIT "10000" CACHE STRING "Default for all text data in namespace, in bytes")
set(PLUGIN_PERSISTENTSTORE_TOKEN_COMMAND "" CACHE STRING "Shell command to get the service access token")
set(PLUGIN_PERSISTENTSTORE_STARTUPORDER "" CACHE STRING "To configure startup order of PersistentStore plugin")
set(PLUGIN_PERSISTENTSTORE_WITH_ACCOUNT_SCOPE true CACHE BOOL "Enable account scope")
set(PLUGIN_PERSISTENTSTORE_WITH_ACCOUNT_SCOPE false CACHE BOOL "Enable account scope")

add_library(${MODULE_NAME} SHARED
PersistentStore.cpp
Expand Down
30 changes: 13 additions & 17 deletions PersistentStore/PersistentStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,21 @@

namespace WPEFramework {

namespace {

#ifdef WITH_THUNDER_NAMESPACE
static Thunder::Plugin::Metadata<Plugin::PersistentStore> metadata(
#else
static Plugin::Metadata<Plugin::PersistentStore> metadata(
#endif
// Version (Major, Minor, Patch)
API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH,
// Preconditions
{},
// Terminations
{},
// Controls
{});
}

namespace Plugin {

namespace {

static Metadata<PersistentStore> metadata(
// Version (Major, Minor, Patch)
API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH,
// Preconditions
{},
// Terminations
{},
// Controls
{});
}

SERVICE_REGISTRATION(PersistentStore, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);

const string PersistentStore::Initialize(PluginHost::IShell* service)
Expand Down
8 changes: 1 addition & 7 deletions PersistentStore/grpc/l0test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ FetchContent_Declare(
FetchContent_MakeAvailable(googletest)
target_link_libraries(${PROJECT_NAME} PRIVATE gmock_main)

find_package(WPEFramework)
if (NOT WPEFramework_FOUND)
find_package(Thunder)
if (Thunder_FOUND)
add_compile_definitions(WITH_THUNDER_NAMESPACE)
endif ()
endif ()
find_package(WPEFramework NAMES WPEFramework Thunder)
find_package(${NAMESPACE}Plugins REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE ${NAMESPACE}Plugins::${NAMESPACE}Plugins)

Expand Down
8 changes: 1 addition & 7 deletions PersistentStore/l0test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(googletest)

find_package(WPEFramework)
if (NOT WPEFramework_FOUND)
find_package(Thunder)
if (Thunder_FOUND)
add_compile_definitions(WITH_THUNDER_NAMESPACE)
endif ()
endif ()
find_package(WPEFramework NAMES WPEFramework Thunder)
find_package(${NAMESPACE}Plugins REQUIRED)
find_package(${NAMESPACE}Definitions REQUIRED)

Expand Down
8 changes: 1 addition & 7 deletions PersistentStore/l1test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(googletest)

find_package(WPEFramework)
if (NOT WPEFramework_FOUND)
find_package(Thunder)
if (Thunder_FOUND)
add_compile_definitions(WITH_THUNDER_NAMESPACE)
endif ()
endif ()
find_package(WPEFramework NAMES WPEFramework Thunder)
find_package(${NAMESPACE}Plugins REQUIRED)
find_package(${NAMESPACE}Definitions REQUIRED)

Expand Down
8 changes: 1 addition & 7 deletions PersistentStore/sqlite/l1test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(googletest)

find_package(WPEFramework)
if (NOT WPEFramework_FOUND)
find_package(Thunder)
if (Thunder_FOUND)
add_compile_definitions(WITH_THUNDER_NAMESPACE)
endif ()
endif ()
find_package(WPEFramework NAMES WPEFramework Thunder)
find_package(${NAMESPACE}Plugins REQUIRED)

add_executable(${PROJECT_NAME}
Expand Down
Loading

0 comments on commit ccaf3c8

Please sign in to comment.