Exemplo n.º 1
0
    def __init__(self):
        '''Create a new (empty) network resource description.'''
        Object.__init__(
            self,
            Object.ResourceNetworkDescription,
            apitype=Object.ResourceAPI,
        )

        self._type = Type.Network
        self._dynamic = False
        self._start = None
        self._end = None
        self._duration = None

        self._register_ro_type(name="Type", accessor=self.__class__.res_type)
        self._register_rw_attribute(name="Dynamic",
                                    accessor=self.__class__.dynamic)
        self._register_rw_attribute(name="Start",
                                    accessor=self.__class__.start)
        self._register_rw_attribute(name="End", accessor=self.__class__.end)
        self._register_rw_attribute(name="Duration",
                                    accessor=self.__class__.duration)

        self._size = ''
        self._label = None

        self._register_rw_attribute(name="Size", accessor=self.__class__.size)
        self._register_rw_attribute(name="Label",
                                    accessor=self.__class__.label)
Exemplo n.º 2
0
 def __init__(self):
     '''PRIVATE: Create a new resource.
     '''
     Object.__init__(self,
                     Object.ResourcResource,
                     apitype=Object.ResourceAPI,
                     session=session)
Exemplo n.º 3
0
    def __init__(self):
        '''Create a new (empty) storage resource description.'''
        Object.__init__(
            self,
            Object.ResourceDescription,
            apitype=Object.JobAPI,
        )

        self._type = Type.Storage
        self._dynamic = False
        self._start = None
        self._end = None
        self._duration = None

        self._register_ro_type(name="Type", accessor=self.__class__.res_type)
        self._register_rw_attribute(name="Dynamic",
                                    accessor=self.__class__.dynamic)
        self._register_rw_attribute(name="Start",
                                    accessor=self.__class__.start)
        self._register_rw_attribute(name="End", accessor=self.__class__.end)
        self._register_rw_attribute(name="Duration",
                                    accessor=self.__class__.duration)

        self._size = ''
        self._mountpoint = None

        self._register_rw_attribute(name="Size", accessor=self.__class__.size)
        self._register_rw_attribute(name="Mountpoint",
                                    accessor=self.__class__.mountpoint)
Exemplo n.º 4
0
    def __init__(self):
        '''Create a new (empty) storage resource description.'''
        Object.__init__(self, Object.ResourceDescription, 
                        apitype=Object.JobAPI,)

        self._type           = Type.Storage
        self._dynamic        = False
        self._start          = None
        self._end            = None
        self._duration       = None
        
        self._register_ro_type          (name="Type", 
                                         accessor=self.__class__.res_type)
        self._register_rw_attribute     (name="Dynamic", 
                                         accessor=self.__class__.dynamic) 
        self._register_rw_attribute     (name="Start", 
                                         accessor=self.__class__.start) 
        self._register_rw_attribute     (name="End", 
                                         accessor=self.__class__.end) 
        self._register_rw_attribute     (name="Duration", 
                                         accessor=self.__class__.duration) 
        
        self._size           = ''
        self._mountpoint     = None
        
        self._register_rw_attribute     (name="Size", 
                                         accessor=self.__class__.size) 
        self._register_rw_attribute     (name="Mountpoint",
                                         accessor=self.__class__.mountpoint) 
Exemplo n.º 5
0
    def __init__(self):
        '''Create a new (empty) network resource description.'''
        Object.__init__(self, Object.ResourceNetworkDescription, 
                        apitype=Object.ResourceAPI,)

        self._type           = Type.Network
        self._dynamic        = False
        self._start          = None
        self._end            = None
        self._duration       = None
        
        self._register_ro_type          (name="Type", 
                                         accessor=self.__class__.res_type)
        self._register_rw_attribute     (name="Dynamic", 
                                         accessor=self.__class__.dynamic) 
        self._register_rw_attribute     (name="Start", 
                                         accessor=self.__class__.start) 
        self._register_rw_attribute     (name="End", 
                                         accessor=self.__class__.end) 
        self._register_rw_attribute     (name="Duration", 
                                         accessor=self.__class__.duration) 
        
        self._size           = ''
        self._label          = None

        self._register_rw_attribute     (name="Size", 
                                         accessor=self.__class__.size) 
        self._register_rw_attribute     (name="Label", 
                                         accessor=self.__class__.label) 
Exemplo n.º 6
0
 def __init__(self):
     '''Construct a new service data object
     '''
     Object.__init__(
         self,
         Object.SDServiceData,
         apitype=Object.JobAPI,
     )
     AttributeInterface.__init__(self)
Exemplo n.º 7
0
    def __init__(self):
        '''Create a new, empty job description.'''
        Object.__init__(
            self,
            Object.JobDescription,
            apitype=Object.JobAPI,
        )
        AttributeInterface.__init__(self)

        self._executable = None
        self._arguments = None
        self._environment = None
        self._file_transfer = None
        self._project = None
        self._output = None
        self._error = None
        self._queue = None
        self._wall_time_limit = None
        self._working_directory = None
        self._contact = None
        self._total_cpu_count = None

        self._number_of_processes = None
        self._spmd_variation = None

        # register properties with the attribute interface
        self._register_rw_attribute(name="Executable",
                                    accessor=self.__class__.executable)
        self._register_rw_attribute(name="Output",
                                    accessor=self.__class__.output)
        self._register_rw_attribute(name="Error",
                                    accessor=self.__class__.error)
        self._register_rw_attribute(name="Queue",
                                    accessor=self.__class__.queue)
        self._register_rw_attribute(name="WallTimeLimit",
                                    accessor=self.__class__.wall_time_limit)
        self._register_rw_attribute(name="WorkingDirectory",
                                    accessor=self.__class__.working_directory)
        self._register_rw_attribute(name="Contact",
                                    accessor=self.__class__.contact)
        self._register_rw_attribute(name="TotalCPUCount",
                                    accessor=self.__class__.total_cpu_count)
        self._register_rw_attribute(
            name="NumberOfProcesses",
            accessor=self.__class__.number_of_processes)
        self._register_rw_attribute(name="SPMDVariation",
                                    accessor=self.__class__.spmd_variation)

        self._register_rw_vec_attribute(name="Arguments",
                                        accessor=self.__class__.arguments)
        self._register_rw_vec_attribute(name="FileTransfer",
                                        accessor=self.__class__.file_transfer)
        self._register_rw_vec_attribute(name="Environment",
                                        accessor=self.__class__.environment)
        self._register_rw_vec_attribute(name="JobProject",
                                        accessor=self.__class__.project)
Exemplo n.º 8
0
    def __init__(self):
        '''PRIVATE Constructor (don't call explicitly!)'''
        Object.__init__(self, Object.Job, apitype=Object.JobAPI)
        AttributeInterface.__init__(self)

        # register properties with the attribute interface
        self._register_ro_attribute(name="Exitcode",
                                    accessor=self.__class__.exitcode)
        self._register_ro_attribute(name="JobID",
                                    accessor=self.__class__.jobid)
        self._register_ro_attribute(name="ServiceURL",
                                    accessor=self.__class__.serviceurl)
Exemplo n.º 9
0
    def __init__(self):
        '''Create a new, empty job description.'''
        Object.__init__(self, Object.JobDescription, 
                        apitype=Object.JobAPI,)
        AttributeInterface.__init__(self)

        self._executable        = None
        self._arguments         = None
        self._environment       = None
        self._file_transfer     = None
        self._project           = None
        self._output            = None
        self._error             = None
        self._queue             = None
        self._wall_time_limit   = None
        self._working_directory = None
        self._contact           = None
        self._total_cpu_count   = None

        self._number_of_processes = None
        self._spmd_variation = None

        # register properties with the attribute interface
        self._register_rw_attribute     (name="Executable", 
                                         accessor=self.__class__.executable) 
        self._register_rw_attribute     (name="Output", 
                                         accessor=self.__class__.output) 
        self._register_rw_attribute     (name="Error", 
                                         accessor=self.__class__.error) 
        self._register_rw_attribute     (name="Queue", 
                                         accessor=self.__class__.queue) 
        self._register_rw_attribute     (name="WallTimeLimit", 
                                         accessor=self.__class__.wall_time_limit) 
        self._register_rw_attribute     (name="WorkingDirectory", 
                                         accessor=self.__class__.working_directory) 
        self._register_rw_attribute     (name="Contact", 
                                         accessor=self.__class__.contact) 
        self._register_rw_attribute     (name="TotalCPUCount", 
                                         accessor=self.__class__.total_cpu_count) 
        self._register_rw_attribute     (name="NumberOfProcesses", 
                                         accessor=self.__class__.number_of_processes) 
        self._register_rw_attribute     (name="SPMDVariation", 
                                         accessor=self.__class__.spmd_variation) 


        self._register_rw_vec_attribute (name="Arguments", 
                                         accessor=self.__class__.arguments) 
        self._register_rw_vec_attribute (name="FileTransfer", 
                                         accessor=self.__class__.file_transfer) 
        self._register_rw_vec_attribute (name="Environment", 
                                         accessor=self.__class__.environment) 
        self._register_rw_vec_attribute (name="JobProject", 
                                         accessor=self.__class__.project) 
Exemplo n.º 10
0
 def __init__(self):
     '''PRIVATE Constructor (don't call explicitly!)'''
     Object.__init__(self, Object.Job, apitype=Object.JobAPI)
     AttributeInterface.__init__(self)
   
     # register properties with the attribute interface 
     self._register_ro_attribute     (name="Exitcode", 
                                      accessor=self.__class__.exitcode) 
     self._register_ro_attribute     (name="JobID", 
                                      accessor=self.__class__.jobid)  
     self._register_ro_attribute     (name="ServiceURL", 
                                      accessor=self.__class__.serviceurl)  
Exemplo n.º 11
0
    def __init__(self):
        '''Create a new (empty) pool resource description.'''
        Object.__init__(self, Object.ResourcePoolDescription, 
                        apitype=Object.ResourceAPI,)

        self._type           = Type.Pool
        self._policy         = 'Default'
        self._access         = None

        # register properties with the attribute interface
        self._register_ro_type          (name="type", 
                                         accessor=self.__class__.res_type)
        self._register_rw_attribute     (name="Policy", 
                                         accessor=self.__class__.policy) 
        self._register_ro_attribute     (name="Access", 
                                         accessor=self.__class__.access) 
Exemplo n.º 12
0
    def __init_from_discoverer(self, discoverer_obj):
        """Constructor"""
        self._discoverer = discoverer_obj
        self._url = discoverer_obj._url

        self._plugin = Object._get_plugin(self)  # throws 'NoSuccess' on error
        self._logger.info("SerivceDiscription object bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 13
0
    def __init__(self, url, session=None):
        '''Construct a new file object
           @param url: Url of the (remote) job manager.
           @type  url: L{Url} 
        '''
        Object.__init__(self, Object.FilesystemFile, 
                        apitype=Object.FilesystemAPI, session=session)

        if(type(url) == str):
            self._url = Url(str(url))
        else:
            self._url = url

        self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error
        self._plugin.register_file_object(self)
        self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 14
0
    def __init_from_service_description(self, service_description_obj):
        '''Constructor'''
        self._discoverer = service_description_obj._discoverer
        self._url = self._discoverer._url

        self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error
        self._logger.info("SerivceData object bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 15
0
    def __init_from_service(self, service_obj, job_desc):
        '''Constructor'''
        self._service = service_obj
        self._url = service_obj._url
        self._job_description = job_desc

        self._plugin = Object._get_plugin(self)  # throws 'NoSuccess' on error
        self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 16
0
    def __init_from_service_description(self, service_description_obj):
        '''Constructor'''
        self._discoverer = service_description_obj._discoverer
        self._url = self._discoverer._url

        self._plugin = Object._get_plugin(self)  # throws 'NoSuccess' on error
        self._logger.info("SerivceData object bound to plugin %s" %
                          (repr(self._plugin)))
Exemplo n.º 17
0
    def __init_from_service(self, service_obj, job_desc):
        '''Constructor'''
        self._service = service_obj
        self._url = service_obj._url
        self._job_description = job_desc

        self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error
        self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 18
0
    def __init_from_discoverer(self, discoverer_obj):
        '''Constructor'''
        self._discoverer = discoverer_obj
        self._url = discoverer_obj._url

        self._plugin = Object._get_plugin(self)  # throws 'NoSuccess' on error
        self._logger.info("SerivceDiscription object bound to plugin %s" %
                          (repr(self._plugin)))
Exemplo n.º 19
0
    def __init_from_manager(self, manager_obj, description):
        '''(Hidden) Constructor'''
        self._manager = manager_obj
        self._url     = manager_obj._url
        self._description = description

        self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error
        self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 20
0
    def __init_from_manager(self, manager_obj, description):
        '''(Hidden) Constructor'''
        self._manager = manager_obj
        self._url = manager_obj._url
        self._description = description

        self._plugin = Object._get_plugin(self)  # throws 'NoSuccess' on error
        self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 21
0
    def __init__(self):
        '''Create a new (empty) pool resource description.'''
        Object.__init__(
            self,
            Object.ResourcePoolDescription,
            apitype=Object.ResourceAPI,
        )

        self._type = Type.Pool
        self._policy = 'Default'
        self._access = None

        # register properties with the attribute interface
        self._register_ro_type(name="type", accessor=self.__class__.res_type)
        self._register_rw_attribute(name="Policy",
                                    accessor=self.__class__.policy)
        self._register_ro_attribute(name="Access",
                                    accessor=self.__class__.access)
Exemplo n.º 22
0
    def __init__(self, url, session=None):
        '''Construct a new job service object
           @param url: Url of the (remote) job manager.
           @type  url: L{Url} 
        '''
        Object.__init__(self, Object.JobService, 
                            apitype=Object.JobAPI, session=session)

        if(type(url) == str):
            self._url = Url(str(url))
        else:
            self._url = url

        self._from_compute = False
        self._compute_obj = None

        self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error
        self._plugin.register_service_object(self)
        self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 23
0
    def __init__(self):
        """Constructor."""
        Object.__init__(self, Object.SDServiceDescription, apitype=Object.JobAPI)
        AttributeInterface.__init__(self)

        self._url = None
        self._type = None
        self._uid = None
        self._site = None
        self._name = None
        self._apiementor = None

        # register properties with the attribute interface
        self._register_ro_attribute(name="URL", accessor=self.__class__.url)
        self._register_ro_attribute(name="UID", accessor=self.__class__.uid)
        self._register_ro_attribute(name="Type", accessor=self.__class__.type)
        self._register_ro_attribute(name="Site", accessor=self.__class__.site)
        self._register_ro_attribute(name="Name", accessor=self.__class__.name)
        self._register_ro_attribute(name="Implementor", accessor=self.__class__.implementor)
Exemplo n.º 24
0
 def __init__(self, service):
     '''Create a new job (a.k.a. 'task') container.
        @param service: Currently, a container needs to be bound to
                        a valid L{saga.job.Service} and can only hold 
                        jobs that are known to that serivce.  
     '''
     Object.__init__(self, Object.JobContainer, apitype=Object.JobAPI)
     
     # parameter checks
     if service.get_type() != Object.JobService:
         raise bliss.saga.Exception(bliss.saga.Error.BadParameter, 
               "Container c'tor expects %s object as parameter" 
               % (Object.JobService))
   
     self._service = service
     self._url = service._url
     self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error
     self._plugin.container_object_register(self)
     self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 25
0
    def __init__(self, service):
        '''Create a new job (a.k.a. 'task') container.
           @param service: Currently, a container needs to be bound to
                           a valid L{saga.job.Service} and can only hold 
                           jobs that are known to that serivce.  
        '''
        Object.__init__(self, Object.JobContainer, apitype=Object.JobAPI)

        # parameter checks
        if service.get_type() != Object.JobService:
            raise bliss.saga.Exception(
                bliss.saga.Error.BadParameter,
                "Container c'tor expects %s object as parameter" %
                (Object.JobService))

        self._service = service
        self._url = service._url
        self._plugin = Object._get_plugin(self)  # throws 'NoSuccess' on error
        self._plugin.container_object_register(self)
        self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 26
0
    def __init__(self):
        '''Create a new (empty) compute resource description.'''
        Object.__init__(
            self,
            Object.ResourceComputeDescription,
            apitype=Object.ResourceAPI,
        )

        self._type = Type.Compute
        self._dynamic = False
        self._start = None
        self._end = None
        self._duration = None

        self._register_ro_type(name="Type", accessor=self.__class__.res_type)
        self._register_rw_attribute(name="Dynamic",
                                    accessor=self.__class__.dynamic)
        self._register_rw_attribute(name="Start",
                                    accessor=self.__class__.start)
        self._register_rw_attribute(name="End", accessor=self.__class__.end)
        self._register_rw_attribute(name="Duration",
                                    accessor=self.__class__.duration)

        self._slots = 1
        self._memory = None
        self._hostnames = None
        self._os = 'Any'
        self._arch = 'Any'

        self._register_rw_vec_attribute(
            name="OperatingSystem", accessor=self.__class__.operating_system)
        self._register_rw_vec_attribute(name="Architecture",
                                        accessor=self.__class__.architecture)
        self._register_rw_vec_attribute(name="Hostnames",
                                        accessor=self.__class__.hostnames)
        self._register_rw_attribute(name="Slots",
                                    accessor=self.__class__.slots)
        self._register_rw_attribute(name="Memory",
                                    accessor=self.__class__.memory)
        self._register_ro_attribute(name="Access",
                                    accessor=self.__class__.access)
Exemplo n.º 27
0
    def __init__(self, url, session=None):
        '''Construct a new job service object
           @param url: Url of the (remote) job manager.
           @type  url: L{Url} 
        '''
        Object.__init__(self,
                        Object.JobService,
                        apitype=Object.JobAPI,
                        session=session)

        if (type(url) == str):
            self._url = Url(str(url))
        else:
            self._url = url

        self._from_compute = False
        self._compute_obj = None

        self._plugin = Object._get_plugin(self)  # throws 'NoSuccess' on error
        self._plugin.register_service_object(self)
        self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
Exemplo n.º 28
0
    def __init__(self):
        '''Create a new (empty) compute resource description.'''
        Object.__init__(self, Object.ResourceComputeDescription, 
                        apitype=Object.ResourceAPI,)

        self._type           = Type.Compute
        self._dynamic        = False
        self._start          = None
        self._end            = None
        self._duration       = None

        self._register_ro_type          (name="Type", 
                                             accessor=self.__class__.res_type)
        self._register_rw_attribute     (name="Dynamic", 
                                             accessor=self.__class__.dynamic) 
        self._register_rw_attribute     (name="Start", 
                                             accessor=self.__class__.start) 
        self._register_rw_attribute     (name="End", 
                                             accessor=self.__class__.end) 
        self._register_rw_attribute     (name="Duration", 
                                             accessor=self.__class__.duration) 
        
        self._slots          = 1
        self._memory         = None
        self._hostnames      = None
        self._os             = 'Any'
        self._arch           = 'Any'

        self._register_rw_vec_attribute (name="OperatingSystem", 
                                         accessor=self.__class__.operating_system) 
        self._register_rw_vec_attribute (name="Architecture", 
                                         accessor=self.__class__.architecture)
        self._register_rw_vec_attribute (name="Hostnames", 
                                         accessor=self.__class__.hostnames)
        self._register_rw_attribute     (name="Slots", 
                                         accessor=self.__class__.slots)
        self._register_rw_attribute     (name="Memory", 
                                         accessor=self.__class__.memory) 
        self._register_ro_attribute     (name="Access", 
                                         accessor=self.__class__.access) 
Exemplo n.º 29
0
    def __init__(self, urlstring=''):
        '''Construct a new Url from a string'''

        Object.__init__(self, objtype=Object.Url, apitype=Object.BaseAPI)

        self._urlobj  = urlparse.urlparse(urlstring)
        
        if self._urlobj.netloc.find(":") > 0:
            (host,port) = self._urlobj.netloc.split(":")
        else:
            host = self._urlobj.netloc
            port = None

        self.scheme   = self._urlobj.scheme
        '''The scheme part of the Url.'''
        self.host     = self._urlobj.hostname #host
        '''The host part of the Url.'''
        if self._urlobj.port is not None:
            self.port     = int(self._urlobj.port) # int(port)
            '''The port part of the Url.'''
        else:
            self.port     = None
        self.username = self._urlobj.username
        '''The username part of the Url.'''
        self.password = self._urlobj.password
        '''The password part of the Url.'''
        self.path     = self._urlobj.path
        '''The path part of the Url.'''
        self.params   = self._urlobj.params
        '''The params part of the Url.'''
        self.query    = self._urlobj.query
        '''The query part of the Url.'''
        self.fragment = self._urlobj.fragment
        '''The fragment part of the Url.'''
        self.url      = self._urlobj.geturl()
        '''The Url as string (same as __str__).'''
Exemplo n.º 30
0
    def __init__(self, urlstring=''):
        '''Construct a new Url from a string'''

        Object.__init__(self, objtype=Object.Url, apitype=Object.BaseAPI)

        self._urlobj = urlparse.urlparse(urlstring)

        if self._urlobj.netloc.find(":") > 0:
            (host, port) = self._urlobj.netloc.split(":")
        else:
            host = self._urlobj.netloc
            port = None

        self.scheme = self._urlobj.scheme
        '''The scheme part of the Url.'''
        self.host = self._urlobj.hostname  #host
        '''The host part of the Url.'''
        if self._urlobj.port is not None:
            self.port = int(self._urlobj.port)  # int(port)
            '''The port part of the Url.'''
        else:
            self.port = None
        self.username = self._urlobj.username
        '''The username part of the Url.'''
        self.password = self._urlobj.password
        '''The password part of the Url.'''
        self.path = self._urlobj.path
        '''The path part of the Url.'''
        self.params = self._urlobj.params
        '''The params part of the Url.'''
        self.query = self._urlobj.query
        '''The query part of the Url.'''
        self.fragment = self._urlobj.fragment
        '''The fragment part of the Url.'''
        self.url = self._urlobj.geturl()
        '''The Url as string (same as __str__).'''
Exemplo n.º 31
0
    def __init__(self):
        '''Constructor.'''
        Object.__init__(
            self,
            Object.SDServiceDescription,
            apitype=Object.JobAPI,
        )
        AttributeInterface.__init__(self)

        self._url = None
        self._type = None
        self._uid = None
        self._site = None
        self._name = None
        self._apiementor = None

        # register properties with the attribute interface
        self._register_ro_attribute(name="URL", accessor=self.__class__.url)
        self._register_ro_attribute(name="UID", accessor=self.__class__.uid)
        self._register_ro_attribute(name="Type", accessor=self.__class__.type)
        self._register_ro_attribute(name="Site", accessor=self.__class__.site)
        self._register_ro_attribute(name="Name", accessor=self.__class__.name)
        self._register_ro_attribute(name="Implementor",
                                    accessor=self.__class__.implementor)
Exemplo n.º 32
0
 def __init__(self):
     '''PRIVATE: Create a new resource.
     '''
     Object.__init__(self, Object.ResourcResource, 
                     apitype=Object.ResourceAPI, session=session)
Exemplo n.º 33
0
 def __init__(self):
     '''Construct a new service data object
     '''
     Object.__init__(self, Object.SDServiceData, 
                     apitype=Object.JobAPI,)
     AttributeInterface.__init__(self)