Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/22/13 15:29:15 (12 years ago)
Author:
fschoepp
Message:

#1888:
HL:

  • Web projects requires different users to interact with hive. The singleton HiveServiceLocator.Instance doesn't allow different users at the same time, resulting in serialization during access of HiveClient methods.

The following changes have been introduced in favor of a parallel use of the HL libs:

  • HiveClient, TaskDownloader and ConcurrentTaskDownloader may now use a different IHiveServiceLocator than HiveServiceLocator.Instance (all methods have appropriate overloads now).
  • The default instance is still HiveServiceLocator.Instance.

Automated Scaling of Instances:

  • Added Scaler project to solution which represents a WorkerRole that scales the slave instances based on the global cpu utilization of all slaves.
  • Scaler is based on WASABi, rules can be adjusted in rulesstore.xml. Basic rule is: if < 45% global cpu utilization => remove an instance; if > 65% cpu => add an instance. Minimum boundary is 1 and maximum boundary is 8 slave instances.
  • Adjusted Slave project to automatically register itself to a SlaveGroup during WebRole startup (can be adjusted in service configuration).

Web-Frontend:

  • Added basic error messages to the dialogs when an ajax call fails.
  • Removed Styling.js from scripts.
Location:
branches/OaaS/HeuristicLab.Services.Optimization.Controller/HL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/HL/HLMapper.cs

    r9166 r9508  
    3737    public static DoubleMatrix ConvertToDoubleMatrix(Parameter parameter) {
    3838      var matrix = parameter.Value as DecimalMatrix;
    39       // TODO: Check for empty matrices
     39     
     40      if (matrix.Value.Length == 0 || matrix.Value[0].Length == 0) {
     41        return new DoubleMatrix(new double[0, 0]);
     42      }
     43
    4044      double[,] data = new double[matrix.Value.Length, matrix.Value[0].Length];
    4145      for (int i=0; i < matrix.Value.Length; i++) {
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/HL/HiveScenarioManager.cs

    r9395 r9508  
    8181
    8282    public bool DispatchExperiment(User user, Model.Experiment exp, JobExecutionDetails details) {
    83       // TODO: Determine how to build a tree of IAlgorithm
    8483      // For now the experiment will be flatened for execution
    8584      HeuristicLab.Optimization.Experiment hiveExperiment = new HeuristicLab.Optimization.Experiment(exp.Name);
     
    9493        var entry = stack.Pop();
    9594        // handle current entry
    96 
    97         // TODO: Store scenario name in entry.Child.Mapper when saving
    9895        foreach (var child in entry.Children) {
    9996          // This is a template experiment;
     
    215212      }     
    216213      job.HiveTasks.Add(new OptimizerHiveTask(exp));
    217       var service = ConfigureHive(user);
    218      
    219       // TODO: Fix HiveClient class to be not dependent on singleton HiveServiceLocator!!!
    220       HiveServiceLocator.Instance.Username = user.Username;
    221       HiveServiceLocator.Instance.Password = user.Password;
    222       HiveServiceLocator.Instance.EndpointConfigurationName = Configuration.HiveEndpointName;
    223       HiveClient.Store(job, new CancellationToken());
     214           
     215      var locator = ConfigureHive(user);
     216      HiveClient.Store(job, new CancellationToken(), locator);
    224217     
    225218      job.StopResultPolling();
     
    277270        taskIds.Add(task.Id);
    278271      }
    279 
    280       // TODO: Fix problems with the HiveServiceLocater singleton!!!
    281       HiveServiceLocator.Instance.Username = user.Username;
    282       HiveServiceLocator.Instance.Password = user.Password;
    283       HiveServiceLocator.Instance.EndpointConfigurationName = Configuration.HiveEndpointName;
    284       TaskDownloader downloader = new TaskDownloader(taskIds);
     272 
     273      TaskDownloader downloader = new TaskDownloader(taskIds, ConfigureHive(user));
    285274      downloader.StartAsync();
    286275      while (!downloader.IsFinished) {       
     
    291280        }
    292281      }
    293       //var experiment = dal.JobDao.FindByJobId(user.Username, id);
    294282
    295283      IDictionary<Guid, HiveTask> hiveTasks = downloader.Results;
     
    330318      return runs;
    331319    }
    332 
    333     //TODO: We might need images / +++
    334320   
    335321    private Parameter MapHiveDataType(string name, IItem item) {
     
    341327      var result = new Parameter();
    342328      result.Type = ParameterType.String;
    343       //TODO: How shall we handle dll specific datatypes?     
    344       //if (item is PathTSPTour) {
    345       //  var tour = item as PathTSPTour;           
    346       //}
    347       //else
    348329      if (item is IStringConvertibleValue) {
    349330        var value = (item as IStringConvertibleValue).GetValue();
     
    440421        result.Value = new HeuristicLab.Services.Optimization.ControllerService.Model.StringValue() { Name = name, Value = item.ItemName != null ? item.ItemName + " (Cannot be displayed properly as string)" : "Cannot be displayed properly as string" };
    441422      }
    442       // TODO: Add workaround for TSP
    443423      return result;
    444424    }
     
    541521
    542522    public Model.Task GetTaskData(User u, string jobId, string taskId) {
    543       ConfigureHive(u);
    544       HiveServiceLocator.Instance.Username = u.Username;
    545       HiveServiceLocator.Instance.Password = u.Password;
    546       HiveServiceLocator.Instance.EndpointConfigurationName = Configuration.HiveEndpointName;
    547       TaskDownloader downloader = new TaskDownloader(new List<Guid>(){Guid.Parse(taskId)});
     523      TaskDownloader downloader = new TaskDownloader(new List<Guid>(){Guid.Parse(taskId)}, ConfigureHive(u));
    548524      downloader.StartAsync();
    549525      while (!downloader.IsFinished) {
     
    583559      // push all elements to dictionary
    584560      foreach (var task in jobTasks) {
    585         // TODO: Crawl children + parent and create hierarchy!
    586561        var children = serviceLocator.CallHiveService<IEnumerable<HeuristicLab.Clients.Hive.LightweightTask>>(s => s.GetLightweightChildTasks(Guid.Parse(jobId), true, true));
    587562        foreach (var child in children) {
Note: See TracChangeset for help on using the changeset viewer.