Changeset 7183b48 for fedd/federation
- Timestamp:
- Dec 8, 2009 4:50:25 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 7b26c39
- Parents:
- c17efe6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
rc17efe6 r7183b48 219 219 220 220 self.repodir = config.get("experiment_control", "repodir") 221 self.repo_url = config.get("experiment_control", "repo_url", 222 "https://users.isi.deterlab.net:23235"); 221 223 222 224 self.exp_stem = "fed-stem" … … 987 989 988 990 989 def allocate_resources(self, allocated, master, eid, expid, expcert,991 def allocate_resources(self, allocated, master, eid, expid, 990 992 tbparams, topo, tmpdir, alloc_log=None, log_collector=None, 991 993 attrs=None): … … 1843 1845 # XXX 1844 1846 softmap[pkg] = \ 1845 " https://users.isi.deterlab.net:23235/%s/%s" %\1846 ( path, dest)1847 "%s/%s/%s" %\ 1848 ( self.repo_url, path, dest) 1847 1849 1848 1850 # Allow the individual segments to access the software. … … 1884 1886 raise service_error(service_error.internal, 1885 1887 "Access map and authorizer out of sync in " + \ 1886 " create_experiment for fedid %s" % fid)1888 "new_experiment for fedid %s" % fid) 1887 1889 1888 1890 pid = "dummy" … … 1937 1939 to instantiate them and start it all up. 1938 1940 """ 1939 if not self.auth.check_attribute(fid, 'create'): 1940 raise service_error(service_error.access, "Create access denied") 1941 1942 req = req.get('CreateRequestBody', None) 1943 if not req: 1944 raise service_error(service_error.req, 1945 "Bad request format (no CreateRequestBody)") 1946 1947 # Get the experiment access 1948 exp = req.get('experimentID', None) 1949 if exp: 1950 if exp.has_key('fedid'): 1951 key = exp['fedid'] 1952 expid = key 1953 eid = None 1954 elif exp.has_key('localname'): 1955 key = exp['localname'] 1956 eid = key 1957 expid = None 1958 else: 1959 raise service_error(service_error.req, "Unknown lookup type") 1960 else: 1961 raise service_error(service_error.req, "No request?") 1962 1963 self.check_experiment_access(fid, key) 1941 1964 1942 1965 try: … … 1962 1985 gid = "dummy" 1963 1986 1964 req = req.get('CreateRequestBody', None)1965 if not req:1966 raise service_error(service_error.req,1967 "Bad request format (no CreateRequestBody)")1968 1987 # The tcl parser needs to read a file so put the content into that file 1969 1988 descr=req.get('experimentdescription', None) … … 1984 2003 raise service_error(service_error.req, "No experiment description") 1985 2004 1986 # Generate an ID for the experiment (slice) and a certificate that the 1987 # allocator can use to prove they own it. We'll ship it back through 1988 # the encrypted connection. 1989 (expid, expcert) = generate_fedid("test", dir=tmpdir, log=self.log) 1990 1991 eid = self.create_experiment_state(fid, req, expid, expcert) 2005 self.state_lock.acquire() 2006 if self.state.has_key(key): 2007 for e in self.state[key].get('experimentID',[]): 2008 if not expid and e.has_key('fedid'): 2009 expid = e['fedid'] 2010 elif not eid and e.has_key('localname'): 2011 eid = e['localname'] 2012 self.state_lock.release() 2013 2014 if not (eid and expid): 2015 raise service_error(service_error.internal, 2016 "Cannot find local experiment info!?") 2017 1992 2018 try: 1993 2019 # This catches exceptions to clear the placeholder if necessary … … 2161 2187 alloc_log.addHandler(h) 2162 2188 2163 # XXX2164 url_base = 'https://users.isi.deterlab.net:23235'2165 2189 attrs = [ 2166 2190 { 2167 2191 'attribute': 'ssh_pubkey', 2168 2192 'value': '%s/%s/config/%s' % \ 2169 ( url_base, expid, gw_pubkey_base)2193 (self.repo_url, expid, gw_pubkey_base) 2170 2194 }, 2171 2195 { 2172 2196 'attribute': 'ssh_secretkey', 2173 2197 'value': '%s/%s/config/%s' % \ 2174 ( url_base, expid, gw_secretkey_base)2198 (self.repo_url, expid, gw_secretkey_base) 2175 2199 }, 2176 2200 { 2177 2201 'attribute': 'hosts', 2178 2202 'value': '%s/%s/config/hosts' % \ 2179 ( url_base, expid)2203 (self.repo_url, expid) 2180 2204 }, 2181 2205 { … … 2187 2211 # Start a thread to do the resource allocation 2188 2212 t = Thread(target=self.allocate_resources, 2189 args=(allocated, master, eid, expid, expcert,tbparams,2213 args=(allocated, master, eid, expid, tbparams, 2190 2214 topo, tmpdir, alloc_log, alloc_collector, attrs), 2191 2215 name=eid) … … 2197 2221 ], 2198 2222 'experimentStatus': 'starting', 2199 'experimentAccess': { 'X509' : expcert }2200 2223 } 2201 2224 … … 2250 2273 2251 2274 def get_handler(self, path, fid): 2275 self.log.info("Get handler %s %s" % (path, fid)) 2252 2276 if self.auth.check_attribute(fid, path): 2253 2277 return ("%s/%s" % (self.repodir, path), "application/binary")
Note: See TracChangeset
for help on using the changeset viewer.