Changeset 4285
- Timestamp:
- 08/23/10 13:07:11 (14 years ago)
- Location:
- branches/3.3-HiveMigration/sources/HeuristicLab.Hive
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive 3.3.sln
r4253 r4285 492 492 EndGlobalSection 493 493 GlobalSection(NestedProjects) = preSolution 494 {89F4BC52-C174-481E-9BD2-3814171020E8} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668}495 {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668}496 {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668}497 {5010BD86-23B7-4F8C-888A-76D21AD5266A} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668}498 {1605256A-1CB3-44AB-AAFF-577093EE5789} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668}499 494 {A04AE929-D0E1-466D-A9D3-BF3C4B2C209F} = {E7D8EFDA-B0CB-4B62-8EAE-2CF473F14D74} 500 495 {42A1D075-6C12-4DD9-B0C2-C6F5210A8119} = {E7D8EFDA-B0CB-4B62-8EAE-2CF473F14D74} … … 516 511 {5CDACE54-5FB2-4344-A21C-963F63CB7C2B} = {BD1DE6F6-A188-4D1F-9681-BA7104818370} 517 512 {D17A4D6A-4CAA-4470-8A19-F42463C021FD} = {BD1DE6F6-A188-4D1F-9681-BA7104818370} 513 {89F4BC52-C174-481E-9BD2-3814171020E8} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668} 514 {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668} 515 {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668} 516 {5010BD86-23B7-4F8C-888A-76D21AD5266A} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668} 517 {1605256A-1CB3-44AB-AAFF-577093EE5789} = {DC8C63A5-7B57-4B3A-A74A-6F42C7DD1668} 518 518 {55B89815-F3E7-4D09-9442-273F849141DD} = {4F2D8149-D608-42B3-BB1C-6909BDA2B350} 519 519 EndGlobalSection -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Interfaces/IServerConsoleFacade.cs
r4263 r4285 32 32 /// Facade for the server management console 33 33 /// </summary> 34 [ServiceContract( SessionMode=SessionMode.Required)]34 [ServiceContract()] 35 35 public interface IServerConsoleFacade : ISlaveManager, 36 36 IJobManager { -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/WcfSettings.cs
r2607 r4285 73 73 /// </summary> 74 74 /// <returns></returns> 75 public static string GetActiveIP() { 76 return System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections()[0].LocalEndPoint.Address.ToString(); 75 public static IPAddress GetActiveIP() { 76 //return System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections()[0].LocalEndPoint.Address.ToString(); 77 IPAddress[] addresses; 78 addresses = Dns.GetHostAddresses(Dns.GetHostName()); 79 int index = 0; 80 if (System.Environment.OSVersion.Version.Major >= 6) { 81 for (index = addresses.Length - 1; index >= 0; index--) 82 if (addresses[index].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) 83 break; 84 } 85 return addresses[index]; 77 86 } 78 87 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/DefaultScheduler.cs
r4267 r4285 31 31 using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) { 32 32 SlaveDto slave = DaoLocator.SlaveDao.FindById(slaveId); 33 LinkedList<JobDto> allOfflineJobsForSlave = new LinkedList<JobDto>(DaoLocator.JobDao.FindFittingJobsForSlave(JobState.Offline, slave.NrOfFreeCores, slave.FreeMemory, slave.Id)); 34 if (allOfflineJobsForSlave != null && allOfflineJobsForSlave.Count > 0) { 35 jobToCalculate = allOfflineJobsForSlave.First.Value; 36 jobToCalculate.State = JobState.Calculating; 37 jobToCalculate.Slave = slave; 38 jobToCalculate.Slave.State = SlaveState.Calculating; 39 jobToCalculate.DateCalculated = DateTime.Now; 40 DaoLocator.JobDao.AssignSlaveToJob(slave.Id, jobToCalculate.Id); 41 DaoLocator.JobDao.Update(jobToCalculate); 42 DaoLocator.SlaveDao.Update(jobToCalculate.Slave); 33 if (slave != null) { 34 LinkedList<JobDto> allOfflineJobsForSlave = new LinkedList<JobDto>(DaoLocator.JobDao.FindFittingJobsForSlave(JobState.Offline, slave.NrOfFreeCores, slave.FreeMemory, slave.Id)); 35 if (allOfflineJobsForSlave != null && allOfflineJobsForSlave.Count > 0) { 36 jobToCalculate = allOfflineJobsForSlave.First.Value; 37 jobToCalculate.State = JobState.Calculating; 38 jobToCalculate.Slave = slave; 39 jobToCalculate.Slave.State = SlaveState.Calculating; 40 jobToCalculate.DateCalculated = DateTime.Now; 41 DaoLocator.JobDao.AssignSlaveToJob(slave.Id, jobToCalculate.Id); 42 DaoLocator.JobDao.Update(jobToCalculate); 43 DaoLocator.SlaveDao.Update(jobToCalculate.Slave); 44 } 43 45 } 44 46 scope.Complete(); -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/HeuristicLab.Hive.Server.Core-3.3.csproj
r4267 r4285 11 11 <RootNamespace>HeuristicLab.Hive.Server.Core</RootNamespace> 12 12 <AssemblyName>HeuristicLab.Hive.Server.Core-3.3</AssemblyName> 13 <ProjectTypeGuids>{3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> 13 14 <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> 14 15 <FileAlignment>512</FileAlignment> … … 96 97 </Reference> 97 98 <Reference Include="System.Drawing" /> 99 <Reference Include="System.Runtime.Serialization" /> 98 100 <Reference Include="System.ServiceModel"> 99 101 <RequiredTargetFramework>3.0</RequiredTargetFramework> … … 143 145 </ItemGroup> 144 146 <ItemGroup> 147 <None Include="app.config" /> 145 148 <None Include="HeuristicLab.snk" /> 146 149 <EmbeddedResource Include="Authorization\HivePermissionSet.xsd"> … … 185 188 </ProjectReference> 186 189 </ItemGroup> 187 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 190 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 191 <ProjectExtensions> 192 <VisualStudio> 193 <FlavorProperties GUID="{3D9AD99F-2412-4246-B90B-4EAA41C64699}"> 194 <WcfProjectProperties> 195 <AutoStart>False</AutoStart> 196 </WcfProjectProperties> 197 </FlavorProperties> 198 </VisualStudio> 199 </ProjectExtensions> 188 200 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 189 201 Other similar extension points exist, see Microsoft.Common.targets. -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/SlaveCommunicator.cs
r4267 r4285 34 34 using HeuristicLab.Tracing; 35 35 using HeuristicLab.Hive.Contracts.ResponseObjects; 36 using System.Security.Permissions; 36 37 37 38 namespace HeuristicLab.Hive.Server.Core { -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/HeuristicLab.Hive.Server-3.3.csproj
r4254 r4285 109 109 <RequiredTargetFramework>3.0</RequiredTargetFramework> 110 110 </Reference> 111 <Reference Include="System.ServiceProcess" /> 111 112 <Reference Include="System.Transactions" /> 112 113 <Reference Include="System.Xml.Linq"> … … 149 150 </ProjectReference> 150 151 </ItemGroup> 151 <Import Project="$(MSBuild ToolsPath)\Microsoft.CSharp.targets" />152 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 152 153 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 153 154 Other similar extension points exist, see Microsoft.Common.targets. … … 165 166 call PreBuildEvent.cmd</PreBuildEvent> 166 167 </PropertyGroup> 168 <PropertyGroup> 169 <PostBuildEvent> 170 </PostBuildEvent> 171 </PropertyGroup> 167 172 </Project> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/HeuristicLabHiveServerApplication.cs
r4267 r4285 35 35 [Application("Hive Server", "Server application for the distributed hive engine.", true)] 36 36 public class HeuristicLabHiveServerApplication : ApplicationBase { 37 public const string STR_SlaveCommunicator = " SlaveCommunicator";37 public const string STR_SlaveCommunicator = "HiveServer"; 38 38 public const string STR_ServerConsoleFacade = "ServerConsoleFacade"; 39 39 public const string STR_ExecutionEngineFacade = "ExecutionEngineFacade"; 40 41 private Dictionary<string, ServiceHost> runningServices = new Dictionary<string, ServiceHost>(); 42 private NetTcpBinding binding = (NetTcpBinding)WcfSettings.GetBinding(); 43 private NetTcpBinding streamedBinding = (NetTcpBinding)WcfSettings.GetStreamedBinding(); 44 45 private enum Services { 46 SlaveCommunicator, 47 ServerConsoleFacade, 48 ExecutionEngineFacade, 49 All 50 } 51 52 private bool AddMexEndpoint(ServiceHost serviceHost) { 53 if (serviceHost != null) { 54 ServiceMetadataBehavior behavior = new ServiceMetadataBehavior(); 55 serviceHost.Description.Behaviors.Add(behavior); 56 57 return serviceHost.AddServiceEndpoint( 58 typeof(IMetadataExchange), 59 MetadataExchangeBindings.CreateMexTcpBinding(), 60 "mex") != null; 61 } else 62 return false; 63 } 64 65 private Uri StartService(Services svc, IPAddress ipAddress, int port) { 66 string curServiceHost = ""; 67 Uri uriTcp; 68 ISlaveFacade clientCommunicatorInstance = ApplicationManager.Manager.GetInstances<ISlaveFacade>().First(); 69 IServerConsoleFacade serverConsoleInstance = ApplicationManager.Manager.GetInstances<IServerConsoleFacade>().First(); 70 IExecutionEngineFacade executionEngineInstance = ApplicationManager.Manager.GetInstances<IExecutionEngineFacade>().First(); 71 //SpringServiceHost serviceHost = null; 72 ServiceHost serviceHost = null; 73 74 switch (svc) { 75 case Services.SlaveCommunicator: 76 // if (clientCommunicatorInstances.Count() > 0) { 77 uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/HiveServer/"); 78 serviceHost = new ServiceHost(clientCommunicatorInstance.GetType(), uriTcp); 79 //serviceHost = new ServiceHost(typeof(SlaveFacade), uriTcp); 80 //serviceHost = new SpringServiceHost("clientFacade", uriTcp); 81 serviceHost.AddServiceEndpoint(typeof(ISlaveFacade), streamedBinding, STR_SlaveCommunicator); 82 83 ServiceDebugBehavior sdb = serviceHost.Description.Behaviors.Find<ServiceDebugBehavior>(); 84 if (sdb == null) { 85 sdb = new ServiceDebugBehavior(); 86 serviceHost.Description.Behaviors.Add(sdb); 87 } 88 sdb.IncludeExceptionDetailInFaults = true; 89 90 91 92 curServiceHost = STR_SlaveCommunicator; 93 // } 94 break; 95 case Services.ServerConsoleFacade: 96 // if (serverConsoleInstances.Count() > 0) { 97 uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/HiveServerConsole/"); 98 serviceHost = new ServiceHost(serverConsoleInstance.GetType(), uriTcp); 99 //serviceHost = new SpringServiceHost("serverConsoleFacade", uriTcp); 100 serviceHost.AddServiceEndpoint(typeof(IServerConsoleFacade), binding, STR_ServerConsoleFacade); 101 curServiceHost = STR_ServerConsoleFacade; 102 // } 103 break; 104 case Services.ExecutionEngineFacade: 105 // if (executionEngineInstances.Count() > 0) { 106 uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/ExecutionEngine/"); 107 serviceHost = new ServiceHost(executionEngineInstance.GetType(), uriTcp); 108 //serviceHost = new SpringServiceHost("executionEngineFacade", uriTcp); 109 serviceHost.AddServiceEndpoint(typeof(IExecutionEngineFacade), streamedBinding, STR_ExecutionEngineFacade); 110 curServiceHost = STR_ExecutionEngineFacade; 111 // } 112 break; 113 case Services.All: 114 throw new InvalidOperationException("Not supported!"); 115 default: 116 return null; 117 } 118 if (!String.IsNullOrEmpty(curServiceHost)) { 119 AddMexEndpoint(serviceHost); 120 //WcfSettings.SetServiceCertificate(serviceHost); 121 serviceHost.Open(); 122 runningServices.Add(curServiceHost, serviceHost); 123 return serviceHost.BaseAddresses[0]; 124 } else 125 return null; 126 } 127 128 private void StopService(Services svc) { 129 ServiceHost svcHost = null; 130 switch (svc) { 131 case Services.SlaveCommunicator: 132 runningServices.TryGetValue(STR_SlaveCommunicator, out svcHost); 133 break; 134 case Services.ServerConsoleFacade: 135 runningServices.TryGetValue(STR_ServerConsoleFacade, out svcHost); 136 break; 137 case Services.ExecutionEngineFacade: 138 runningServices.TryGetValue(STR_ExecutionEngineFacade, out svcHost); 139 break; 140 case Services.All: 141 foreach (KeyValuePair<string, ServiceHost> item in runningServices) 142 item.Value.Close(); 143 return; 144 default: 145 throw new InvalidOperationException("Not supported!"); 146 } 147 svcHost.Close(); 148 } 40 Dictionary<string, Uri> baseAddrDict = new Dictionary<string, Uri>(); 149 41 150 42 public override void Run() { 151 IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName()); 152 int index = 0; 153 if (System.Environment.OSVersion.Version.Major >= 6) { 154 for (index = addresses.Length - 1; index >= 0; index--) 155 if (addresses[index].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) 156 break; 157 } 43 ServiceHost slaveHost = new ServiceHost(ApplicationManager.Manager.GetTypes(typeof(ISlaveFacade)).First(), GetUri(STR_SlaveCommunicator)); 44 slaveHost.Open(); 158 45 159 //Start services and record their base address160 Dictionary<string, Uri> baseAddrDict = new Dictionary<string, Uri>();161 baseAddrDict.Add(STR_SlaveCommunicator, StartService(Services.SlaveCommunicator, addresses[index], WcfSettings.DEFAULTPORT)); 162 baseAddrDict.Add(STR_ServerConsoleFacade, StartService(Services.ServerConsoleFacade, addresses[index], WcfSettings.DEFAULTPORT));163 baseAddrDict.Add(STR_ExecutionEngineFacade, StartService(Services.ExecutionEngineFacade, addresses[index], WcfSettings.DEFAULTPORT));46 ServiceHost serverConsoleHost = new ServiceHost(ApplicationManager.Manager.GetTypes(typeof(IServerConsoleFacade)).First(), GetUri(STR_ServerConsoleFacade)); 47 serverConsoleHost.Open(); 48 49 ServiceHost executionEngineHost = new ServiceHost(ApplicationManager.Manager.GetTypes(typeof(IExecutionEngineFacade)).First(), GetUri(STR_ExecutionEngineFacade)); 50 executionEngineHost.Open(); 164 51 165 52 ILifecycleManager lifecycleManager = ServiceLocator.GetLifecycleManager(); 166 167 53 lifecycleManager.Init(); 168 54 … … 170 56 Application.Run(); 171 57 58 slaveHost.Close(); 59 serverConsoleHost.Close(); 60 executionEngineHost.Close(); 61 172 62 lifecycleManager.Shutdown(); 173 174 StopService(Services.All);175 63 } 64 65 private Uri GetUri(string serviceName) { 66 string ipAddress = WcfSettings.GetActiveIP().ToString(); 67 string port = WcfSettings.DEFAULTPORT.ToString(); 68 Uri uriHttp = new Uri("http://" + ipAddress + ":" + port + "/" + serviceName + "/"); 69 baseAddrDict.Add(serviceName, uriHttp); 70 return uriHttp; 71 } 72 176 73 } 177 74 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.ExecutionEngine/3.3/Executor.cs
r4253 r4285 77 77 public void Abort() { 78 78 CurrentMessage = MessageContainer.MessageType.AbortJob; 79 Job.Stop(); 79 if (Job.ExecutionState != Core.ExecutionState.Stopped) { 80 Job.Stop(); 81 } 80 82 } 81 83 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/Files.txt
r4253 r4285 14 14 HeuristicLab.Hive.Slave.ExecutionEngine\3.3:HeuristicLab.Hive.Slave.ExecutionEngine-3.3.dll 15 15 16 HeuristicLab.Hive.Engine\3.3:HeuristicLab.Hive.Engine-3.3.dll17 16 HeuristicLab.Hive.Experiment\3.3:HeuristicLab.Hive.Experiment-3.3.dll 18 17 HeuristicLab.Hive.Experiment.Views\3.3:HeuristicLab.Hive.Experiment.Views-3.3.dll … … 38 37 ;HeuristicLab.Security.Server\3.3:HeuristicLab.Security.Server-3.3.dll 39 38 40 ;External Libraries41 ;HeuristicLab.ExtLibs\HeuristicLab.SpringNET\1.3.0:HeuristicLab.SpringNET-1.3.0.dll42 ;HeuristicLab.ExtLibs\HeuristicLab.SpringNET\1.3.0:Common.Logging.dll43 ;HeuristicLab.ExtLibs\HeuristicLab.SpringNET\1.3.0:Spring.Aop.dll44 ;HeuristicLab.ExtLibs\HeuristicLab.SpringNET\1.3.0:Spring.Core.dll45 ;HeuristicLab.ExtLibs\HeuristicLab.SpringNET\1.3.0:Spring.Services.dll -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/HeuristicLab 3.3.exe.config
r4136 r4285 10 10 <connectionStrings> 11 11 </connectionStrings> 12 13 <!-- [chn] TODO: system.web should be located in HeuristicLab.Hive.Server.Core/app.config, but the ConfigMerger does not merge system.web (yet) --> 14 <system.web> 15 <membership> 16 <providers> 17 <clear/> 18 <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="HeuristicLab.Authentication" 19 enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" 20 maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" 21 applicationName="HeuristicLab.Authentication" /> 22 </providers> 23 </membership> 24 25 <roleManager enabled="true"> 26 <providers> 27 <clear/> 28 <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="HeuristicLab.Authentication" applicationName="HeuristicLab.Authentication" /> 29 </providers> 30 </roleManager> 31 </system.web> 32 12 33 <system.serviceModel> 13 34 <behaviors> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/MergeConfigs.cmd
r4253 r4285 1 2 3 ConfigMerger "%SolutionDir%HeuristicLab.Hive.Experiment\3.3\app.config" "HeuristicLab.Hive-3.3.dll.config" 4 ConfigMerger "%SolutionDir%HeuristicLab.Hive.Server.Core\3.3\app.config" "HeuristicLab.Hive-3.3.dll.config" 1 5 ConfigMerger "%SolutionDir%HeuristicLab.Hive.Server.LINQDataAccess\3.3\app.config" "HeuristicLab.Hive-3.3.dll.config" 2 6 ConfigMerger "%SolutionDir%HeuristicLab.Hive.Slave.Core\3.3\app.config" "HeuristicLab.Hive-3.3.dll.config" 3 ConfigMerger "%SolutionDir%HeuristicLab.Hive.Experiment\3.3\app.config" "HeuristicLab.Hive-3.3.dll.config"4 7 ConfigMerger "%SolutionDir%HeuristicLab.Hive.Tracing\3.3\app.config" "HeuristicLab.Hive-3.3.dll.config" 5 8
Note: See TracChangeset
for help on using the changeset viewer.