- Timestamp:
- Aug 13, 2010 1:33:28 AM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 1d91791f
- Parents:
- 8aaf8f8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/protogeni_access.py
r8aaf8f8 rc2f92c5 752 752 stage_file(script, "%s.gw.conf" % elem.name, fed_etc_dir) 753 753 754 # Hackery dackery dock: the ProtoGENI python is really ancient. 755 # A modern version (though packaged for Mandrake (remember 756 # Mandrake? good times, good times)) should be in the 757 # federation_software list, but we need to move rename is for 758 # SEER. 759 print >>script, "rm /usr/bin/python" 760 print >>script, "ln /usr/bin/python2.4 /usr/bin/python" 761 # Back to less hacky stuff 754 # Done with staging, remove the identity used to stage 755 print >>script, "#/bin/rm .ssh/id_rsa" 762 756 763 757 # Start commands … … 815 809 """ 816 810 # Place an identity on the node so that the copying can succeed 817 segment_commands.ssh_cmd(user, host, "scp .ssh/id_rsa %s:.ssh" % node) 811 segment_commands.scp_file( segment_commands.ssh_privkey_file, 812 user, node, ".ssh/id_rsa") 818 813 segment_commands.ssh_cmd(user, node, 819 814 "sudo /bin/sh ./%s.startup &" % node) … … 979 974 return (slice_cred, sliver_cred, manifest) 980 975 981 def wait_for_slice(self, segment_commands, slice_cred, ctxt ):976 def wait_for_slice(self, segment_commands, slice_cred, ctxt, timeout=None): 982 977 """ 983 978 Wait for the given slice to finish its startup. Return the final … … 985 980 """ 986 981 status = 'notready' 982 if timeout is not None: 983 end = time.time() + timeout 987 984 try: 988 985 while status == 'notready': … … 994 991 status = r.get('status', 'notready') 995 992 if status == 'notready': 993 if timeout is not None and time.time() > end: 994 return 'timeout' 996 995 time.sleep(30) 997 996 except segment_commands.ProtoGENIError, e: … … 1063 1062 1064 1063 # Now we wait for the nodes to start on PG 1065 status = self.wait_for_slice(segment_commands, slice_cred, ctxt) 1064 status = self.wait_for_slice(segment_commands, slice_cred, ctxt, 1065 timeout=300) 1066 1066 if status == 'failed': 1067 1067 self.log.error('Sliver failed to start on ProtoGENI') 1068 self.delete_slice(segment_commands, slice_cred, ctxt) 1069 return False 1070 elif status == 'timeout': 1071 self.log.error('Sliver failed to start on ProtoGENI (timeout)') 1068 1072 self.delete_slice(segment_commands, slice_cred, ctxt) 1069 1073 return False … … 1093 1097 1094 1098 def generate_rspec(self, topo, softdir, connInfo): 1099 1100 # Force a useful image. Without picking this the nodes can get 1101 # different images and there is great pain. 1102 def image_filter(e): 1103 if isinstance(e, topdl.Computer): 1104 return '<disk_image name="urn:publicid:IDN+emulab.net+' + \ 1105 'image+emulab-ops//FEDORA10-STD" />' 1106 else: 1107 return "" 1108 # Main line of generate 1095 1109 t = topo.clone() 1096 1110 … … 1130 1144 t.incorporate_elements() 1131 1145 1132 # Customize the ns2 output for local portal commands and images 1133 filters = [] 1134 1135 # NB: these are extra commands issued for the node, not the startcmds 1136 if self.portal_command: 1137 filters.append(topdl.generate_portal_command_filter( 1138 self.portal_command)) 1146 # Customize the rspec output to use the image we like 1147 filters = [ image_filter ] 1139 1148 1140 1149 # Convert to rspec and return it 1141 1150 exp_rspec = topdl.topology_to_rspec(t, filters) 1151 print exp_rspec 1142 1152 1143 1153 return exp_rspec … … 1172 1182 base = os.path.basename(f) 1173 1183 copy_file(f, "%s/%s" % (softdir, base)) 1174 1175 # Ick. Put this python rpm in a place that it will get moved into1176 # the staging area. It's a hack to install a modern (in a Roman1177 # sense of modern) python on ProtoGENI1178 python_rpm ="python2.4-2.4-1pydotorg.i586.rpm"1179 if os.access("./%s" % python_rpm, os.R_OK):1180 copy_file("./%s" % python_rpm, "%s/%s" % (softdir, python_rpm))1181 1184 1182 1185
Note: See TracChangeset
for help on using the changeset viewer.