Changeset c261c0f for fedd


Ignore:
Timestamp:
Feb 1, 2013 5:15:31 PM (12 years ago)
Author:
Ted Faber <faber@…>
Branches:
master
Children:
e48d8eb
Parents:
f7fc551
Message:

Moving to new name and creating real federation connections

Location:
fedd/federation
Files:
1 edited
2 moved

Legend:

Unmodified
Added
Removed
  • fedd/federation/containers_access.py

    rf7fc551 rc261c0f  
    3030from deter import topdl
    3131import list_log
    32 import benito_segment
     32import containers_segment
    3333
    3434
     
    5656        emulab_access.__init__(self, config, auth)
    5757
     58        self.containerize = config.get('access', 'containerize')
     59
    5860        # Segment creation is where most of the differences are.
    59         self.start_segment = benito_segment.start_segment
    60         self.stop_segment = benito_segment.stop_segment
    61         self.info_segment = benito_segment.info_segment
     61        self.start_segment = containers_segment.start_segment
     62        self.stop_segment = containers_segment.stop_segment
     63        self.info_segment = containers_segment.info_segment
    6264
    6365    # These are subroutines for StartSegment
     
    6567        """
    6668        Benito is expecting a topdl file, so this routine is misnamed.  It does
    67         clean up the topdl, removing elements benito doesn't understand and
     69        clean up the topdl, removing elements containers doesn't understand and
    6870        writing out the file.
    6971        """
     
    7981            if isinstance(e, topdl.Segment):
    8082                t.elements.remove(e)
     83            if not isinstance(e, topdl.Computer): continue
     84            if e.get_attribute('portal'):
     85                e.set_attribute('containers:node_type', 'embedded_pnode')
    8186            # Fix software paths
    8287            for s in getattr(e, 'software', []):
     
    8691        t.incorporate_elements()
    8792
    88         # Convert to ns and write it out
     93        # Write it out
    8994        expfile = topdl.topology_to_xml(t, top='experiment')
    9095        try:
  • fedd/federation/containers_segment.py

    rf7fc551 rc261c0f  
    2424        ssh_emulab_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
    2525        xmlrpc_emulab_segment.__init__(self, boss=boss, ops=ops, cert=cert)
    26         self.start_mixed = '/share/benito/start_mixed %s %s %s'
    27         self.start_qemu =  '/share/benito/start_qemu %s %s %s'
     26        # XXX: better way to work this...
     27        self.containerize = '/share/containers-dev/containerize.py --config /share/containers-dev/site.conf %s %s %s'
    2828
    2929    def get_mapping(self, pid, eid):
    3030        """
    31         Benito's info reporting is not sufficient to support this yet
     31        Containers's info reporting is not sufficient to support this yet
    3232        """
    3333        pass
     
    103103        """
    104104
    105         # benito listens to the filename extension.  tclfile here is really
     105        # containers listens to the filename extension.  tclfile here is really
    106106        # topdl, but we'll move it to a different filename.
    107107        if tclfile.endswith('.tcl'):
    108108            topdlfile = os.path.join(tmpdir, 'experiment.xml')
    109             os.rename(tclfile, topdlfile)
     109            self.ssh_cmd(user, self.ops, 'mv %s %s' % (tclfile, topdlfile))
    110110        else:
    111111            topdlfile = tclfile
     
    117117            self.terminate_exp(pid, eid)
    118118
    119         top = topdl.topology_from_xml(filename=topdlfile, top='experiment')
    120         embedded = False
    121         for e in top.elements:
    122             if isinstance(e, topdl.Computer) and \
    123                     e.get_attribute('partition') is not None:
    124                 embedded = True
    125                 break
    126         # on the for
    127         else:
    128             embedded = False
    129 
    130         if embedded:
    131             cmd = self.start_mixed  %  (pid, eid, topdlfile)
    132         else:
    133             cmd = self.start_qemu % (pid, eid, topdlfile, 20)
     119        cmd = self.containerize  %  (pid, eid, topdlfile)
    134120
    135121        if not self.ssh_cmd(user, self.ops, cmd):
    136             self.log.error("Cannot create benito experiment")
     122            self.log.error("Cannot create containers experiment")
     123            return False
     124
     125        if not self.set_up_experiment_filespace(user, self.ops,
     126                pid, eid, tmpdir):
    137127            return False
    138128
  • fedd/federation/deter_impl.py

    rf7fc551 rc261c0f  
    77import protogeni_access
    88import deter_internal_access
    9 import benito_access
     9import containers_access
    1010import desktop_access
    1111import skeleton_access
     
    8888                    self.access = deter_internal_access.access(config,
    8989                            self.auth)
    90                 elif self.access_type == "benito":
    91                     self.access = benito_access.access(config, self.auth)
     90                elif self.access_type == "containers":
     91                    self.access = containers_access.access(config, self.auth)
    9292                elif self.access_type == "desktop":
    9393                    self.access = desktop_access.access(config, self.auth)
Note: See TracChangeset for help on using the changeset viewer.