- Timestamp:
- Feb 1, 2013 5:15:31 PM (12 years ago)
- Branches:
- master
- Children:
- e48d8eb
- Parents:
- f7fc551
- Location:
- fedd/federation
- Files:
-
- 1 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/containers_access.py
rf7fc551 rc261c0f 30 30 from deter import topdl 31 31 import list_log 32 import benito_segment32 import containers_segment 33 33 34 34 … … 56 56 emulab_access.__init__(self, config, auth) 57 57 58 self.containerize = config.get('access', 'containerize') 59 58 60 # Segment creation is where most of the differences are. 59 self.start_segment = benito_segment.start_segment60 self.stop_segment = benito_segment.stop_segment61 self.info_segment = benito_segment.info_segment61 self.start_segment = containers_segment.start_segment 62 self.stop_segment = containers_segment.stop_segment 63 self.info_segment = containers_segment.info_segment 62 64 63 65 # These are subroutines for StartSegment … … 65 67 """ 66 68 Benito is expecting a topdl file, so this routine is misnamed. It does 67 clean up the topdl, removing elements benitodoesn't understand and69 clean up the topdl, removing elements containers doesn't understand and 68 70 writing out the file. 69 71 """ … … 79 81 if isinstance(e, topdl.Segment): 80 82 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') 81 86 # Fix software paths 82 87 for s in getattr(e, 'software', []): … … 86 91 t.incorporate_elements() 87 92 88 # Convert to ns and write it out93 # Write it out 89 94 expfile = topdl.topology_to_xml(t, top='experiment') 90 95 try: -
fedd/federation/containers_segment.py
rf7fc551 rc261c0f 24 24 ssh_emulab_segment.__init__(self, log=log, keyfile=keyfile, debug=debug) 25 25 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' 28 28 29 29 def get_mapping(self, pid, eid): 30 30 """ 31 Benito's info reporting is not sufficient to support this yet31 Containers's info reporting is not sufficient to support this yet 32 32 """ 33 33 pass … … 103 103 """ 104 104 105 # benitolistens to the filename extension. tclfile here is really105 # containers listens to the filename extension. tclfile here is really 106 106 # topdl, but we'll move it to a different filename. 107 107 if tclfile.endswith('.tcl'): 108 108 topdlfile = os.path.join(tmpdir, 'experiment.xml') 109 os.rename(tclfile, topdlfile)109 self.ssh_cmd(user, self.ops, 'mv %s %s' % (tclfile, topdlfile)) 110 110 else: 111 111 topdlfile = tclfile … … 117 117 self.terminate_exp(pid, eid) 118 118 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) 134 120 135 121 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): 137 127 return False 138 128 -
fedd/federation/deter_impl.py
rf7fc551 rc261c0f 7 7 import protogeni_access 8 8 import deter_internal_access 9 import benito_access9 import containers_access 10 10 import desktop_access 11 11 import skeleton_access … … 88 88 self.access = deter_internal_access.access(config, 89 89 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) 92 92 elif self.access_type == "desktop": 93 93 self.access = desktop_access.access(config, self.auth)
Note: See TracChangeset
for help on using the changeset viewer.