12#ifndef RTCTK_REUSABLECOMPONENT_DEPLOYMENT_DAEMON_BUSINESSLOGIC_HPP
13#define RTCTK_REUSABLECOMPONENT_DEPLOYMENT_DAEMON_BUSINESSLOGIC_HPP
21#include <pybind11/pybind11.h>
28namespace py = pybind11;
40 const elt::mal::Uri& sde);
98 const std::string& type,
106 void StopProcess(
const std::string& component_name,
const bool check_error =
true);
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:76
Base interface for all Persistent Configuration Repository adapters.
Definition persistentRepoIf.hpp:24
Container class that holds services of any type.
Definition serviceContainer.hpp:38
Class that implements a very basic service discovery mechanism.
Definition serviceDiscovery.hpp:32
void ActionStartComponent(std::string component_name) override
Definition deploymentDaemonBusinessLogic.cpp:65
log4cplus::Logger & m_logger
Definition deploymentDaemonBusinessLogic.hpp:127
void ActionStopComponent(std::string component_name) override
Definition deploymentDaemonBusinessLogic.cpp:91
std::string ActionGetDescription() override
Definition deploymentDaemonBusinessLogic.cpp:166
std::vector< std::string > ActionGetComponents() override
Definition deploymentDaemonBusinessLogic.cpp:121
std::vector< std::string > ActionGetDeploymentSets() override
Definition deploymentDaemonBusinessLogic.cpp:113
std::vector< std::string > m_deployment_sets
List of deployment sets.
Definition deploymentDaemonBusinessLogic.hpp:150
std::vector< std::string > ActionGetActiveServices() override
Definition deploymentDaemonBusinessLogic.cpp:147
uint16_t m_sd_check_timeout_s
Timeout in seconds to check if the components/service has been registered to Service Discovery.
Definition deploymentDaemonBusinessLogic.hpp:194
void ActivityDeploying(StopToken st, std::string args) override
Definition deploymentDaemonBusinessLogic.cpp:210
rtctk::componentFramework::ServiceDiscovery & m_service_discovery
Definition deploymentDaemonBusinessLogic.hpp:140
std::vector< std::string > ActionGetActiveComponents() override
Returns active components from the active deployment set.
Definition deploymentDaemonBusinessLogic.cpp:126
std::vector< std::string > ActionGetServices() override
Definition deploymentDaemonBusinessLogic.cpp:142
DeploymentDaemonBusinessLogic(const std::string &name, ServiceContainer &services, const elt::mal::Uri &sde)
Definition deploymentDaemonBusinessLogic.cpp:36
const std::string m_name
The component name.
Definition deploymentDaemonBusinessLogic.hpp:132
void StopProcess(const std::string &component_name, const bool check_error=true)
Implements the StopProcess command.
Definition deploymentDaemonBusinessLogic.cpp:394
rtctk::componentFramework::ServiceContainer & m_service_container
Reference to container services needed to access run-time repository for configuration,...
Definition deploymentDaemonBusinessLogic.hpp:138
LifeCycle ComponentType
Definition deploymentDaemonBusinessLogic.hpp:37
std::vector< std::string > m_services
List of deployed services.
Definition deploymentDaemonBusinessLogic.hpp:165
std::string m_description
Deployment set description.
Definition deploymentDaemonBusinessLogic.hpp:160
void CleanupPythonObjects() noexcept
Clean up Python objects.
Definition deploymentDaemonBusinessLogic.cpp:459
void ActivityUndeploying(StopToken st) override
Definition deploymentDaemonBusinessLogic.cpp:170
void DeployComponents(const DataPointPath &depl_set_path)
Deploys all components.
Definition deploymentDaemonBusinessLogic.cpp:470
void ActivityStarting(cfw::StopToken st) override
Definition deploymentDaemonBusinessLogic.cpp:60
std::string ActionGetActiveDeployment() override
Definition deploymentDaemonBusinessLogic.cpp:162
void DeployServices(const DataPointPath &depl_set_path)
Deploys all services if any.
Definition deploymentDaemonBusinessLogic.cpp:609
std::string m_active_deployment_set
Name of active deployment set.
Definition deploymentDaemonBusinessLogic.hpp:155
void GetDeploymentSets()
Fetches the available Deployment Sets from the Persistent Configuration Repository and caches the val...
Definition deploymentDaemonBusinessLogic.cpp:290
elt::mal::Uri m_sde
Service Discovery EndPoint URI.
Definition deploymentDaemonBusinessLogic.hpp:175
std::unique_ptr< rtctk::componentFramework::PersistentRepoIf > m_persistent_repo
References to the persistent repository.
Definition deploymentDaemonBusinessLogic.hpp:145
void InitPythonObjects()
Initialise Python object for py bind calls.
Definition deploymentDaemonBusinessLogic.cpp:440
std::vector< std::string > m_components
List of deployed components.
Definition deploymentDaemonBusinessLogic.hpp:170
void UndeployProcesses(std::vector< std::string > &proceses)
Undeploys all components.
Definition deploymentDaemonBusinessLogic.cpp:562
void StartProcess(const std::string &name, const std::string &type, const DataPointPath &depl_set_path)
Implements the StartProcess command: starts Nomad job process for give component or service.
Definition deploymentDaemonBusinessLogic.cpp:311
std::unique_ptr< PythonObjects > m_pyobjects
Definition deploymentDaemonBusinessLogic.hpp:188
std::mutex m_mutex
Mutex as a temporary workaround to protect python jobfile generation.
Definition deploymentDaemonBusinessLogic.hpp:180
Definition deploymentDaemonLifeCycle.hpp:122
#define RTCTK_LOCAL
Helper to hide a class or function from the public symbol table.
Definition config.hpp:59
Header file for ComponentMetricsIf.
Lifecycle of the 'Deployment Daemon Component'.
Definition statePublisher.hpp:19
Definition commandReplier.cpp:21
rad::StopToken StopToken
Definition stopToken.hpp:19
Definition deploymentDaemonBusinessLogic.cpp:34
DeploymentDaemonLifeCycle LifeCycle
Definition deploymentDaemonBusinessLogic.hpp:27
Definition commandReplier.cpp:21
Definition ddsSub.hpp:155
Header file for PersistentRepoIf, which defines the API for PersistentRepoAdapter.
A container that can hold any type of service.
Class that implements a very basic service discover mechanism.
Definition deploymentDaemonBusinessLogic.hpp:182
py::module m_module
Definition deploymentDaemonBusinessLogic.hpp:183
py::object m_init_logger_config
Definition deploymentDaemonBusinessLogic.hpp:184
py::object m_generate_nomad_job_from_dp
Definition deploymentDaemonBusinessLogic.hpp:185
Life cycle for DeploymentDaemonComponent.
Definition deploymentDaemonLifeCycle.hpp:121