From: rahuel Date: Thu, 4 Nov 2004 15:08:55 +0000 (+0000) Subject: ContainersManager/ResourcesManager X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e1614e19f76854e78fc77f423af77fb6c8b8afde;p=modules%2Fkernel.git ContainersManager/ResourcesManager --- diff --git a/idl/ContainersManager.idl b/idl/ContainersManager.idl new file mode 100644 index 000000000..27a112617 --- /dev/null +++ b/idl/ContainersManager.idl @@ -0,0 +1,98 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : ContainersManager.idl +// Author : Jean Rahuel +// $Header: + +#ifndef _CONTAINERSMANAGER_IDL_ +#define _CONTAINERSMANAGER_IDL_ + +#include "SALOME_Component.idl" + +module Containers { + + enum System { Unknown , Linux } ; + + const string DefaultContainerCpp = "FactoryServer" ; + const string DefaultContainerPython = "FactoryServerPy" ; + + struct MachineParameters { + long with_xterm ; + System Os ; + long Memory ; + long CpuClock ; + long NbProc ; + long NbNode ; + string HostName ; + string ContainerName ; + Engines::ContainerType ContainerType ; + string NsHostName ; + long NsPort ; + } ; + + interface Manager { + + MachineParameters Parameters() ; + + boolean ping() ; + + Engines::ListOfContainers AllContainers() ; + + Engines::Container FindOneContainer( in string aHostName , + in string aContainerName ) ; + + Engines::Container FindContainer( in MachineParameters MyParams ) ; + + Engines::ListOfContainers FindContainers( in MachineParameters MyParams ) ; + + Engines::Container FindOrStartContainer( in MachineParameters MyParams ) ; + + Engines::ListOfComponents AllComponents() ; + + Engines::Component FindComponent( in MachineParameters MyParams , + in string ComponentName ) ; + + Engines::Component FindOneComponent( in string aHostName , + in string aContainerName , + in string ComponentName ) ; + + Engines::ListOfComponents FindComponents( in MachineParameters MyParams , + in string ComponentName ) ; + + Engines::Component FindOrLoad_ComponentPath( in MachineParameters MyParams , + in string ComponentName , + in string ImplementationPath ) ; + + Engines::Component FindOrLoad_Component( in MachineParameters MyParams , + in string ComponentName ) ; + + boolean DestroyContainer( in string aHostName , in string aContainerName ) ; + + boolean DestroyContainers( in MachineParameters MyParams ) ; + + void destroy() ; + + } ; + +} ; + +#endif diff --git a/idl/Makefile.in b/idl/Makefile.in index 2615b1f63..5b20a45ac 100644 --- a/idl/Makefile.in +++ b/idl/Makefile.in @@ -25,7 +25,9 @@ IDL_FILES = \ SALOME_MPIContainer.idl \ SALOME_TestMPIComponent.idl \ Logger.idl \ - SALOME_GenericObj.idl + SALOME_GenericObj.idl \ + ResourcesManager.idl \ + ContainersManager.idl PY_CLIENT_IDL = $(IDL_FILES) diff --git a/idl/ResourcesManager.idl b/idl/ResourcesManager.idl new file mode 100644 index 000000000..ef043a1bb --- /dev/null +++ b/idl/ResourcesManager.idl @@ -0,0 +1,120 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : ResourcesManager.idl +// Author : Jean Rahuel +// $Header: + +#ifndef _RESOURCESMANAGER_IDL_ +#define _RESOURCESMANAGER_IDL_ + +#include "SALOME_Component.idl" +#include "ContainersManager.idl" + +module Resources { + + struct ComputerParameters { + string FullName ; + string Alias ; + long SshAccess ; + long Interactive ; + long Batch ; + string UserName ; + Containers::System Os ; + long Memory ; + long Swap ; + long CpuClock ; + long NbProc ; + long NbNode ; + } ; + + typedef sequence ListOfStrings ; + + struct ComputerEnvironment { + ListOfStrings Module_Root_Dir_Names ; + ListOfStrings Module_Root_Dir_Values ; + } ; + + interface Computer ; + + typedef sequence ListOfComputers ; + + interface Computer { + + boolean ping() ; + + string FullName() ; + + string Alias() ; + + boolean IsAlive() ; + + boolean SshAccess() ; + + boolean RshAccess() ; + + boolean Interactive() ; + + boolean Batch() ; + + string UserName() ; + + Containers::System Os() ; + + long Memory() ; + + long Swap() ; + + long CpuClock() ; + + long NbProc() ; + + long NbNode() ; + + ComputerParameters Parameters() ; + + ComputerEnvironment Environment() ; + + } ; + + interface Manager { + + boolean ping() ; + + boolean SshAccess( in string aHostName ) ; + + string UserName( in string aHostName ) ; + + ListOfComputers AllComputers() ; + + ListOfComputers GetComputers( in Containers::MachineParameters aMachineParameters ) ; + + Computer SelectComputer( in Containers::MachineParameters aMachineParameters ) ; + + Computer GetComputer( in ListOfComputers aListOfComputers ) ; + + Computer SearchComputer( in string aComputerName ) ; + + } ; + +} ; + +#endif diff --git a/idl/SALOME_Component.idl b/idl/SALOME_Component.idl index a18580fe7..c68cbb4c9 100644 --- a/idl/SALOME_Component.idl +++ b/idl/SALOME_Component.idl @@ -34,19 +34,29 @@ module Engines { interface Component ; + enum ContainerType { UndefinedContainerType , CppContainer , PythonContainer } ; + /*! \brief Interface of the %Container This interface defines the process of loading and registration of new components in %SALOME application */ + + interface Container ; + + typedef sequence ListOfContainers ; + + typedef sequence ListOfComponents ; + interface Container { + void destroy() ; /*! Initializes the %container with a definite name. \param ContainerName Name of the container \return an initialized container */ - Container start_impl( in string ContainerName ) ; + Container start_impl( in string ContainerName , in Engines::ContainerType aContainerType ) ; /*! Loads into the container a new component, registers it and starts it's CORBA servant. @@ -71,6 +81,11 @@ module Engines */ void ping(); +/*! + Determines whether the type of container (C++ or Python). +*/ + + Engines::ContainerType type(); /*! Name of the %container */