Ignore:
Timestamp:
Apr 28, 2010 4:09:53 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
12658df
Parents:
05fceef
Message:

New syntax for testbeds that includes a /instance rider. This allows users to
request multiple segments from a single testbed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    r05fceef rab847bc  
    816816                        "More than one project export is not supported")
    817817
    818         uri = self.tbmap.get(tb, None)
     818        uri = self.tbmap.get(testbed_base(tb), None)
    819819        if not uri:
    820820            raise service_error(service_error.server_config,
     
    11201120            # Create and start a thread to start the segment, and save it
    11211121            # to get the return value later
     1122            tb_attrs = copy.copy(attrs)
    11221123            thread_pool.wait_for_slot()
    1123             uri = tbparams[tb].get('uri', self.tbmap.get(tb, None))
     1124            uri = tbparams[tb].get('uri', \
     1125                    self.tbmap.get(testbed_base(tb), None))
     1126            base, suffix = split_testbed(tb)
     1127            if suffix:
     1128                tb_attrs.append({'attribute': 'experiment_name',
     1129                    'value': "%s_%s" % (eid, suffix)})
     1130            else:
     1131                tb_attrs.append({'attribute': 'experiment_name', 'value': eid})
    11241132            if not uri:
    11251133                raise service_error(service_error.internal,
     
    11411149            t  = self.pooled_thread(\
    11421150                    target=s, name=tb,
    1143                     args=(uri, aid, topo[tb], masters, attrs, connInfo[tb]),
     1151                    args=(uri, aid, topo[tb], masters, tb_attrs, connInfo[tb]),
    11441152                    pdata=thread_pool, trace_file=self.trace_file)
    11451153            threads.append(t)
     
    17231731            try:
    17241732                os.makedirs(configdir)
    1725             except IOError, e:
    1726                 raise service_error(
     1733            except EnvironmentError, e:
     1734                raise service_error(service_error.internal,
    17271735                        "Cannot create config directory: %s" % e)
    17281736            try:
     
    17521760            part.add_portals(top, topo, eid, masters, tbparams, ip_allocator,
    17531761                    connInfo, expid)
    1754             # Now get access to the dynamic testbeds
    1755             for k, t in topo.items():
    1756                 if not t.get_attribute('dynamic'):
    1757                     continue
    1758                 tb = t.get_attribute('testbed')
    1759                 if tb:
    1760                     self.get_access(tb, None, tbparams, export_project,
    1761                             access_user, masters)
    1762                     tbparams[k] = tbparams[tb]
    1763                     del tbparams[tb]
    1764                     allocated[k] = 1
    1765                     store_keys = t.get_attribute('store_keys')
    1766                     # Give the testbed access to keys it exports or imports
    1767                     if store_keys:
    1768                         for sk in store_keys.split(" "):
    1769                             self.auth.set_attribute(\
    1770                                     tbparams[k]['allocID']['fedid'], sk)
    1771                 else:
    1772                     raise service_error(service_error.internal,
    1773                             "Dynamic allocation from no testbed!?")
     1762            # Now get access to the dynamic testbeds (those added above)
     1763            for tb in [ t for t in topo if t not in allocated]:
     1764                self.get_access(tb, None, tbparams, access_user, masters)
     1765                allocated[tb] = 1
     1766                store_keys = topo[tb].get_attribute('store_keys')
     1767                # Give the testbed access to keys it exports or imports
     1768                if store_keys:
     1769                    for sk in store_keys.split(" "):
     1770                        self.auth.set_attribute(\
     1771                                tbparams[tb]['allocID']['fedid'], sk)
    17741772
    17751773            self.wrangle_software(expid, top, topo, tbparams)
     
    18481846                            (self.repo_url, expid)
    18491847                },
    1850                 {
    1851                     'attribute': 'experiment_name',
    1852                     'value': eid,
    1853                 },
    18541848            ]
    18551849
Note: See TracChangeset for help on using the changeset viewer.