First release

- Added build script and AMPL license file
- Fixed merge errors for the makefile
- Extended the makefile header
- Added initial AMQ message topics
- Tested remote build
- Removed AMPL license file
- Validated build script
- Accepting the metric definition message from the EMS
- Execution control status messages + solver type command line option

Change-Id: I298dea929764d118ffde42ef68bed99d67ad0488
This commit is contained in:
Geir Horn 2024-01-10 16:26:09 +01:00 committed by Geir Horn
parent 719fa3eaad
commit f48a968583
5 changed files with 49 additions and 0 deletions

View File

@ -7,7 +7,11 @@
"/home/GHo/Documents/Code/Theron++",
"/opt/AMPL/amplapi/include/ampl",
"${workspaceFolder}/**",
<<<<<<< PATCH SET (21fe96 First release)
"/home/GHo/Documents/Code/Theron++"
=======
"/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13"
>>>>>>> BASE (719fa3 Add Dockerfile)
],
"defines": [],
"cStandard": "c23",

View File

@ -89,6 +89,8 @@ ExecutionControl::ExecutionControl( const std::string & TheActorName )
Send( StatusMessage( StatusMessage::State::Starting ),
Address( std::string( StatusTopic ) ) );
<<<<<<< PATCH SET (21fe96 First release)
=======
}
// The destructor simply closes the publisher if the network is still active
@ -101,6 +103,7 @@ ExecutionControl::~ExecutionControl( void )
Theron::AMQ::NetworkLayer::TopicSubscription::Action::ClosePublisher,
std::string( StatusTopic )
), GetSessionLayerAddress() );
>>>>>>> BASE (719fa3 Add Dockerfile)
}
} // namespace NebulOuS

View File

@ -42,19 +42,50 @@ namespace NebulOuS
void MetricUpdater::AddMetricSubscription( const MetricTopic & TheMetrics,
const Address OptimiserController )
{
<<<<<<< PATCH SET (21fe96 First release)
if( TheMetrics.is_object() &&
TheMetrics.at( NebulOuS::MetricList ).is_object() )
{
JSON MetricList = TheMetrics.at( NebulOuS::MetricList );
for( const JSON MetricDefinition : MetricList.items() )
{
auto [ MetricRecord, NewMetric ] = MetricValues.try_emplace(
MetricDefinition.at( NebulOuS::MetricName ), JSON() );
if( NewMetric )
Send( Theron::AMQ::NetworkLayer::TopicSubscription(
Theron::AMQ::NetworkLayer::TopicSubscription::Action::Subscription,
MetricRecord->first ),
Theron::AMQ::Network::GetAddress( Theron::Network::Layer::Session) );
}
}
else
=======
if( TheMetrics.is_object() &&
TheMetrics.at( NebulOuS::MetricList ).is_array() )
{
for (auto & MetricRecord : TheMetrics.at( NebulOuS::MetricList ) )
>>>>>>> BASE (719fa3 Add Dockerfile)
{
auto [ MetricRecordPointer, NewMetric ] = MetricValues.try_emplace(
MetricRecord.at( NebulOuS::MetricName ), JSON() );
<<<<<<< PATCH SET (21fe96 First release)
ErrorMessage << "[" << Location.file_name() << " at line " << Location.line()
<< "in function " << Location.function_name() <<"] "
<< "The message to define a new metric subscription is given as "
<< std::endl << TheMetrics.dump(2) << std::endl
<< "this is not as expected!";
throw std::invalid_argument( ErrorMessage.str() );
=======
if( NewMetric )
Send( Theron::AMQ::NetworkLayer::TopicSubscription(
Theron::AMQ::NetworkLayer::TopicSubscription::Action::Subscription,
std::string( MetricValueRootString ) + MetricRecordPointer->first ),
Theron::AMQ::Network::GetAddress( Theron::Network::Layer::Session) );
>>>>>>> BASE (719fa3 Add Dockerfile)
}
}
else
@ -108,9 +139,12 @@ void MetricUpdater::UpdateMetricValue(
Theron::AMQ::TopicName TheTopic
= TheMetricTopic.AsString().erase( 0,
NebulOuS::MetricValueRootString.size() );
<<<<<<< PATCH SET (21fe96 First release)
=======
Output << "The metric: " << TheTopic << " has new value "
<< TheMetricValue[ NebulOuS::ValueLabel ] << std::endl;
>>>>>>> BASE (719fa3 Add Dockerfile)
if( MetricValues.contains( TheTopic ) )
{

View File

@ -88,7 +88,11 @@ constexpr std::string_view TimePoint = "predictionTime";
// defined next.
constexpr std::string_view MetricSubscriptions
<<<<<<< PATCH SET (21fe96 First release)
= "eu.nebulouscloud.monitoring.metric_lists";
=======
= "eu.nebulouscloud.monitoring.metric_list";
>>>>>>> BASE (719fa3 Add Dockerfile)
// The JSON message attribute for the list of metrics is another JSON object
// stored under the following key, see the Event type III defined in

View File

@ -141,9 +141,13 @@ int main( int NumberOfCLIOptions, char ** CLIOptionStrings )
cxxopts::value<unsigned int>()->default_value("5672") )
("S,Solver", "Solver to use, devault Couenne",
cxxopts::value<std::string>()->default_value("couenne") )
<<<<<<< PATCH SET (21fe96 First release)
("U,user", "The user name used for the AMQ Broker connection",
=======
("T,Tenant", "Tenant identifier for messages",
cxxopts::value<std::string>()->default_value("TheTenant"))
("U,User", "The user name used for the AMQ Broker connection",
>>>>>>> BASE (719fa3 Add Dockerfile)
cxxopts::value<std::string>()->default_value("admin") )
("Pw,Password", "The password for the AMQ Broker connection",
cxxopts::value<std::string>()->default_value("admin") )