From 7ba9b43b56c85ab2a2a4b261397a3cab3361b163 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Wed, 7 Feb 2024 13:11:07 -0800 Subject: [PATCH 1/3] https://telecominfraproject.atlassian.net/browse/WIFI-13172 Signed-off-by: stephb9959 --- src/framework/EventBusManager.cpp | 12 +- src/framework/EventBusManager.h | 1 - src/framework/MicroService.cpp | 131 ++++++++++++--------- src/framework/MicroService.h | 17 +-- src/framework/UI_WebSocketClientServer.cpp | 8 +- src/framework/ow_constants.h | 5 +- 6 files changed, 101 insertions(+), 73 deletions(-) diff --git a/src/framework/EventBusManager.cpp b/src/framework/EventBusManager.cpp index 66774f1..4f4e8c7 100644 --- a/src/framework/EventBusManager.cpp +++ b/src/framework/EventBusManager.cpp @@ -16,9 +16,9 @@ namespace OpenWifi { KafkaManager()->PostMessage(KafkaTopics::SERVICE_EVENTS, MicroServicePrivateEndPoint(), Msg, false); while (Running_) { - Poco::Thread::trySleep((unsigned long)MicroServiceDaemonBusTimer()); - if (!Running_) - break; + if(!Poco::Thread::trySleep((unsigned long)MicroServiceDaemonBusTimer())) { + break; + } Msg = (MicroServiceMakeSystemEventMessage(KafkaTopics::ServiceEvents::EVENT_KEEP_ALIVE)); KafkaManager()->PostMessage(KafkaTopics::SERVICE_EVENTS, MicroServicePrivateEndPoint(), Msg, false); @@ -29,7 +29,7 @@ namespace OpenWifi { }; void EventBusManager::Start() { - poco_information(Logger(), "Starting..."); + poco_information(Logger_, "Starting..."); if (KafkaManager()->Enabled()) { Thread_.start(*this); } @@ -37,11 +37,11 @@ namespace OpenWifi { void EventBusManager::Stop() { if (KafkaManager()->Enabled()) { - poco_information(Logger(), "Stopping..."); + poco_information(Logger_, "Stopping..."); Running_ = false; Thread_.wakeUp(); Thread_.join(); - poco_information(Logger(), "Stopped..."); + poco_information(Logger_, "Stopped..."); } } diff --git a/src/framework/EventBusManager.h b/src/framework/EventBusManager.h index fe8a82c..4982fb4 100644 --- a/src/framework/EventBusManager.h +++ b/src/framework/EventBusManager.h @@ -22,7 +22,6 @@ namespace OpenWifi { return instance_; } - explicit EventBusManager(Poco::Logger &L); void run() final; void Start(); void Stop(); diff --git a/src/framework/MicroService.cpp b/src/framework/MicroService.cpp index 13f89fb..bda4aaa 100644 --- a/src/framework/MicroService.cpp +++ b/src/framework/MicroService.cpp @@ -29,11 +29,13 @@ #include "framework/WebSocketLogger.h" #include "framework/utils.h" +#ifdef USE_MEDUSA_CLIENT +#include +#endif + namespace OpenWifi { - void MicroService::Exit(int Reason) { std::exit(Reason); } - - static std::string MakeServiceListString(const Types::MicroServiceMetaMap &Services) { + static std::string MakeServiceListString(const Types::MicroServiceMetaMap &Services) { std::string SvcList; for (const auto &Svc : Services) { if (SvcList.empty()) @@ -204,25 +206,29 @@ namespace OpenWifi { Res.push_back(ServiceRec); } return Res; + } void MicroService::LoadConfigurationFile() { - std::string Location = Poco::Environment::get(DAEMON_CONFIG_ENV_VAR, "."); - ConfigFileName_ = - ConfigFileName_.empty() ? Location + "/" + DAEMON_PROPERTIES_FILENAME : ConfigFileName_; - Poco::Path ConfigFile(ConfigFileName_); + if(ConfigContent_.empty()) { + std::string Location = Poco::Environment::get(DAEMON_CONFIG_ENV_VAR, "."); + ConfigFileName_ = + ConfigFileName_.empty() ? Location + "/" + DAEMON_PROPERTIES_FILENAME : ConfigFileName_; + Poco::Path ConfigFile(ConfigFileName_); - if (!ConfigFile.isFile()) { - std::cerr << DAEMON_APP_NAME << ": Configuration " << ConfigFile.toString() - << " does not seem to exist. Please set " + DAEMON_CONFIG_ENV_VAR + - " env variable the path of the " + DAEMON_PROPERTIES_FILENAME + - " file." - << std::endl; - std::exit(Poco::Util::Application::EXIT_CONFIG); - } - - // loadConfiguration(ConfigFile.toString()); - PropConfigurationFile_ = new Poco::Util::PropertyFileConfiguration(ConfigFile.toString()); + if (!ConfigFile.isFile()) { + std::cerr << DAEMON_APP_NAME << ": Configuration " << ConfigFile.toString() + << " does not seem to exist. Please set " + DAEMON_CONFIG_ENV_VAR + + " env variable the path of the " + DAEMON_PROPERTIES_FILENAME + + " file." + << std::endl; + std::exit(Poco::Util::Application::EXIT_CONFIG); + } + PropConfigurationFile_ = new Poco::Util::PropertyFileConfiguration(ConfigFile.toString()); + } else { + std::istringstream is(ConfigContent_); + PropConfigurationFile_ = new Poco::Util::PropertyFileConfiguration(is); + } configPtr()->addWriteable(PropConfigurationFile_, PRIO_DEFAULT); } @@ -425,49 +431,59 @@ namespace OpenWifi { void DaemonPostInitialization(Poco::Util::Application &self); - void MicroService::initialize(Poco::Util::Application &self) { - // add the default services - LoadConfigurationFile(); - InitializeLoggingSystem(); + void MicroService::StartEverything(Poco::Util::Application &self) { + LoadConfigurationFile(); + InitializeLoggingSystem(); - SubSystems_.push_back(KafkaManager()); - SubSystems_.push_back(ALBHealthCheckServer()); - SubSystems_.push_back(RESTAPI_ExtServer()); - SubSystems_.push_back(RESTAPI_IntServer()); + static bool InitializedBaseService=false; + if(!InitializedBaseService) { + InitializedBaseService = true; + SubSystems_.push_back(KafkaManager()); + SubSystems_.push_back(ALBHealthCheckServer()); + SubSystems_.push_back(RESTAPI_ExtServer()); + SubSystems_.push_back(RESTAPI_IntServer()); #ifndef TIP_SECURITY_SERVICE - SubSystems_.push_back(AuthClient()); + SubSystems_.push_back(AuthClient()); #endif - Poco::Net::initializeSSL(); - Poco::Net::HTTPStreamFactory::registerFactory(); - Poco::Net::HTTPSStreamFactory::registerFactory(); - Poco::Net::FTPStreamFactory::registerFactory(); - Poco::Net::FTPSStreamFactory::registerFactory(); - Poco::File DataDir(ConfigPath("openwifi.system.data")); - DataDir_ = DataDir.path(); - if (!DataDir.exists()) { - try { - DataDir.createDirectory(); - } catch (const Poco::Exception &E) { - Logger_.log(E); - } - } - WWWAssetsDir_ = ConfigPath("openwifi.restapi.wwwassets", ""); - if (WWWAssetsDir_.empty()) - WWWAssetsDir_ = DataDir_; + Poco::Net::initializeSSL(); + Poco::Net::HTTPStreamFactory::registerFactory(); + Poco::Net::HTTPSStreamFactory::registerFactory(); + Poco::Net::FTPStreamFactory::registerFactory(); + Poco::Net::FTPSStreamFactory::registerFactory(); + } - LoadMyConfig(); + Poco::File DataDir(ConfigPath("openwifi.system.data")); + DataDir_ = DataDir.path(); + if (!DataDir.exists()) { + try { + DataDir.createDirectory(); + } catch (const Poco::Exception &E) { + Logger_.log(E); + } + } + WWWAssetsDir_ = ConfigPath("openwifi.restapi.wwwassets", ""); + if (WWWAssetsDir_.empty()) + WWWAssetsDir_ = DataDir_; - AllowExternalMicroServices_ = ConfigGetBool("allowexternalmicroservices", true); + LoadMyConfig(); - InitializeSubSystemServers(); - ServerApplication::initialize(self); - DaemonPostInitialization(self); + AllowExternalMicroServices_ = ConfigGetBool("allowexternalmicroservices", true); - Types::TopicNotifyFunction F = [this](const std::string &Key, const std::string &Payload) { - this->BusMessageReceived(Key, Payload); - }; - KafkaManager()->RegisterTopicWatcher(KafkaTopics::SERVICE_EVENTS, F); + InitializeSubSystemServers(); + ServerApplication::initialize(self); + DaemonPostInitialization(self); + + Types::TopicNotifyFunction F = [this](const std::string &Key, const std::string &Payload) { + this->BusMessageReceived(Key, Payload); + }; + KafkaManager()->RegisterTopicWatcher(KafkaTopics::SERVICE_EVENTS, F); + } + + void MicroService::initialize([[maybe_unused]] Poco::Util::Application &self) { +#ifndef USE_MEDUSA_CLIENT + StartEverything(self); +#endif } void MicroService::uninitialize() { @@ -753,6 +769,8 @@ namespace OpenWifi { MicroServiceErrorHandler ErrorHandler(*this); Poco::ErrorHandler::set(&ErrorHandler); + Args_ = args; + if (!HelpRequested_) { SavePID(); @@ -768,11 +786,18 @@ namespace OpenWifi { poco_information(logger, "Starting as a daemon."); } +#ifdef USE_MEDUSA_CLIENT + MedusaClient::instance()->SetSubSystems(SubSystems_); + MedusaClient::instance()->Start(); + waitForTerminationRequest(); + MedusaClient::instance()->Stop(); +#else poco_information(logger, fmt::format("System ID set to {}", ID_)); StartSubSystemServers(); waitForTerminationRequest(); StopSubSystemServers(); logger.notice(fmt::format("Stopped {}...", DAEMON_APP_NAME)); +#endif } return Application::EXIT_OK; diff --git a/src/framework/MicroService.h b/src/framework/MicroService.h index 7290bbb..ccca8c8 100644 --- a/src/framework/MicroService.h +++ b/src/framework/MicroService.h @@ -55,9 +55,6 @@ namespace OpenWifi { #include "nlohmann/json.hpp" #include "ow_version.h" -#define _OWDEBUG_ std::cout << __FILE__ << ":" << __LINE__ << std::endl; -// #define _OWDEBUG_ Logger().debug(Poco::format("%s: %lu",__FILE__,__LINE__)); - namespace OpenWifi { class MicroService : public Poco::Util::ServerApplication { @@ -70,7 +67,6 @@ namespace OpenWifi { SubSystems_(std::move(Subsystems)), Logger_(Poco::Logger::get("FRAMEWORK")) { instance_ = this; RandomEngine_.seed(std::chrono::steady_clock::now().time_since_epoch().count()); - // Logger_ = Poco::Logger::root().get("BASE-SVC"); } inline static const char *ExtraConfigurationFilename = "/configuration_override.json"; @@ -92,7 +88,7 @@ namespace OpenWifi { inline uint64_t DaemonBusTimer() const { return DAEMON_BUS_TIMER; }; [[nodiscard]] const std::string &AppName() { return DAEMON_APP_NAME; } static inline uint64_t GetPID() { return Poco::Process::id(); }; - [[nodiscard]] inline const std::string GetPublicAPIEndPoint() { + [[nodiscard]] inline std::string GetPublicAPIEndPoint() const { return MyPublicEndPoint_ + "/api/v1"; }; [[nodiscard]] inline const std::string &GetUIURI() const { return UIURI_; }; @@ -107,7 +103,8 @@ namespace OpenWifi { } static MicroService &instance() { return *instance_; } - inline void Exit(int Reason); + inline void Exit(int Reason) { std::exit(Reason); } + void BusMessageReceived(const std::string &Key, const std::string &Payload); Types::MicroServiceMetaVec GetServices(const std::string &Type); Types::MicroServiceMetaVec GetServices(); @@ -115,6 +112,7 @@ namespace OpenWifi { void Reload(); void LoadMyConfig(); void initialize(Poco::Util::Application &self) override; + void StartEverything(Poco::Util::Application &self); void uninitialize() override; void reinitialize(Poco::Util::Application &self) override; void defineOptions(Poco::Util::OptionSet &options) override; @@ -132,7 +130,7 @@ namespace OpenWifi { void Reload(const std::string &Sub); Types::StringVec GetSubSystems() const; Types::StringPairVec GetLogLevels(); - const Types::StringVec &GetLogLevelNames(); + static const Types::StringVec &GetLogLevelNames(); uint64_t ConfigGetInt(const std::string &Key, uint64_t Default); uint64_t ConfigGetInt(const std::string &Key); uint64_t ConfigGetBool(const std::string &Key, bool Default); @@ -166,12 +164,16 @@ namespace OpenWifi { const std::string &FormatterPattern, const std::string &root_env_var); inline bool AllowExternalMicroServices() const { return AllowExternalMicroServices_; } + const ArgVec &Args() const { return Args_; } + + inline void SetConfigContent(const std::string &Content) { ConfigContent_ = Content; } private: static MicroService *instance_; bool HelpRequested_ = false; std::string LogDir_; std::string ConfigFileName_; + std::string ConfigContent_; uint64_t ID_ = 1; Poco::SharedPtr AppKey_; bool DebugMode_ = false; @@ -201,6 +203,7 @@ namespace OpenWifi { Poco::JWT::Signer Signer_; Poco::Logger &Logger_; Poco::ThreadPool TimerPool_{"timer:pool", 2, 32}; + ArgVec Args_; }; inline MicroService *MicroService::instance_ = nullptr; diff --git a/src/framework/UI_WebSocketClientServer.cpp b/src/framework/UI_WebSocketClientServer.cpp index 37c426f..eb5b0b7 100644 --- a/src/framework/UI_WebSocketClientServer.cpp +++ b/src/framework/UI_WebSocketClientServer.cpp @@ -58,11 +58,9 @@ namespace OpenWifi { void UI_WebSocketClientServer::run() { Running_ = true; while (Running_) { - Poco::Thread::trySleep(2000); - - if (!Running_) - break; - + if(!Poco::Thread::trySleep(2000)) { + break; + } std::lock_guard G(LocalMutex_); for (const auto i : ToBeRemoved_) { // std::cout << "Erasing old WS UI connection..." << std::endl; diff --git a/src/framework/ow_constants.h b/src/framework/ow_constants.h index ed4e246..7ef8424 100644 --- a/src/framework/ow_constants.h +++ b/src/framework/ow_constants.h @@ -565,6 +565,7 @@ namespace OpenWifi::RESTAPI::Protocol { static const char *TRANSFER = "transfer"; static const char *CERTUPDATE = "certupdate"; + static const char *POWERCYCLE = "powercycle"; static const char *RRM = "rrm"; static const char *REQUIREMENTS = "requirements"; @@ -687,6 +688,7 @@ namespace OpenWifi::uCentralProtocol { static const char *TRANSFER = "transfer"; static const char *CERTUPDATE = "certupdate"; + static const char *POWERCYCLE = "powercycle"; static const char *RRM = "rrm"; static const char *ACTIONS = "actions"; @@ -785,6 +787,7 @@ namespace OpenWifi::APCommands { rrm, certupdate, transfer, + powercycle, unknown }; @@ -799,7 +802,7 @@ namespace OpenWifi::APCommands { RESTAPI::Protocol::EVENTQUEUE, RESTAPI::Protocol::TELEMETRY, RESTAPI::Protocol::PING, RESTAPI::Protocol::SCRIPT, RESTAPI::Protocol::RRM, RESTAPI::Protocol::CERTUPDATE, - RESTAPI::Protocol::TRANSFER + RESTAPI::Protocol::TRANSFER, RESTAPI::Protocol::POWERCYCLE }; inline const char *to_string(Commands Cmd) { return uCentralAPCommands[(uint8_t)Cmd]; } From 1f02c9fec4e6e77fe86f44a03d15471bf62b7598 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Thu, 29 Feb 2024 17:40:38 -0800 Subject: [PATCH 2/3] https://telecominfraproject.atlassian.net/browse/WIFI-13450 Signed-off-by: stephb9959 --- build | 2 +- src/RESTObjects/RESTAPI_ProvObjects.cpp | 6 ++++++ src/RESTObjects/RESTAPI_ProvObjects.h | 4 +++- src/framework/KafkaManager.cpp | 7 +++++-- src/framework/KafkaManager.h | 3 +++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/build b/build index 62f9457..c793025 100644 --- a/build +++ b/build @@ -1 +1 @@ -6 \ No newline at end of file +7 \ No newline at end of file diff --git a/src/RESTObjects/RESTAPI_ProvObjects.cpp b/src/RESTObjects/RESTAPI_ProvObjects.cpp index 2a139f5..8cdb878 100644 --- a/src/RESTObjects/RESTAPI_ProvObjects.cpp +++ b/src/RESTObjects/RESTAPI_ProvObjects.cpp @@ -587,6 +587,9 @@ namespace OpenWifi::ProvObjects { field_to_json(Obj, "locale", locale); field_to_json(Obj, "realMacAddress", realMacAddress); field_to_json(Obj, "doNotAllowOverrides", doNotAllowOverrides); + field_to_json(Obj, "imported", imported); + field_to_json(Obj, "connected", connected); + field_to_json(Obj, "platform", platform); } bool InventoryTag::from_json(const Poco::JSON::Object::Ptr &Obj) { @@ -609,6 +612,9 @@ namespace OpenWifi::ProvObjects { field_from_json(Obj, "locale", locale); field_from_json(Obj, "realMacAddress", realMacAddress); field_from_json(Obj, "doNotAllowOverrides", doNotAllowOverrides); + field_from_json(Obj, "imported", imported); + field_from_json(Obj, "connected", connected); + field_from_json(Obj, "platform", platform); return true; } catch (...) { } diff --git a/src/RESTObjects/RESTAPI_ProvObjects.h b/src/RESTObjects/RESTAPI_ProvObjects.h index 6014d61..8f11867 100644 --- a/src/RESTObjects/RESTAPI_ProvObjects.h +++ b/src/RESTObjects/RESTAPI_ProvObjects.h @@ -490,9 +490,11 @@ namespace OpenWifi::ProvObjects { std::string locale; std::string realMacAddress; bool doNotAllowOverrides = false; + std::uint64_t imported=0; + std::uint64_t connected=0; + std::string platform{"AP"}; void to_json(Poco::JSON::Object &Obj) const; - bool from_json(const Poco::JSON::Object::Ptr &Obj); }; diff --git a/src/framework/KafkaManager.cpp b/src/framework/KafkaManager.cpp index f2936e7..9605736 100644 --- a/src/framework/KafkaManager.cpp +++ b/src/framework/KafkaManager.cpp @@ -79,8 +79,10 @@ namespace OpenWifi { Utils::SetThreadName("Kafka:Prod"); cppkafka::Configuration Config( {{"client.id", MicroServiceConfigGetString("openwifi.kafka.client.id", "")}, - {"metadata.broker.list", - MicroServiceConfigGetString("openwifi.kafka.brokerlist", "")}}); + {"metadata.broker.list",MicroServiceConfigGetString("openwifi.kafka.brokerlist", "")} // , + // {"send.buffer.bytes", KafkaManager()->KafkaManagerMaximumPayloadSize() } + } + ); AddKafkaSecurity(Config); @@ -275,6 +277,7 @@ namespace OpenWifi { int KafkaManager::Start() { if (!KafkaEnabled_) return 0; + MaxPayloadSize_ = MicroServiceConfigGetInt("openwifi.kafka.max.payload", 250000); ConsumerThr_.Start(); ProducerThr_.Start(); return 0; diff --git a/src/framework/KafkaManager.h b/src/framework/KafkaManager.h index e6272d3..75b9aa6 100644 --- a/src/framework/KafkaManager.h +++ b/src/framework/KafkaManager.h @@ -94,11 +94,14 @@ namespace OpenWifi { return ConsumerThr_.UnregisterTopicWatcher(Topic,Id); } + std::uint64_t KafkaManagerMaximumPayloadSize() const { return MaxPayloadSize_; } + private: bool KafkaEnabled_ = false; std::string SystemInfoWrapper_; KafkaProducer ProducerThr_; KafkaConsumer ConsumerThr_; + std::uint64_t MaxPayloadSize_ = 250000; void PartitionAssignment(const cppkafka::TopicPartitionList &partitions); void PartitionRevocation(const cppkafka::TopicPartitionList &partitions); From 23cf3042b3d74356b4bda20a01f3958c85142ce5 Mon Sep 17 00:00:00 2001 From: Carsten Schafer Date: Tue, 19 Mar 2024 16:40:15 -0400 Subject: [PATCH 3/3] WIFI-12939: change to TIP repos for libraries Signed-off-by: Carsten Schafer --- BUILDING.md | 51 +++++++++++++++++++++++++-------------------------- Dockerfile | 9 ++++----- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 72cbe7a..7624788 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,5 +1,5 @@ # Building from source -In order to build the OWFMS, you will need to install its dependencies, which includes the following: +In order to build OWFMS, you will need to install its dependencies, which includes the following: - cmake - boost - POCO 1.10.1 or later @@ -12,111 +12,110 @@ In order to build the OWFMS, you will need to install its dependencies, which in Building is a 2 part process. The first part is to build a local copy of the framework tailored to your environment. This framework is [Poco](https://github.com/pocoproject/poco). The version used in this project has a couple of fixes -from the master copy needed for cmake. Please use the version of this [Poco fix](https://github.com/stephb9959/poco). Building +from the master copy needed for cmake. Please use the version of this [Poco fix](https://github.com/Telecominfraproject/wlan-cloud-lib-poco). Building Poco may take several minutes depending on the platform you are building on. ## Ubuntu These instructions have proven to work on Ubuntu 20.4. ```bash -sudo apt install git cmake g++ libssl-dev libmariabd-dev unixodbc-dev +sudo apt install git cmake g++ libssl-dev libmariabd-dev unixodbc-dev sudo apt install libpq-dev libaprutil1-dev apache2-dev libboost-all-dev sudo apt install librdkafka-dev liblua5.3-dev -git clone https://github.com/stephb9959/poco +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco cd poco mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -git clone https://github.com/stephb9959/cppkafka +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka cd cppkafka mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -cd ~ git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralgw cd wlan-cloud-ucentralgw mkdir cmake-build cd cmake-build cmake .. make +cd ../.. ``` ## Fedora The following instructions have proven to work on Fedora 33 ```bash sudo yum install cmake g++ openssl-devel unixODBC-devel mysql-devel mysql apr-util-devel boost boost-devel -sudo yum install yaml-cpp-devel lua-devel +sudo yum install yaml-cpp-devel lua-devel sudo dnf install postgresql.x86_64 librdkafka-devel sudo dnf install postgresql-devel -git clone https://github.com/stephb9959/poco +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco cd poco mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -git clone https://github.com/stephb9959/cppkafka +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka cd cppkafka mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -cd ~ git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralfms cd wlan-cloud-ucentralfms mkdir cmake-build cd cmake-build cmake .. make +cd ../.. ``` -## OSX Build +## Mac OSX Build The following instructions have proven to work on OSX Big Sur. You need to install [Homebrew](https://brew.sh/). You must also have installed [XCode for OS X](https://www.freecodecamp.org/news/how-to-download-and-install-xcode/). ```bash -brew install openssl -brew install cmake -brew install libpq -brew install mysql-client -brew install apr -brew install apr-util -brew install boost -brew install yaml-cpp -brew install postgresql -brew install unixodbc -brew install librdkafka +brew install \ + openssl cmake libpq mysql-client \ + apr apr-util boost yaml-cpp postgresql \ + unixodbc librdkafka -git clone https://github.com/stephb9959/poco +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco cd poco -mkdir cmake-build +mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release -j sudo cmake --build . --target install +cd ../.. -git clone https://github.com/stephb9959/cppkafka +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka cd cppkafka mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -cd ~ git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralfms cd wlan-cloud-ucentralfms mkdir cmake-build cd cmake-build cmake .. make -j +cd ../.. ``` diff --git a/Dockerfile b/Dockerfile index b77b660..1ec8c69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ FROM build-base AS poco-build ARG POCO_VERSION - -ADD https://api.github.com/repos/AriliaWireless/poco/git/refs/tags/${POCO_VERSION} version.json -RUN git clone https://github.com/AriliaWireless/poco --branch ${POCO_VERSION} /poco +ADD https://api.github.com/repos/Telecominfraproject/wlan-cloud-lib-poco/git/refs/tags/${POCO_VERSION} version.json +RUN git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch ${POCO_VERSION} /poco WORKDIR /poco RUN mkdir cmake-build @@ -31,8 +30,8 @@ FROM build-base AS cppkafka-build ARG CPPKAFKA_VERSION -ADD https://api.github.com/repos/AriliaWireless/cppkafka/git/refs/tags/${CPPKAFKA_VERSION} version.json -RUN git clone https://github.com/AriliaWireless/cppkafka --branch ${CPPKAFKA_VERSION} /cppkafka +ADD https://api.github.com/repos/Telecominfraproject/wlan-cloud-lib-cppkafka/git/refs/tags/${CPPKAFKA_VERSION} version.json +RUN git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch ${CPPKAFKA_VERSION} /cppkafka WORKDIR /cppkafka RUN mkdir cmake-build