private ContextManager( HeartBeatManager heartBeatManager, EvaluatorSettings evaluatorSetting) { using (LOGGER.LogFunction("ContextManager::ContextManager")) { _heartBeatManager = heartBeatManager; _rootContextLauncher = new RootContextLauncher( evaluatorSetting.RootContextConfig, evaluatorSetting.RootServiceConfiguration, evaluatorSetting.RootTaskConfiguration); } }
public HeartBeatManager(EvaluatorSettings settings, IRemoteIdentifier remoteId) { using (LOGGER.LogFunction("HeartBeatManager::HeartBeatManager")) { _remoteManager = settings.RemoteManager; _remoteId = remoteId; _evaluatorId = settings.EvalutorId; _observer = _remoteManager.GetRemoteObserver(new RemoteEventEndPoint <REEFMessage>(_remoteId)); _clock = settings.RuntimeClock; _heartBeatPeriodInMillSeconds = settings.HeartBeatPeriodInMs; _maxHeartbeatRetries = settings.MaxHeartbeatFailures; EvaluatorSettings = settings; MachineStatus.ToString(); // kick start the CPU perf counter } }
private ContextManager( IHeartBeatManager heartBeatManager, EvaluatorSettings evaluatorSettings, AvroConfigurationSerializer serializer) { // TODO[JIRA REEF-217]: Inject base Injector and pass Injector to RootContextLauncher using (LOGGER.LogFunction("ContextManager::ContextManager")) { _heartBeatManager = heartBeatManager; _serializer = serializer; _rootContextLauncher = new RootContextLauncher( evaluatorSettings.RootContextId, evaluatorSettings.RootContextConfig, evaluatorSettings.RootServiceConfiguration, evaluatorSettings.RootTaskConfiguration, heartBeatManager); } }
public static EvaluateInputBase GetEvaluatorArgs(TrainerKinds kind, out string entryPointName, EvaluatorSettings settings = null) { switch (kind) { case TrainerKinds.SignatureBinaryClassifierTrainer: entryPointName = "Models.BinaryClassificationEvaluator"; return(new BinaryClassifierMamlEvaluator.Arguments() { LabelColumn = settings.LabelColumn, WeightColumn = settings.WeightColumn, NameColumn = settings.NameColumn }); case TrainerKinds.SignatureMultiClassClassifierTrainer: entryPointName = "Models.ClassificationEvaluator"; return(new MultiClassMamlEvaluator.Arguments() { LabelColumn = settings.LabelColumn, WeightColumn = settings.WeightColumn, NameColumn = settings.NameColumn }); case TrainerKinds.SignatureRankerTrainer: entryPointName = "Models.RankerEvaluator"; return(new RankerMamlEvaluator.Arguments() { LabelColumn = settings.LabelColumn, WeightColumn = settings.WeightColumn, NameColumn = settings.NameColumn, GroupIdColumn = settings.GroupColumn }); case TrainerKinds.SignatureRegressorTrainer: entryPointName = "Models.RegressionEvaluator"; return(new RegressionMamlEvaluator.Arguments() { LabelColumn = settings.LabelColumn, WeightColumn = settings.WeightColumn, NameColumn = settings.NameColumn }); case TrainerKinds.SignatureMultiOutputRegressorTrainer: entryPointName = "Models.MultiOutputRegressionEvaluator"; return(new MultiOutputRegressionMamlEvaluator.Arguments() { LabelColumn = settings.LabelColumn, WeightColumn = settings.WeightColumn, NameColumn = settings.NameColumn }); case TrainerKinds.SignatureAnomalyDetectorTrainer: entryPointName = "Models.AnomalyDetectionEvaluator"; return(new AnomalyDetectionMamlEvaluator.Arguments() { LabelColumn = settings.LabelColumn, WeightColumn = settings.WeightColumn, NameColumn = settings.NameColumn }); case TrainerKinds.SignatureClusteringTrainer: entryPointName = "Models.ClusterEvaluator"; return(new ClusteringMamlEvaluator.Arguments() { LabelColumn = settings.LabelColumn, WeightColumn = settings.WeightColumn, NameColumn = settings.NameColumn }); default: throw Contracts.Except("Trainer kind not supported"); } }
public static Tuple <CommonInputs.IEvaluatorInput, CommonOutputs.IEvaluatorOutput> GetEvaluatorInputOutput( TrainerKinds kind, EvaluatorSettings settings = null) => new Tuple <CommonInputs.IEvaluatorInput, CommonOutputs.IEvaluatorOutput> (TrainerKindDict[kind].EvaluatorInput(settings), TrainerKindDict[kind].EvaluatorOutput());
public static void Main(string[] args) { try { Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "START: {0} Evaluator::InitInjector.", DateTime.Now)); Stopwatch timer = new Stopwatch(); InitInjector(); SetCustomTraceListners(); // _logger is reset by this. timer.Stop(); Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "EXIT: {0} Evaluator::InitInjector. Duration: [{1}].", DateTime.Now, timer.Elapsed)); using (_logger.LogScope("Evaluator::Main")) { // Wait for the debugger, if enabled AttachDebuggerIfEnabled(); // Register our exception handler AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; // Fetch some settings from the ConfigurationManager SetHeartbeatPeriod(); SetHeartbeatMaxRetry(); // Parse the command line if (args.Count() < 2) { var e = new InvalidOperationException("must supply at least the rId and evaluator config file"); Utilities.Diagnostics.Exceptions.Throw(e, _logger); } // remote driver Id string rId = args[0]; // evaluator configuraiton file string evaluatorConfigurationPath = args[1]; // Parse the evaluator configuration. _evaluatorConfig = new EvaluatorConfigurations(evaluatorConfigurationPath); ContextConfiguration rootContextConfiguration = _evaluatorConfig.RootContextConfiguration; Optional <TaskConfiguration> rootTaskConfig = _evaluatorConfig.TaskConfiguration; Optional <ServiceConfiguration> rootServiceConfig = _evaluatorConfig.RootServiceConfiguration; // remoteManager used as client-only in evaluator IRemoteManager <REEFMessage> remoteManager = _injector.GetInstance <IRemoteManagerFactory>().GetInstance(new REEFMessageCodec()); IRemoteIdentifier remoteId = new SocketRemoteIdentifier(NetUtilities.ParseIpEndpoint(rId)); RuntimeClock clock = InstantiateClock(); _logger.Log(Level.Info, "Application Id: " + _evaluatorConfig.ApplicationId); EvaluatorSettings evaluatorSettings = new EvaluatorSettings( _evaluatorConfig.ApplicationId, _evaluatorConfig.EvaluatorId, _heartbeatPeriodInMs, _heartbeatMaxRetry, rootContextConfiguration, clock, remoteManager, _injector); HeartBeatManager heartBeatManager = new HeartBeatManager(evaluatorSettings, remoteId); ContextManager contextManager = new ContextManager(heartBeatManager, rootServiceConfig, rootTaskConfig); EvaluatorRuntime evaluatorRuntime = new EvaluatorRuntime(contextManager, heartBeatManager); // TODO: replace with injectionFuture heartBeatManager._evaluatorRuntime = evaluatorRuntime; heartBeatManager._contextManager = contextManager; SetRuntimeHandlers(evaluatorRuntime, clock); Task evaluatorTask = Task.Run(new Action(clock.Run)); evaluatorTask.Wait(); } } catch (Exception e) { Fail(e); } }