13#ifndef RTCTK_REUSABLECOMPONENT_DEPLOYMENT_DAEMON_BUSINESSLOGIC_HPP
14#define RTCTK_REUSABLECOMPONENT_DEPLOYMENT_DAEMON_BUSINESSLOGIC_HPP
22#include <pybind11/pybind11.h>
29namespace py = pybind11;
41 const elt::mal::Uri& sde);
99 const std::string& type,
107 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:77
Base interface for all Persistent Configuration Repository adapters.
Definition persistentRepoIf.hpp:25
Container class that holds services of any type.
Definition serviceContainer.hpp:39
Class that implements a very basic service discovery mechanism.
Definition serviceDiscovery.hpp:33
void ActionStartComponent(std::string component_name) override
Definition deploymentDaemonBusinessLogic.cpp:66
log4cplus::Logger & m_logger
Definition deploymentDaemonBusinessLogic.hpp:130
void ActionStopComponent(std::string component_name) override
Definition deploymentDaemonBusinessLogic.cpp:92
std::string ActionGetDescription() override
Definition deploymentDaemonBusinessLogic.cpp:167
std::vector< std::string > ActionGetComponents() override
Definition deploymentDaemonBusinessLogic.cpp:122
std::vector< std::string > ActionGetDeploymentSets() override
Definition deploymentDaemonBusinessLogic.cpp:114
std::vector< std::string > m_deployment_sets
List of deployment sets.
Definition deploymentDaemonBusinessLogic.hpp:154
std::vector< std::string > ActionGetActiveServices() override
Definition deploymentDaemonBusinessLogic.cpp:148
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:204
void ActivityDeploying(StopToken st, std::string args) override
Definition deploymentDaemonBusinessLogic.cpp:211
rtctk::componentFramework::ServiceDiscovery & m_service_discovery
Definition deploymentDaemonBusinessLogic.hpp:143
std::vector< std::string > ActionGetActiveComponents() override
Returns active components from the active deployment set.
Definition deploymentDaemonBusinessLogic.cpp:127
std::vector< std::string > ActionGetServices() override
Definition deploymentDaemonBusinessLogic.cpp:143
DeploymentDaemonBusinessLogic(const std::string &name, ServiceContainer &services, const elt::mal::Uri &sde)
Definition deploymentDaemonBusinessLogic.cpp:37
const std::string m_name
component name
Definition deploymentDaemonBusinessLogic.hpp:135
void StopProcess(const std::string &component_name, const bool check_error=true)
Implements the StopProcess command.
Definition deploymentDaemonBusinessLogic.cpp:395
rtctk::componentFramework::ServiceContainer & m_service_container
Reference to container services needed to access run-time repository for configuration,...
Definition deploymentDaemonBusinessLogic.hpp:141
LifeCycle ComponentType
Definition deploymentDaemonBusinessLogic.hpp:38
std::vector< std::string > m_services
List of deployed services.
Definition deploymentDaemonBusinessLogic.hpp:172
std::string m_description
Deployment set description.
Definition deploymentDaemonBusinessLogic.hpp:166
void CleanupPythonObjects() noexcept
Clean up Python objects.
Definition deploymentDaemonBusinessLogic.cpp:460
void ActivityUndeploying(StopToken st) override
Definition deploymentDaemonBusinessLogic.cpp:171
void DeployComponents(const DataPointPath &depl_set_path)
Deploys all components.
Definition deploymentDaemonBusinessLogic.cpp:471
void ActivityStarting(cfw::StopToken st) override
Definition deploymentDaemonBusinessLogic.cpp:61
std::string ActionGetActiveDeployment() override
Definition deploymentDaemonBusinessLogic.cpp:163
void DeployServices(const DataPointPath &depl_set_path)
Deploys all services if any.
Definition deploymentDaemonBusinessLogic.cpp:610
std::string m_active_deployment_set
Name of active deployment set.
Definition deploymentDaemonBusinessLogic.hpp:160
void GetDeploymentSets()
Fetches the available Deployment Sets from the Persistent Configuration Repository and caches the val...
Definition deploymentDaemonBusinessLogic.cpp:291
elt::mal::Uri m_sde
Service Discovery EndPoint URI.
Definition deploymentDaemonBusinessLogic.hpp:184
std::unique_ptr< rtctk::componentFramework::PersistentRepoIf > m_persistent_repo
References to the persistent repository.
Definition deploymentDaemonBusinessLogic.hpp:148
void InitPythonObjects()
Initialise Python object for py bind calls.
Definition deploymentDaemonBusinessLogic.cpp:441
std::vector< std::string > m_components
List of deployed components.
Definition deploymentDaemonBusinessLogic.hpp:178
void UndeployProcesses(std::vector< std::string > &proceses)
Undeploys all components.
Definition deploymentDaemonBusinessLogic.cpp:563
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:312
std::unique_ptr< PythonObjects > m_pyobjects
Definition deploymentDaemonBusinessLogic.hpp:198
std::mutex m_mutex
Mutex as a temporary workaround to protect python jobfile generation.
Definition deploymentDaemonBusinessLogic.hpp:190
Definition deploymentDaemonLifeCycle.hpp:123
#define RTCTK_LOCAL
Helper to hide a class or function from the public symbol table.
Definition config.hpp:60
Header file for ComponentMetricsIf.
Lifecycle of the 'Deployment Daemon Component'.
Definition statePublisher.hpp:20
Definition commandReplier.cpp:22
rad::StopToken StopToken
Definition stopToken.hpp:20
Definition deploymentDaemonBusinessLogic.cpp:35
DeploymentDaemonLifeCycle LifeCycle
Definition deploymentDaemonBusinessLogic.hpp:28
Definition commandReplier.cpp:22
Definition ddsSub.hpp:156
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:192
py::module m_module
Definition deploymentDaemonBusinessLogic.hpp:193
py::object m_init_logger_config
Definition deploymentDaemonBusinessLogic.hpp:194
py::object m_generate_nomad_job_from_dp
Definition deploymentDaemonBusinessLogic.hpp:195
Life cycle for DeploymentDaemonComponent.
Definition deploymentDaemonLifeCycle.hpp:122