/** * Copyright 2022-2023, XGBoost contributors */ #pragma once #include // for Server #include // for future #include // for unique_ptr #include // for string #include "../../src/collective/tracker.h" // for Tracker #include "xgboost/collective/result.h" // for Result #include "xgboost/json.h" // for Json namespace xgboost::collective { class FederatedTracker : public collective::Tracker { std::unique_ptr server_; std::string server_key_path_; std::string server_cert_file_; std::string client_cert_file_; public: /** * @brief CTOR * * @param config Configuration, other than the base configuration from Tracker, we have: * * - federated_secure: bool whether this is a secure server. * - server_key_path: path to the key. * - server_cert_path: certificate path. * - client_cert_path: certificate path for client. */ explicit FederatedTracker(Json const& config); ~FederatedTracker() override; std::future Run() override; // federated tracker do not provide initialization parameters, users have to provide it // themseleves. [[nodiscard]] Json WorkerArgs() const override { return Json{Null{}}; } [[nodiscard]] Result Shutdown(); }; } // namespace xgboost::collective