Changeset b234bb9 for fedd


Ignore:
Timestamp:
Aug 28, 2008 2:47:15 PM (16 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
2d5c8b6
Parents:
0d830de
Message:

Experiment creation integrated

Location:
fedd
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd.py

    r0d830de rb234bb9  
    162162        impl = new_feddservice(opts.configfile)
    163163    except RuntimeError, e:
    164         sys.exit("Error configuring fedd: %s" % e.message)
     164        str = getattr(e, 'desc', None) or getattr(e,'message', None) or \
     165                "No message"
     166        sys.exit("Error configuring fedd: %s" % str)
    165167else:
    166168    sys.exit("--configfile is required")
  • fedd/fedd_bindings.wsdl

    r0d830de rb234bb9  
    3737        </fault>
    3838      </operation>
     39      <operation name="Create">
     40        <documentation>
     41          The bindings of this operation are straightforward SOAP RPC 1.1.
     42        </documentation>
     43        <soap:operation soapAction="Create"/>
     44        <input>
     45          <soap:body use="encoded" parts="tns:CreateRequestBody"
     46            namespace="http://www.isi.edu/faber/fedd.wsdl"
     47            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
     48        </input>
     49        <output>
     50          <soap:body use="encoded" parts="tns:CreateResponseBody"
     51            namespace="http://www.isi.edu/faber/fedd.wsdl"
     52            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
     53        </output>
     54        <fault>
     55          <soap:fault use="encoded"  name="tns:CreateFault"
     56            namespace="http://www.isi.edu/faber/fedd.wsdl"
     57            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
     58        </fault>
     59      </operation>
    3960    </binding>
    4061
  • fedd/fedd_create_experiment.py

    r0d830de rb234bb9  
    10891089                    "Can't make temporary dir")
    10901090
     1091        req = req.get('CreateRequestBody', None)
     1092        if not req:
     1093            raise service_error(service_error.request,
     1094                    "Bad request format (no CreateRequestBody)")
    10911095        # The tcl parser needs to read a file so put the content into that file
    10921096        file_content=req.get('experimentdescription', None)
    1093         if file_content != None:
     1097        if file_content:
    10941098            try:
    10951099                f = open(tclfile, 'w')
  • fedd/fedd_messages.wsdl

    r0d830de rb234bb9  
    1515  </message>
    1616
     17  <message name="CreateRequestMessage">
     18    <part name="CreateRequestBody" type="xsd1:createRequestType"/>
     19  </message>
     20
     21  <message name="CreateResponseMessage">
     22    <part name="CreateResponseBody" type="xsd1:createResponseType"/>
     23  </message>
     24
    1725  <message name="FaultMessage">
    1826    <part name="FaultBody" type="xsd1:faultType"/>
     
    2937        message="tns:FaultMessage"/>
    3038    </operation>
     39    <operation name="Create">
     40      <documentation>
     41        Fill this in
     42      </documentation>
     43      <input message="tns:CreateRequestMessage"/>
     44      <output message="tns:CreateResponseMessage"/>
     45      <fault name="CreateFault" message="tns:FaultMessage"/>
     46    </operation>
    3147  </portType>
    3248</definitions>
  • fedd/fedd_proj.py

    r0d830de rb234bb9  
    2020from fedd_util import *
    2121from fedd_allocate_project import *
     22from fedd_create_experiment import *
    2223import parse_detail
    2324from service_error import *
     
    3132    """
    3233    # Attributes that can be parsed from the configuration file
    33     bool_attrs = ("dynamic_projects", "project_priority")
     34    bool_attrs = ("dynamic_projects", "project_priority", "create_debug")
    3435    emulab_attrs = ("boss", "ops", "domain", "fileserver", "eventserver")
    3536    id_attrs = ("testbed", "cert_file", "cert_pwd", "trusted_certs", "proxy",
    3637            "proxy_cert_file", "proxy_cert_pwd", "proxy_trusted_certs",
    3738            "dynamic_projects_url", "dynamic_projects_cert_file",
    38             "dynamic_projects_cert_pwd", "dynamic_projects_trusted_certs")
     39            "dynamic_projects_cert_pwd", "dynamic_projects_trusted_certs",
     40            "create_experiment_cert_file", "create_experiment_cert_pwd",
     41            "create_experiment_trusted_certs", "federation_script_dir",
     42            "ssh_pubkey_file")
    3943
    4044    # Used by the SOAP caller
    4145    soap_namespaces = ('http://www.isi.edu/faber/fedd.wsdl',
    4246            'http://www.isi.edu/faber/fedd_internal.wsdl')
    43     soap_methods = { 'RequestAccess': 'soap_RequestAccess' }
     47    soap_methods = {\
     48            'RequestAccess': 'soap_RequestAccess',\
     49            'Create' : 'soap_Create',\
     50            }
    4451    xmlrpc_methods = { 'RequestAccess': 'xmlrpc_RequestAccess' }
    4552
     
    8592        self.fedid_default = "user"
    8693        self.restricted = []
    87 
    88         # Delete these
    89         self.wap = '/usr/testbed/sbin/wap'
    90         self.newproj = '/usr/testbed/sbin/newproj'
    91         self.mkproj = '/usr/testbed/sbin/mkproj'
    92         self.grantnodetype = '/usr/testbed/sbin/grantnodetype'
     94        self.create_debug = False
    9395
    9496        # Read the configuration
     
    120122                self.dynamic_projects_trusted_certs,
    121123                self.dynamic_projects_cert_pwd)
     124
     125        # Initialize create experiment certs
     126        if not self.create_experiment_cert_file:
     127            self.create_experiment_cert_file = self.proxy_cert_file
     128            self.create_experiment_cert_pwd = self.proxy_cert_pwd
     129
     130        if self.create_experiment_trusted_certs == None:
     131            self.create_experiment_trusted_certs = self.proxy_trusted_certs
    122132
    123133        if self.dynamic_projects_url == None:
     
    130140                fedd_allocate_project_remote(self.dynamic_projects,
    131141                        self.dynamic_projects_url, proj_certs)
     142
     143        create_kwargs = { }
     144        if self.federation_script_dir:
     145            create_kwargs['scripts_dir'] = self.federation_script_dir
     146        if self.ssh_pubkey_file:
     147            create_kwargs['ssh_pubkey_file'] = self.ssh_pubkey_file
     148        if self.create_experiment_cert_file:
     149            create_kwargs['cert_file'] = self.create_experiment_cert_file
     150        if self.create_experiment_cert_pwd:
     151            create_kwargs['cert_pwd'] = self.create_experiment_cert_pwd
     152        if self.create_experiment_trusted_certs:
     153            create_kwargs['trusted_certs'] = \
     154                    self.create_experiment_trusted_certs
     155
     156        self.create_experiment = fedd_create_experiment_local(
     157            tbmap = {
     158                'deter':'https://users.isi.deterlab.net:23235',
     159                'emulab':'https://users.isi.deterlab.net:23236',
     160                'ucb':'https://users.isi.deterlab.net:23237',
     161                },
     162            trace_file=sys.stderr,
     163            debug=self.create_debug,
     164            **create_kwargs
     165        )
    132166
    133167    def dump_state(self):
     
    525559        return resp
    526560
     561    def soap_Create(self, ps, fid):
     562        req = ps.Parse(CreateRequestMessage.typecode)
     563
     564        msg = self.create_experiment.create_experiment(unpack_soap(req), fedid)
     565
     566        resp = CreateResponseMessage()
     567        resp.set_element_CreateResponseBody(
     568                pack_soap(resp, "CreateResponseBody", msg))
     569
     570        return resp
     571
    527572    def xmlrpc_RequestAccess(self, params, fid):
    528573        msg = self.RequestAccess(params[0], fedid)
  • fedd/fedd_types.xsd

    r0d830de rb234bb9  
    154154      <xsd:element name="eventServer" type="xsd:string"/>
    155155      <xsd:element name="fedAttr" type="tns:fedAttrType" minOccurs="0"
     156        maxOccurs="unbounded"/>
     157    </xsd:sequence>
     158  </xsd:complexType>
     159
     160  <xsd:complexType name="vtoponodeType">
     161    <xsd:annotation>
     162      <xsd:documentation>
     163        Node in the virtual topology of a federated experiment (emulab legacy)
     164      </xsd:documentation>
     165    </xsd:annotation>
     166    <xsd:sequence>
     167      <xsd:element name="vname" type="xsd:string"/>
     168      <xsd:element name="ips" type="xsd:string"/>
     169    </xsd:sequence>
     170  </xsd:complexType>
     171
     172  <xsd:complexType name="vtoponodesType">
     173    <xsd:annotation>
     174      <xsd:documentation>
     175        Collection of nodes in the virtual topology of a federated experiment (emulab legacy)
     176      </xsd:documentation>
     177    </xsd:annotation>
     178    <xsd:sequence>
     179      <xsd:element name="node" type="tns:vtoponodeType" minOccurs="0"
     180        maxOccurs="unbounded"/>
     181    </xsd:sequence>
     182  </xsd:complexType>
     183
     184  <xsd:complexType name="vtopolanType">
     185    <xsd:annotation>
     186      <xsd:documentation>
     187        LAN in the virtual topology of a federated experiment (emulab legacy)
     188      </xsd:documentation>
     189    </xsd:annotation>
     190    <xsd:sequence>
     191      <xsd:element name="vname" type="xsd:string"/>
     192      <xsd:element name="vnode" type="xsd:string"/>
     193      <xsd:element name="ip" type="xsd:string"/>
     194      <xsd:element name="bandwidth" type="xsd:int"/>
     195      <xsd:element name="delay" type="xsd:float"/>
     196      <xsd:element name="member" type="xsd:string"/>
     197    </xsd:sequence>
     198  </xsd:complexType>
     199
     200  <xsd:complexType name="vtopolansType">
     201    <xsd:annotation>
     202      <xsd:documentation>
     203        Collection of LAN in the virtual topology of a federated experiment (emulab legacy)
     204      </xsd:documentation>
     205    </xsd:annotation>
     206    <xsd:sequence>
     207      <xsd:element name="lan" type="tns:vtopolanType" minOccurs="0"
     208        maxOccurs="unbounded"/>
     209    </xsd:sequence>
     210  </xsd:complexType>
     211
     212  <xsd:complexType name="vtopoType">
     213    <xsd:annotation>
     214      <xsd:documentation>
     215        The virtual topology of a federated experiment (emulab legacy)
     216      </xsd:documentation>
     217    </xsd:annotation>
     218    <xsd:sequence>
     219      <xsd:element name="nodes" type="tns:vtoponodesType"/>
     220      <xsd:element name="lans" type="tns:vtopolansType"/>
     221    </xsd:sequence>
     222  </xsd:complexType>
     223
     224  <xsd:complexType name="visnodeType">
     225    <xsd:annotation>
     226      <xsd:documentation>
     227        Node in the visualization of a federated experiment (emulab legacy)
     228      </xsd:documentation>
     229    </xsd:annotation>
     230    <xsd:sequence>
     231      <xsd:element name="name" type="xsd:string"/>
     232      <xsd:element name="x" type="xsd:int"/>
     233      <xsd:element name="y" type="xsd:int"/>
     234      <xsd:element name="type" type="xsd:string"/>
     235    </xsd:sequence>
     236  </xsd:complexType>
     237
     238  <xsd:complexType name="visType">
     239    <xsd:annotation>
     240      <xsd:documentation>
     241        The visualization of a federated experiment (emulab legacy)
     242      </xsd:documentation>
     243    </xsd:annotation>
     244    <xsd:sequence>
     245      <xsd:element name="node" type="tns:visnodeType" minOccurs="0"
    156246        maxOccurs="unbounded"/>
    157247    </xsd:sequence>
     
    246336    </xsd:annotation>
    247337    <xsd:sequence>
    248       <xsd:element name="emulab" type="emulabType" minOccurs="1"
    249         maxOccurs="unbounded"/>
     338      <xsd:element name="emulab" type="tns:emulabType" minOccurs="1"
     339        maxOccurs="unbounded"/>
     340      <xsd:element name="experiment" type="tns:vtopoType" minOccurs="0"
     341        maxOccurs="1"/>
     342      <xsd:element name="vis" type="tns:visType" minOccurs="0"
     343        maxOccurs="1"/>
    250344    </xsd:sequence>
    251345  </xsd:complexType>
  • fedd/fedd_util.py

    r0d830de rb234bb9  
    181181    """
    182182    if getattr(contents, "__iter__", None) != None:
    183         obj = getattr(container, "new_%s" % name, None)()
     183        attr =getattr(container, "new_%s" % name, None)
     184        if attr: obj = attr()
     185        else:
     186            print dir(container)
     187            raise TypeError("%s does not have a new_%s attribute" % \
     188                    (container, name))
    184189        for e, v in contents.iteritems():
    185190            assign = getattr(obj, "set_element_%s" % e, None) or \
Note: See TracChangeset for help on using the changeset viewer.