Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 68dd4db7 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

move compiling to worker to debug process mode + debug of cmb example + handle...

move compiling to worker to debug process mode + debug of cmb example + handle no user table exception
parent d80055cf
......@@ -30,6 +30,8 @@ def check_access(auth_type, access_level):
raise cherrypy.HTTPError(400, 'Bad Request')
dic = get_credentials(access_level)
if len(dic)==0:
return False
if auth_type == 'ACL':
#Check that otherwise authenticated user has the required
......@@ -71,8 +73,11 @@ def get_credentials(access_level=1):
else:
conn.text_factory=str
with conn:
l = conn.execute('select user, passwd from users where access_level >= ?',(access_level,)).fetchall()
dic = dict(l)
try:
l = conn.execute('select user, passwd from users where access_level >= ?',(access_level,)).fetchall()
dic = dict(l)
except:
dic = dict([])
conn.close()
return dic
......
......@@ -94,7 +94,7 @@ class Repository:
## code
fn = self._match_fn (fns, s)
source = self.get_code_source(fn)
self._code[s] = compile(source, fn, "exec")
self._code[s] = (source, fn)#compile(source, fn, "exec")
self._all_string[s] =source
## hooks
......@@ -108,7 +108,7 @@ class Repository:
logger.warning(repr(e))
source=""
fn=""
self._hook[s][h] = compile(source, fn, "exec")
self._hook[s][h] = (source, fn)#compile(source, fn, "exec")
self._all_string[s] +=source
## deps
......
......@@ -213,17 +213,20 @@ class Scheduler():
if not path.exists(d):
os.mkdir(d)
r = self.pipe.repository
f = r.get_code_string(seg).co_filename
f = r.get_code_string(seg)
if f:
dest = d+'/'+os.path.basename(f)
os.system("cp %s %s"%(f, dest))
dest = d+'/'+os.path.basename(f[1])
fid = open(dest, "w")
fid.write(f[0])
fid.close()
lst_hook = r.get_hook_list(seg)
for h in lst_hook:
f = r.get_hook_string(seg, h).co_filename
f = r.get_hook_string(seg, h)
if f:
dest = d+'/'+os.path.basename(f)
os.system("cp %s %s"%(f, dest))
dest = d+'/'+os.path.basename(f[1])
fid = open(dest, "w")
fid.write(f[0])
fid.close()
parents = self.pipe.get_parents(seg) ## parents segments
d = self.tracker.get_done(seg) ## done tasks
......
......@@ -163,7 +163,7 @@ class Worker(object):
env: environment object.
"""
try:
exec (code, glo)
exec (compile(code[0], code[1], "exec"), glo)
# We do not want to prevent Abortion
except AbortError, e:
raise e
......@@ -249,7 +249,7 @@ class InteractiveWorker(Worker):
Main difference is that exception occuring in the segment code
are not caught.
"""
exec(code, glo)
exec(compile(code[0], code[1], "exec"), glo)
self.task.status = "done"
def terminate(self):
......
......@@ -3,8 +3,9 @@
Generate a cmb map from lambda-CDM power spectrum.
"""
import healpy as hp
import pylab as pl
import healpy as hp
### Define some global parameters
lst_par = ['lmax', 'nside', 'cmb_unit', 'sim_id', 'input_cl']
......
......@@ -3,9 +3,8 @@
Compute coupling matrix from hitcount map.
Compute noise power.
"""
import healpy as hp
import pylab as pl
import healpy as hp
import numpy as npy
import spherelib as sp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment