Changeset c2f92c5


Ignore:
Timestamp:
Aug 13, 2010 1:33:28 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
1d91791f
Parents:
8aaf8f8
Message:

The protoGENI OS version lurched forward. This code removes the hacky stuff
used to support the old version and attempts to insure that a useful OSversion
is always used - it is possible to get the old OS randomly at this time as
well.

The hacks to support an ancient OS version don't work on a modern version and
vice versa, so we moved forward to teh modern version.

fedkit updates are also required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/protogeni_access.py

    r8aaf8f8 rc2f92c5  
    752752                stage_file(script, "%s.gw.conf" % elem.name, fed_etc_dir)
    753753
    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"
    762756
    763757            # Start commands
     
    815809        """
    816810        # 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")
    818813        segment_commands.ssh_cmd(user, node,
    819814                "sudo /bin/sh ./%s.startup &" % node)
     
    979974        return (slice_cred, sliver_cred, manifest)
    980975
    981     def wait_for_slice(self, segment_commands, slice_cred, ctxt):
     976    def wait_for_slice(self, segment_commands, slice_cred, ctxt, timeout=None):
    982977        """
    983978        Wait for the given slice to finish its startup.  Return the final
     
    985980        """
    986981        status = 'notready'
     982        if timeout is not None:
     983            end = time.time() + timeout
    987984        try:
    988985            while status == 'notready':
     
    994991                status = r.get('status', 'notready')
    995992                if status == 'notready':
     993                    if timeout is not None and time.time() > end:
     994                        return 'timeout'
    996995                    time.sleep(30)
    997996        except segment_commands.ProtoGENIError, e:
     
    10631062
    10641063        # 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)
    10661066        if status == 'failed':
    10671067            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)')
    10681072            self.delete_slice(segment_commands, slice_cred, ctxt)
    10691073            return False
     
    10931097
    10941098    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
    10951109        t = topo.clone()
    10961110
     
    11301144        t.incorporate_elements()
    11311145
    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 ]
    11391148
    11401149        # Convert to rspec and return it
    11411150        exp_rspec = topdl.topology_to_rspec(t, filters)
     1151        print exp_rspec
    11421152
    11431153        return exp_rspec
     
    11721182                base = os.path.basename(f)
    11731183                copy_file(f, "%s/%s" % (softdir, base))
    1174 
    1175         # Ick.  Put this python rpm in a place that it will get moved into
    1176         # the staging area.  It's a hack to install a modern (in a Roman
    1177         # sense of modern) python on ProtoGENI
    1178         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))
    11811184
    11821185
Note: See TracChangeset for help on using the changeset viewer.